Created
March 13, 2025 15:26
-
-
Save keuv-grvl/182006adce17083e083c356f81c4ea03 to your computer and use it in GitHub Desktop.
Versioning schema somewhere between [SemVer](https://semver.org/) and [CalVer](https://calver.org/)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Versioning schema somewhere between [SemVer](https://semver.org/) and [CalVer](https://calver.org/). | |
Schema: MAJOR.MINOR.PATCH | |
where: | |
- MAJOR is manually incremented when breaking changes are introduced | |
- MINOR is the release year ("25" when we are in 2025) | |
- PATCH is the number of the day of the year (between 1 and 365) | |
Hence : | |
- you are allowed one release a day | |
- you keep track of breaking changes | |
- you can sort your version chronologically | |
""" | |
from datetime import datetime | |
_release_date = datetime(2025, 3, 13).timetuple() | |
_MAJOR = 0 # manually incremented | |
_MINOR = _release_date.tm_year - 2000 # last two digits of the year (eg: 25 <= MINOR) | |
_PATCH = _release_date.tm_yday # number of the day of the year (1 <= PATCH <= 365) | |
__version_info__ = (_MAJOR, _MINOR, _PATCH) | |
__version__ = ".".join(map(str, __version_info__)) # "0.25.72" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment