Dunamai is a Python 3.5+ library and command-line tool for producing dynamic, standards-compliant version strings, derived from tags in your version control system (Git, Mercurial, Darcs, Subversion, Bazaar, Fossil, Pijul). It facilitates uniquely identifying nightly or per-commit builds in continuous integration and simplifying releases by creating a tag. It supports various version styles like PEP 440 and Semantic Versioning, or custom formats. Dunamai, currently at version 1.26.1, maintains an active development and release cadence.
pip install dunamaiVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to retrieve and serialize a dynamic version string from any detected VCS. It includes options for fallback versions and strict mode, which are crucial for robust integration in varied environments like CI/CD pipelines. The output can be formatted according to different versioning styles.
Upgrade to `dunamai` v1.23.1 or newer to ensure correct version comparison behavior.
Ensure your CI environment performs a full clone. For GitHub Actions, use `actions/checkout@v3` with `fetch-depth: 0`. For GitLab, set `GIT_DEPTH` to `0`.
Upgrade to `dunamai` v1.23.2 or newer, which includes a fix for this issue. Alternatively, ensure `GIT_TRACE` is not set when running `dunamai`.
Upgrade to `dunamai` v1.26.1 or newer to correctly utilize the `highest_tag` functionality.
Prefer annotated tags (`git tag -a`) over lightweight tags. Avoid tagging the initial empty commit (created with `--allow-empty`).
Upgrade to `dunamai` v1.24.0 or newer to use the `fallback` argument with `from_any_vcs()`.
Upgrade `dunamai` to v1.23.0 or newer to correctly use the `fallback` argument in `Version.from_any_vcs()`.
Ensure you are running Dunamai within a valid Git repository. In CI/CD environments, ensure a full clone (not shallow) is performed, e.g., for GitHub Actions, use `fetch-depth: 0` with `actions/checkout@v3`.
Install Git if it's missing, or add the directory containing the `git` executable (e.g., `C:\Program Files\Git\cmd` and `C:\Program Files\Git\bin` on Windows, or typically `/usr/bin/git` on Linux) to your system's PATH environment variable. Restart your terminal or IDE after modifying PATH.
Adjust your project's tags or Dunamai's configuration (e.g., `--format` or `--pattern`) to produce a version string that matches the expected style. For example, Semantic Versioning does not allow leading zeros in major/minor/patch segments.
In continuous integration (CI) systems, configure the `git clone` command to fetch the full history. For GitHub Actions, set `fetch-depth: 0` in `actions/checkout@v3`. For GitLab CI, set `GIT_DEPTH: 0`.
No dependency data recorded yet.