bad versions numbers since 2022.0^L1.0
onkelbeh opened this issue · 3 comments
Hello Aaron,
Since 2022.1.0 you (and some other guys) are using bad version numbers padded with zeros, e.g at Github, you are using the 2nd digit padded with a zero, perhaps this should look better in sorted lists, as you want to treat this as a month in a version number looking like a date.
This is causing some trouble, because a lot of package managers (like portage at Gentoo, or Pypi) are treating the version number segments as integers, this is a hard rule in semver-2.0.
We are using a set of automated build scripts, which now is in trouble. Ok, currently, I patched it, it now rewrites the wrong formatted version number, but I would like to adress the problem at it's source (->you) :-)
According to semver-2.0:
"A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version. Each element MUST increase numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0."
Please avoid using leading zeroes in version numbers.
Thank you for your various posts.
You mention SemVer, but my libraries use CalVer. According to their standard, any of the components can be zero-padded (emphasis mine):
As seen in the case studies below, projects have found more than one useful way to leverage dates in their versions. Rather than choose a single scheme, CalVer introduces standard terminology for developers, in addition to the "semantic" versions:
- YYYY - Full year - 2006, 2016, 2106
- YY - Short year - 6, 16, 106
- 0Y - Zero-padded year - 06, 16, 106
- MM - Short month - 1, 2 ... 11, 12
- 0M - Zero-padded month - 01, 02 ... 11, 12
- WW - Short week (since start of year) - 1, 2, 33, 52
- 0W - Zero-padded week - 01, 02, 33, 52
- DD - Short day - 1, 2 ... 30, 31
- 0D - Zero-padded day - 01, 02 ... 30, 31
I've published versions under this scheme to PyPI for quite some time and I've never run into any issue installing elsewhere.
Seems that Pypi fixes this automatically:
Had problems by reading Home Assistant's constraints, packages names and versions are treated as strings in Gentoo (and some other distributions as well), resulting in the package manager trying to download packages which don't exist, adjusted it now by re-writing the padded version numbers with sed -E 's/\.0([0-9])\./.\1./'
.
If you want to keep your leading zeroes, just close the ticket, our script won't mind them anymore.
Sorry for the 2 other issues, did not recognize all leading zero's originated by the same author at first.