Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

hatch-vcs-tunable

PyPI - Version PyPI - Python Version Ruff Checked with mypy


This is a plugin for Hatch that extends the plugin hatch-vcs to allow for overriding some config elements with environment variables.

The reason you might want to do this is if you have multiple release tracks for your package, or multiple contexts in which it is used, and want to give it different versions in those different contexts.

Table of Contents

Plugin

Ensure hatch-vcs-tunable is listed in the build-system.requires field in your pyproject.toml:

[build-system]
requires = ["hatchling", "hatch-vcs-tunable"]
build-backend = "hatchling.build"

Configuration

hatch-vcs-tunable can be configured either through pyproject.toml, using exactly the same configuration elements as hatch-vcs but with the plugin name vcs-tunable, or via environment variable overrides.

pyproject.toml

Use the same configuration elements as hatch-vcs, but the plugin name vcs-tunable. For instance, to set the version file you would do:

[tool.hatch.build.hooks.vcs-tunable]
version-file="_version.py"

Environment

The environment variables should be specified as ALL_CAPS_UNDERSCORE versions of the pyproject settings, prefixed with HATCH_VCS_TUNABLE_. So for instance,

  • tag-pattern can be specified as HATCH_VCS_TUNABLE_TAG_PATTERN
  • fallback-version can be specified as HATCH_VCS_TUNABLE_FALLBACK_VERSION

raw-options

The value of the raw-options is passed directly to setuptools_scm. It may have multiple keyword arguments, which need both a name and a value, and the keywords may not be safe to put in the names of environment variables, so both the names and values are passed in the environment variable value. These should be passed as a string of key-name=value separated by ;. For instance, to specify both relative_to=.. and version_file=/some/path, you would do HATCH_VCS_TUNABLE_RAW_OPTIONS="relative_to=..;version_file=/some/path".

If a setting is specified both in the environment and in pyproject.toml, the environment variable will take priority.

Environment variables that are specified as empty still exist, so if you do HATCH_VCS_TUNABLE_FALLBACK_VERSION= hatch build, the fallback version will be the empty string. If you have one of these environment variables defined all the time and need to remove it, use unset.

License

hatch-git-version-tunable is distributed under the terms of the Apache-2.0 license.

Metadata

Release files for hatch-vcs-tunable 0.0.1a3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-vcs-tunable 0.0.1a3
File Size Uploaded
hatch_vcs_tunable-0.0.1a3.tar.gz 11.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-vcs-tunable 0.0.1a3
File Interpreter ABI Platform
hatch_vcs_tunable-0.0.1a3-py3-none-any.whl Python 3 none any Details

Total release size: 22.3 kB

Release files / hatch_vcs_tunable-0.0.1a3.tar.gz

Download URL hatch_vcs_tunable-0.0.1a3.tar.gz
Size 11.4 kB
Tags Source
SHA-256 checksum
How to use checksums
a2f9b3b60997f17922bd6803269ff7376db71f55823563aec6cf357748f456ef
BLAKE2b-256 checksum
How to use checksums
9db4c9a31f79b58ee2e503dc56e7d8196af544c5d0fe227b08e1988291fe5a62
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2025.

Transparency log

Release files / hatch_vcs_tunable-0.0.1a3-py3-none-any.whl

Download URL hatch_vcs_tunable-0.0.1a3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dbdfecba306afbd1c9ee506b66685e4473b0b37759f65e5a12766f81b89181e3
BLAKE2b-256 checksum
How to use checksums
22a2461104cdde42e14c7fc02b7018aae0cd29de7cfea9a06dc932618813b66a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 8, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.1a3 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page