Skip to main content

Hatch plugin for CalVer versioning

Project description

hatch-calver

A plugin for hatch to support calendar versioning.

Setup

Add hatch-calver as a build dependency to your project.

[build-system]
requires = [
    "hatchling",
    "hatch-calver",
]
build-backend = "hatchling.build"

Then, set tool.hatch.version.scheme to "calver".

[tool.hatch.version]
scheme = "calver"

Configuring the CalVer scheme

You can optionally set calver-scheme to a dot-separated string of parts specified in the calver scheme specification. It defaults to YYYY.MM.DD.

[tool.hatch.version]
scheme = "calver"
calver-scheme = "YY.MM"

Note that your project's versions should conform to the scheme you specify; otherwise, determining where to put e.g. patch versions will be quite ambiguous.

Usage

You can use Hatch's standard versioning commands.

To update your project's version to the current date, run hatch version release (or hatch version date).

As with the regular versioning scheme, you can chain multiple segment updates. The date part of the version will not be updated unless you explicitly specify it.

The CalVer scheme specified for your project specifies which segment of the PEP 440 "release" segments are automatically determined; for instance, for a YYYY.MM.DD scheme, the 4th field of the release segment will be considered the patch field.

In other words, if you specify YYYY.MM.DD as your scheme, and it's the 16th of September 2024:

Original version Command New version
2024.07.22 hatch version release 2024.09.16
2024.07.22 hatch version date,a 2024.09.16a0
2021.01.01 hatch version rc 2021.01.01rc0
2024.7.22 hatch version patch 2024.07.22.1

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

hatch_calver-2024.9.16rc0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

hatch_calver-2024.9.16rc0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file hatch_calver-2024.9.16rc0.tar.gz.

File metadata

  • Download URL: hatch_calver-2024.9.16rc0.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for hatch_calver-2024.9.16rc0.tar.gz
Algorithm Hash digest
SHA256 053b703ec5157648b9b36833991c1f0d1443c14aca233ea652ec9fb011a7fde3
MD5 9302bba73c64551c6ade4e13586ad89c
BLAKE2b-256 ec2b3f240813fbdfaaa78dd23573410afa19569317c4acfb4ee6b059bf14893a

See more details on using hashes here.

File details

Details for the file hatch_calver-2024.9.16rc0-py3-none-any.whl.

File metadata

File hashes

Hashes for hatch_calver-2024.9.16rc0-py3-none-any.whl
Algorithm Hash digest
SHA256 c0334c8052e630a50d3b528d7495916878bd9e40ba0aca2a0f390926c901adc8
MD5 52591d6ee5b708d4966370594721c174
BLAKE2b-256 dd2d114ac80bb6edf8b3c412e999f430473ca8fedc56261ebd343a05dc2ea4d3

See more details on using hashes here.

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