Closed amotl closed 1 year ago
Wouldn't a tuple(map(int, version.split('.')))
be good enough for our purposes? CrateDB versions follow x.y.z and don't have any other components. A tuple with 3 integers has the correct comparison semantics
CrateDB versions follow x.y.z and don't have any other components.
I think the version comparison is also used for comparing versions of Python packages, specifically SQLAlchemy. I recently already struggled very hard, because the older distutils
parser did not manage to do all the x.x.xa
/ x.x.xb
/ x.x.xrc
pre-release variants correctly, while I needed it to work with corresponding pre-release packages of SQLAlchemy.
About
The
distutils
package will become deprecated, see PEP 632 – Deprecate distutils module.Solution
The accepted solution is to vendor
packaging.version
, like how NumPy, pandas and SciPy are doing it equally.References