[Python-ideas] Add `rc` to distutils.version.StrictVersion
Pål Grønås Drange
paal.drange at gmail.com
Thu Jul 5 14:11:21 EDT 2018
StrictVersion from distutils accepts version tags like
1.14.0
1.14.0a1
1.14.0b2
but not
1.14.0rc1 (nor 1.14.0c1).
My suggestion: Add `rc` in the regexp and make it a `prerelease` (the
latter comes for free by the current implementation).
Most package maintainers have adopted the `rc` abbreviation for release
candidate versioning, e.g.
- numpy 1.14.0rc1
- scipy 1.1.0rc1
- plotly 3.0.0rc1
- pandas 0.23.0rc1
- matplotlib 2.2.0rc1
- dask 0.13.0rc1
- django 1.9rc1.
All of these are available on PyPI.
A natural way of sorting version numbers from pip is by simply using
sorted(versions, key=distutils.version.StrictVersion),
however, due to StrictVersion only accepting `a` and `b` as
abbreviations, this does not work for the aforemention packages.
The very obvious cons are:
- touching 20 years old code [1]
- StrictVersion is preserved "for anal retentives and software
idealists", and I don't know if they agree.
There might be more cons I fail to think of at this moment.
[1]
https://github.com/python/cpython/blob/master/Lib/distutils/version.py#L130
Pål Grønås Drange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20180705/8af1c1b2/attachment.html>
More information about the Python-ideas
mailing list