Skip to main content

Manage your project's version numbers.

Project description

CI/CD Pytest Publish GitHub Latest Release) Coverage Status
Package PyPI - Version PyPI - Python Version Downloads
Meta Code style: black security: bandit Imports: isort linting: pylint Checked with mypy License - MIT

semvergit

semvergit

semvergit is a CLI tool to manage your project's version numbers. It uses Semantic Versioning to bump the version number. The supported bump types are:

  • major
  • minor
  • patch
  • prerelease

Internal Workflow

What's actully happening when you run this tool

  1. Use the latest git tag to determine the current version number.
  2. Bump the version number
  3. Create a new git tag
  4. Push the tag to the remote

Why?

I created this tool to help me manage my project's version numbers. I wanted a simple tool that I could use in my CI/CD pipeline to bump the version number and tag the commit.

Features

❇️ Bump the version number and update the git tag in one command
❇️ Dry run mode
❇️ Verbose mode
❇️ Custom commit message*
❇️ Auto commit message*
🆕 Version 0.4+ introduces the ability to automatically update the version number in a file*

*Please see the limitations section below

How to use

Simple install using pip install semvergit

Then you can use it in your project as simply as: semvergit -t patch -v (to bump the patch version) This will:

  1. create the relvant tag (in this case a patch bump 0.0.x -> 0.0.x+1)
  2. push it to the remote

Please checkout semvergit --help for more info.

Usage: semvergit [OPTIONS] COMMAND [ARGS]...

  CLI for semvergit.

Options:
  --version                Show the version and exit.
  -d, --dry_run            Dry run
  -v, --verbose            Verbose level  [0<=x<=2]
  -t, --bump_type TEXT     Bump Type ['major', 'minor', 'patch', 'prerelease']
  -m, --message TEXT       Commit message
  -am, --auto_message      Auto commit message
  -f, --version_file FILE  Version file
  --help                   Show this message and exit.

Limitations

Please keep in mind that when using features like commit message / auto commit message and version file the tool will try and commit the changes to the git repo.

Even though this is quite handy, it should be used mannually as it cannot be used directly in a CI/CD pipeline directed at master or main branches as it will likly fail due to the commit not being allowed without a PR.

💡 Only git tags can be pushed to the remote without a PR (and this is the main use case for this tool).

Development

Please see CONTRIBUTING.md

License

This project is published under the MIT license.

If you do find it useful, please consider contributing your changes back upstream.

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

semvergit-0.4.2.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

semvergit-0.4.2-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file semvergit-0.4.2.tar.gz.

File metadata

  • Download URL: semvergit-0.4.2.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for semvergit-0.4.2.tar.gz
Algorithm Hash digest
SHA256 ad803dc112fd932b2ee27b3c8b92106a51f7918f13b8a096d4b1358178866f09
MD5 f2d97a3631e6dd18570c91b4f9f81291
BLAKE2b-256 af1046adff664642cb1fe735d29337cf6e5f882d336c7823b4b3f21cbfd1db4b

See more details on using hashes here.

File details

Details for the file semvergit-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: semvergit-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for semvergit-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 739bf90c39fc9d2e11dabbe08355c6b82b8687e5b8cfcb8a300c1d41c28a6054
MD5 159d7b54e2ab198060b7e1e205ffb15d
BLAKE2b-256 ca488aa37acd7cb5594de73623e8e84c1da85ead95e403609ca4bf84f44c54d2

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