Skip to main content

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"

Metadata

Release files for semv 2.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for semv 2.5.0
File Size Uploaded
semv-2.5.0.tar.gz 31.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for semv 2.5.0
File Interpreter ABI Platform
semv-2.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 48.0 kB

Release files / semv-2.5.0.tar.gz

Download URL semv-2.5.0.tar.gz
Size 31.0 kB
Tags Source
SHA-256 checksum
How to use checksums
c4ca6fe42eeaba1be6aa70f395ea6135bd2f85a76f600f8d8f71da3ee09806ad
BLAKE2b-256 checksum
How to use checksums
f334ce618132593148d872fcfd402bf23a3c63d3e77e7fc68a8f9e61df27b9f0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / semv-2.5.0-py3-none-any.whl

Download URL semv-2.5.0-py3-none-any.whl
Size 17.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f7095b59ff6bcc9cc888a92a5edaa1378b4dfb3293902245bf98939d2afbcb3e
BLAKE2b-256 checksum
How to use checksums
e29515ec55fad5ec6ceedcf1cd2aa9673df063c8a350371d283d90fd32b7a7c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release history Release notifications | RSS feed

This release

2.5.0 This release

2 release files

2.4.0

2 release files

2.3.0

2 release files

2.2.0

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.4.5

2 release files

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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