Skip to main content

Hatch plugin for versioning with your preferred VCS

Project description

hatch-vcs

CI/CD CI - Test CD - Build
Package PyPI - Version PyPI - Python Version
Meta code style - black types - Mypy imports - isort License - MIT GitHub Sponsors

This provides a plugin for Hatch that uses your preferred version control system (like Git) to determine project versions.

Table of Contents

Global dependency

Ensure hatch-vcs is defined within the build-system.requires field in your pyproject.toml file.

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

Version source

The version source plugin name is vcs.

  • pyproject.toml

    [tool.hatch.version]
    
  • hatch.toml

    [version]
    

Version source options

Option Type Default Description
tag-pattern str see code A regular expression used to extract the version part from VCS tags. The pattern needs to contain either a single match group, or a group named version, that captures the actual version information.
fallback-version str The version that will be used if no other method for detecting the version is successful. If not specified, unsuccessful version detection will raise an error.
raw-options dict A table of setuptools-scm parameters that will override any of the options listed above. The write_to and write_to_template parameters are ignored.

Build hook

The build hook plugin name is vcs.

  • pyproject.toml

    [tool.hatch.build.hooks.vcs]
    
  • hatch.toml

    [build.hooks.vcs]
    

Build hook options

Option Type Default Description
version-file str REQUIRED The relative path to the file that gets updated with the current version.
template str The template used to overwrite the version-file. See the code for the default template for each file extension.

License

hatch-vcs is distributed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hatch_vcs-0.1.0.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

hatch_vcs-0.1.0-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file hatch_vcs-0.1.0.tar.gz.

File metadata

  • Download URL: hatch_vcs-0.1.0.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for hatch_vcs-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e036e29c954c95a07154b37ab85222eae60f66f58aa5b19f4c18a7938611bdd7
MD5 b869c9a2d096ab274c67b51863ac7fc7
BLAKE2b-256 9c17f77e62a0d37ac31bb7337d920035894ddc9964edec6560a2a7bd379a2f6d

See more details on using hashes here.

File details

Details for the file hatch_vcs-0.1.0-py2.py3-none-any.whl.

File metadata

  • Download URL: hatch_vcs-0.1.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for hatch_vcs-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 aac2fdf425e3132d607b064addf117f32a76fb617b4cf126eb009f18757d2633
MD5 306fcbb26b2d1a63928dcbd07f78cb80
BLAKE2b-256 3c2a9ac005ae3b40ccb4d0328dd16bae32184726acb00c37c0a1e2650d8a8497

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page