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.1 |
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 |
Version history
2024.9.17
- Initial release
2024.9.26
- Changed the
date/releasebump instructions to reset any non-date segments. In other words, areleasebump from2024.07.22.1no longer results in2024.09.16.1.
Metadata
Release files for hatch-calver 2024.9.26
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hatch_calver-2024.9.26.tar.gz | 6.3 kB | Without provenance | Details for hatch_calver-2024.9.26.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hatch_calver-2024.9.26-py3-none-any.whl | Python 3 | none | any | Details for hatch_calver-2024.9.26-py3-none-any.whl |
Total release size: 12.5 kB
Release files / hatch_calver-2024.9.26.tar.gz
| Download URL | hatch_calver-2024.9.26.tar.gz |
|---|---|
| Size | 6.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5025e7573b3cb3cb0ded73bdcc15812ddd390c7de2887fc28d0fa0b5a72cd520
|
|
BLAKE2b-256 checksum How to use checksums |
80136072f590f04e26abfecf4eb0c6982a0fdc1e59c911b53aec996cd67ffbb5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Release files / hatch_calver-2024.9.26-py3-none-any.whl
| Download URL | hatch_calver-2024.9.26-py3-none-any.whl |
|---|---|
| Size | 6.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
192f4f140b11ec3e766fb4950258ebd1d6651ff4ef867f521793ceb5dc882556
|
|
BLAKE2b-256 checksum How to use checksums |
287928e5b3a3f0497927e0d5b7667a67f0d036b48097b205969ff003ec83be42
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/5.1.1 CPython/3.12.6
|
Security for hatch-calver 2024.9.26
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.