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.
pip install vcverVerified import paths — ran on the pinned version, not inferred.
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.
Ensure `git` or `hg` executables are installed and available in the system's PATH, and that your project directory is a valid VCS repository.
For production releases, use `vcver.set_version('X.Y.Z')` as part of your build process to hardcode the version, or ensure your build system retains the `.git` or `.hg` directory.Install the package using pip: `pip install vcver`
Install Git on your system and ensure it's added to your system's PATH. For Linux/macOS, use `sudo apt-get install git` or `brew install git`; for Windows, download from git-scm.com.
Ensure the Git repository is valid, not a shallow clone if full history is required by 'vcver', and the Git environment is correctly set up. Use `git fetch --unshallow` if applicable.
Ensure the call to `vcver.get_version()` is executed within the root of your Git or Mercurial repository. In CI/CD, ensure a full clone is performed rather than a shallow one, or configure `vcver` with `raise_if_no_vcs=False` to return `None` gracefully.
No dependency data recorded yet.