vcver - Dynamic Versioning from VCS

0.2.12 · active · verified Tue Apr 14

vcver is a Python library that automates the generation of package version strings by extracting information directly from version control systems such as Git or Mercurial. This enables dynamic versioning based on commit hashes, tags, and branch names, particularly useful for development builds. It seamlessly integrates with `setuptools` and is actively maintained with releases occurring roughly annually. The current version is 0.2.12.

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate vcver into a `setup.py` for dynamic versioning using `setuptools.setup()`, and how to retrieve the version string directly within Python code.

import vcver

# Example usage in setup.py for setuptools:
# from setuptools import setup
# setup(
#     name='your_package',
#     version=vcver.get_version(),
#     # ... other setup arguments
# )

# Or to get the version directly:
current_version = vcver.get_version()
print(f"Current package version: {current_version}")

view raw JSON →