New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hatch-regex-commit

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hatch-regex-commit

Hatch plugin to create a commit and tag when bumping version

  • 0.0.3
  • Source
  • PyPI
  • Socket score

Maintainers
1

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:

OptionTypeDefaultDescription
check_dirtybooltrueCheck if the Git repository is dirty, e.g., you have uncommited changes. If you have, the version bumping will abort.
commitbooltrueWhether to create a Git commit.
commit_messagestrBump version {current_version} → {new_version}Template of the Git commit message.
commit_extra_argslist[str][]List of extra arguments for Git commit command.
tagbooltrueWhether to create a Git tag.
tag_namestrv{new_version}Template for the Git tag name.
tag_messagestrBump version {current_version} → {new_version}Template of the Git tag message.
tag_signbooltrueWhether 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.

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc