Skip to main content

A read-only semantic version commit parsing and validation tool

Project description

semv - A read-only semantic version commit parsing and validation tool

This package is inspired by a talk by Stephan Bönnemann as well as the package python semantic release. Both suggest parsing commit message to automatically create a new version number. Although this is a great idea, I don't think that commit messages can be guaranteed to be of sufficiently high quality to be used for this. Stephan's talk acknowledges this point and suggests strategies for automatically validating commit messages. Unfortunately, these are not implemented in python semantic release. In addition, python semantic release does a lot more than just versioning: It covers the full release process, including uploads to pypi or github releases. As a result, running python semantic release can have quite a few unexpected side effects that might be difficult to undo. I would prefer a tool that does the hard part of the automatic semantic versioning (parsing and validating commit messages) but doesn't have any side effects—the user should be free to use tags, variables, commits or whatever they like to represent new versions and the user should not be surprised by unexpected write operations. I therefore wrote semv, a read-only semantic version commit parsing and validation tool.

Installation and usage

You can install semv from pypi using

  $ pip install semv

If you are inside a git repository, you can use semv to print the semantic version that the current commit should recieve. E.g.

  $ semv
  v1.0.5 (no-eol)

Note that this will have not change anything about your repository. It is up to you to use the printed version. An example for using the printed version is given in semv's own release workflow.

Configuration

You can configure semv via the pyproject.toml config file. Here are the defaults:

[tool.semv]
invalid_commit_action = "warning"  # Could also be "error" or "skip"

[tool.semv.types]
feat = "minor"
fix = "patch"
perf = "patch"
chore = "valid"
test = "valid"
docs = "valid"
ci = "valid"
refactor = "valid"
style = "valid"

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

semv-2.5.0.tar.gz (31.0 kB view details)

Uploaded Source

Built Distribution

semv-2.5.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file semv-2.5.0.tar.gz.

File metadata

  • Download URL: semv-2.5.0.tar.gz
  • Upload date:
  • Size: 31.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for semv-2.5.0.tar.gz
Algorithm Hash digest
SHA256 c4ca6fe42eeaba1be6aa70f395ea6135bd2f85a76f600f8d8f71da3ee09806ad
MD5 619ad5ca9aa63020221d3a2fa8900768
BLAKE2b-256 f334ce618132593148d872fcfd402bf23a3c63d3e77e7fc68a8f9e61df27b9f0

See more details on using hashes here.

File details

Details for the file semv-2.5.0-py3-none-any.whl.

File metadata

  • Download URL: semv-2.5.0-py3-none-any.whl
  • Upload date:
  • Size: 17.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for semv-2.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f7095b59ff6bcc9cc888a92a5edaa1378b4dfb3293902245bf98939d2afbcb3e
MD5 88e5189a038a39bf8ce8eea4e96177f8
BLAKE2b-256 e29515ec55fad5ec6ceedcf1cd2aa9673df063c8a350371d283d90fd32b7a7c3

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