[Python-ideas] Add `rc` to distutils.version.StrictVersion
donald at stufft.io
Fri Jul 6 16:02:20 EDT 2018
You should https://packaging.pypa.io/en/latest/version/ <https://packaging.pypa.io/en/latest/version/> instead of anything in distutils for handling version numbers.
> On Jul 5, 2018, at 2:11 PM, Pål Grønås Drange <paal.drange at gmail.com> wrote:
> StrictVersion from distutils accepts version tags like
> 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 
> - 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.
>  https://github.com/python/cpython/blob/master/Lib/distutils/version.py#L130 <https://github.com/python/cpython/blob/master/Lib/distutils/version.py#L130>
> Pål Grønås Drange
> Python-ideas mailing list
> Python-ideas at python.org
> Code of Conduct: http://python.org/psf/codeofconduct/
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas