Versioning It

3.3.0 · active · verified Sat Apr 11

Versioningit is a Python packaging plugin that automatically determines your package's version based on tags in your version control repository (Git and Mercurial supported). It offers extensive customization for version formatting and allows overriding internal functions for version extraction and calculation. It integrates with both setuptools and Hatch. The current version is 3.3.0, and it has a regular release cadence with several updates throughout the year.

Warnings

Install

Imports

Quickstart

Configure `versioningit` in your `pyproject.toml` file by adding a `[tool.versioningit]` table. Ensure `project.version = "dynamic"` and `project.dynamic = ["version"]` are set in your `[project]` table. For runtime access to the version, use `importlib.metadata.version()`.

# pyproject.toml
[project]
name = "my_package"
version = "dynamic"

[tool.versioningit]
# Minimal configuration (uses defaults: Git, basic tag2version, basic format)

# To retrieve the version at runtime (e.g., in my_package/__init__.py):
# from importlib.metadata import version
# __version__ = version("my_package")

view raw JSON →