,

Simplify Versioning and Tagging with Dunamai

Blake Bradford Avatar

·

Simplify Versioning and Tagging with Dunamai

Keeping track of versions and creating tags in your software development projects can be a tedious and error-prone process. However, with the help of Dunamai, a Python library and command line tool, you can simplify versioning and tagging in your projects.

Dunamai allows you to produce dynamic, standards-compliant version strings based on the tags in your version control system. This facilitates unique identification of nightly or per-commit builds in continuous integration and makes releasing new versions of your software as simple as creating a tag.

Key Features:

  • Version control system support: Dunamai supports popular version control systems like Git, Mercurial, Darcs, Subversion, Bazaar, Fossil, and Pijul. It can extract version information from these systems to generate version strings.
  • Various version styles: Dunamai supports version styles like PEP 440, Semantic Versioning, and Haskell Package Versioning Policy, along with custom output formats. This flexibility allows you to choose the versioning style that best suits your project.
  • Language-agnostic: Dunamai can be used for projects written in any programming language, making it a versatile tool for versioning in different development environments.
  • Easy installation: Dunamai can be installed quickly using the pip package manager, simplifying the setup process.

Usage:

Dunamai can be used both as a command line tool and as a library in your Python projects.

Command Line:

The Dunamai command line tool provides various options for generating version strings. Here’s an example of the CLI usage:

“`console
$ dunamai from any
0.2.0.post7.dev0+g29045e8

$ dunamai from git –no-metadata –style semver
0.2.0-post.7

$ dunamai from any –format “v{base}+{distance}.{commit}”
v0.2.0+7.g29045e8

$ dunamai from any –bump
0.2.1.dev7+g29045e8

$ dunamai from any –format “v{base}” –style pep440
Version ‘v0.2.0’ does not conform to the PEP 440 style

$ dunamai check 0.01.0 –style semver
Version ‘0.01.0’ does not conform to the Semantic Versioning style
“`

Library:

In addition to the command line tool, Dunamai can be used as a library in your Python code. Here’s an example of using Dunamai in your project:

“`python
from dunamai import Version, Style

version = Version.from_git()
assert version.serialize() == “0.1.0”

version = Version.from_any_vcs()
assert version.serialize() == “0.1.0rc5.post44.dev0+g644252b”

Access individual parts of the version

assert version.base == “0.1.0”
assert version.stage == “rc”
assert version.revision == 5
assert version.distance == 44
assert version.commit == “g644252b”
assert version.dirty is True
“`

Integration:

Dunamai can be easily integrated into your projects to provide versioning information. Here are a few examples of integration options:

  • Setting a __version__ statically in your code.
  • Using Dunamai in your setup.py file for your project.
  • Integrating with build tools like Poetry.

Dunamai provides flexibility in how you include the version in your project, allowing you to choose the approach that fits best with your development environment.

Conclusion:

Dunamai is a valuable tool for simplifying versioning and tagging in your software projects. By leveraging Dunamai’s features, you can generate dynamic version strings based on your version control system tags, making it easier to manage and release new versions of your software. Whether you’re a software engineer, solution architect, or project manager, Dunamai can streamline your versioning process and improve your development workflow.

If you’re looking to simplify versioning and tagging in your projects, give Dunamai a try and experience the benefits it offers.

For more information and detailed usage instructions, refer to the Dunamai GitHub repository.

References:


Disclaimer: This is a fictional article created for demonstration purposes only.

Leave a Reply

Your email address will not be published. Required fields are marked *