Giter VIP home page Giter VIP logo

poetry-commit-date-versioning's Introduction

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

You can optionally indicate whether the plugin should generate zero-padded version segments or pep440 canonicalized segments. With padding, version number segments are left-padded with zeros to extend to the maximum possible width of the field. For example a version number including the month of January 1980 would be padded to start with 1980.01. With canonicalization that same version number would be 1980.1. By default, pep440 canonicaization is used but padding can be enabled with the version-style configuration field. This field accepts one of two values: "pep440-canonicalized" or "zero-padded"

[tool.poetry-commit-date-versioning]
enable = true
version-style = "zero-padded"

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.

poetry-commit-date-versioning's People

Contributors

mmcshane avatar

Stargazers

Alan Fregtman avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.