hatch icon indicating copy to clipboard operation
hatch copied to clipboard

Add built-in support for Calendar Versioning (CalVer)

Open JaeHyuckSa opened this issue 3 weeks ago • 2 comments

Description

Hatch currently supports PEP 440 semantic versioning, but it has no built-in way to generate Calendar Versioning (e.g., 2025.12.07). Right now, users must manually set CalVer strings or create external scripts, which makes hatch version less useful for teams using date-based releases.

Use case/motivation

Many projects prefer CalVer for deployment traceability and operational clarity. If Hatch supported a simple scheme like:

[tool.hatch.version]
scheme = "calendar"
format = "{year}.{month}.{day}"

then users could run:

hatch version

Related issues

None found.

Are you willing to submit a PR?

  • [x] Yes I am willing to submit a PR!

Code of Conduct

JaeHyuckSa avatar Dec 07 '25 06:12 JaeHyuckSa

This is already possible to support using a plugin, https://hatch.pypa.io/latest/plugins/version-scheme/reference/ for documentation on supporting a schema such as CalVer.

cjames23 avatar Dec 11 '25 05:12 cjames23

A quick search revealed there is an existing plugin out there https://github.com/akx/hatch-calver we can certainly add this as a known third party plugin in the documentation.

cjames23 avatar Dec 11 '25 05:12 cjames23