Hatch plugin to create a commit and tag when bumping version
Low maintenance activity. Last release 14 months ago, commits in 0 of the last 26 weeks. Weaker on commit activity and recent releases.
pip install hatch-regex-commithatch-regex-commit
This provides a plugin for Hatch that automatically creates a Git commit and tag after version bumping.
Global dependency
Ensure hatch-regex-commit is defined within the build-system.requires field in your pyproject.toml file.
[build-system]
requires = ["hatchling", "hatch-regex-commit"]
build-backend = "hatchling.build"
Version source
The version source plugin name is regex_commit.
-
pyproject.toml
[tool.hatch.version] source = "regex_commit" path = "my_library/___about___.py" -
hatch.toml
[version] source = "regex_commit" path = "my_library/___about___.py"
Version source options
This plugin inherits from the Hatch builtin Regex version source. It inherits from all its options and add the following ones:
| Option | Type | Default | Description |
|---|---|---|---|
check_dirty | bool | true | Check if the Git repository is dirty, e.g., you have uncommited changes. If you have, the version bumping will abort. |
commit | bool | true | Whether to create a Git commit. |
commit_message | str |