Skip to main content

hatch-regex-commit

PyPI - Version PyPI - Python Version


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 Bump version {current_version} → {new_version} Template of the Git commit message.
commit_extra_args list[str] [] List of extra arguments for Git commit command.
tag bool true Whether to create a Git tag.
tag_name str v{new_version} Template for the Git tag name.
tag_message str Bump version {current_version} → {new_version} Template of the Git tag message.
tag_sign bool true Whether to sign the Git tag.

Examples

Basic

  [tool.hatch.version]
  source = "regex_commit"
  path = "my_library/___about___.py"

Custom commit message

  [tool.hatch.version]
  source = "regex_commit"
  path = "my_library/___about___.py"
  commit_message = "🚀 Version {new_version}"

Edit commit message in the editor before proceeding

  [tool.hatch.version]
  source = "regex_commit"
  path = "my_library/___about___.py"
  commit_extra_args = ["-e"]

Disable Git tag

  [tool.hatch.version]
  source = "regex_commit"
  path = "my_library/___about___.py"
  tag = false

License

hatch-regex-commit is distributed under the terms of the MIT license.

Metadata

Release files for hatch-regex-commit 0.0.4

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-regex-commit 0.0.4
File Size Uploaded
hatch_regex_commit-0.0.4.tar.gz 6.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-regex-commit 0.0.4
File Interpreter ABI Platform
hatch_regex_commit-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.9 kB

Release files / hatch_regex_commit-0.0.4.tar.gz

Download URL hatch_regex_commit-0.0.4.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ccf5c0ddc9040233328a16cf727700406485f22a5307683cce0ac82e24e44689
BLAKE2b-256 checksum
How to use checksums
e80aa3f18ecffc9629fca96ca58e4d764a6ef2c07f5f536e35eb0ceb36728c7d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release files / hatch_regex_commit-0.0.4-py3-none-any.whl

Download URL hatch_regex_commit-0.0.4-py3-none-any.whl
Size 6.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3094a7ddf7e4dbdf9a3cbaeadeacfb187b2bf29ee232602c8fd735ceee90bbe5
BLAKE2b-256 checksum
How to use checksums
3c01a6639792060d304d9485d4ba584c42de0ea3e02fa92ade43bb1baa60ab38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via python-httpx/0.28.1

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

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