AutoSemVer

raw JSON →
1.0.0 verified Fri May 01 auth: no python

Tools to handle automatic semantic versioning in Python. Current version 1.0.0. Release cadence is low; no recent updates.

pip install autosemver
error AttributeError: module 'autosemver' has no attribute 'AutoSemVer'
cause Importing incorrectly, e.g., 'import autosemver' alone and then calling autosemver.AutoSemVer
fix
Use 'from autosemver import AutoSemVer' directly.
error UserWarning: Not a git repository or no tags found
cause Running autosemver in a directory that is not a Git repository or has no tags.
fix
Ensure you are in a Git repository with initialized tags (e.g., 'git init && git tag v0.1.0').
gotcha AutoSemVer relies on Git tags for versioning; if no tags are present, it may fail or return an initial version.
fix Ensure your repository has at least one git tag (e.g., v0.1.0) before using autosemver.
gotcha bump_version modifies the working tree by creating a new commit and tag, which may be unintended in CI or read-only environments.
fix Use bump_version only when you intend to create a release; consider using dry-run or manual versioning in CI.

Basic usage: initialize AutoSemVer and bump patch version.

from autosemver import AutoSemVer

# Create an AutoSemVer instance
autoversion = AutoSemVer()

# Get the current version from git
version = autoversion.current_version()
print(f"Current version: {version}")

# Bump the version
new_version = autoversion.bump_version('patch')
print(f"New version: {new_version}")