Skip to main content

A Poetry plugin that observes the current git commit to build a date-based version number

Project description

poetry-commit-date-versioning

Date-based versioning for Poetry projects. Reads the commit date and sha from git and uses it to set the project version. Nothing else. No attempt is made to work with anything other than git.

To use:

  1. poetry self add poetry-commit-date-versioning
  2. In pyproject.toml add a stanza to enable the plugin for a given project
[tool.poetry-commit-date-versioning]
enable = true

As the version number is not written into source code files anywhere, we suggest using importlib to determine your module's version number.

from importlib import metadata

__version__ = metadata.version(__name__)

This project was created as an alternative to

  • poetry dynamic versioning because it rewrites the pyproject.toml file with every invocation (even if nothing has changed) and is thus incompatible with a development process that uses pyproject.toml file in Makefile dependencies.
  • poetry date versioning plugin which may be abandoned and incomplete and which is definitely centered around writing version numbers into python source files.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

poetry_commit_date_versioning-0.2.0.tar.gz (2.5 kB view hashes)

Uploaded Source

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page