<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">You should <a href="https://packaging.pypa.io/en/latest/version/" class="">https://packaging.pypa.io/en/latest/version/</a> instead of anything in distutils for handling version numbers.<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Jul 5, 2018, at 2:11 PM, Pål Grønås Drange <<a href="mailto:paal.drange@gmail.com" class="">paal.drange@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">StrictVersion from distutils accepts version tags like<br class="">1.14.0<br class="">1.14.0a1<br class="">1.14.0b2<br class=""><br class="">but not<br class="">1.14.0rc1 (nor 1.14.0c1).<br class=""><br class="">My suggestion:  Add `rc` in the regexp and make it a `prerelease` (the<br class="">latter comes for free by the current implementation).<br class=""><br class="">Most package maintainers have adopted the `rc` abbreviation for release<br class="">candidate versioning, e.g.<br class="">- numpy 1.14.0rc1<br class="">- scipy 1.1.0rc1<br class="">- plotly 3.0.0rc1<br class="">- pandas 0.23.0rc1<br class="">- matplotlib 2.2.0rc1<br class="">- dask 0.13.0rc1<br class="">- django 1.9rc1.<br class="">All of these are available on PyPI.<br class=""><br class="">A natural way of sorting version numbers from pip is by simply using<br class="">    sorted(versions, key=distutils.version.StrictVersion),<br class="">however, due to StrictVersion only accepting `a` and `b` as<br class="">abbreviations, this does not work for the aforemention packages.<br class=""><br class="">The very obvious cons are:<br class="">- touching 20 years old code [1]<br class="">- StrictVersion is preserved "for anal retentives and software<br class="">  idealists", and I don't know if they agree.<br class=""><br class="">There might be more cons I fail to think of at this moment.<br class=""><br class="">[1] <a href="https://github.com/python/cpython/blob/master/Lib/distutils/version.py#L130" class="">https://github.com/python/cpython/blob/master/Lib/distutils/version.py#L130</a><br class=""><br class="">Pål Grønås Drange<br class=""><br class=""><br class=""></div>
_______________________________________________<br class="">Python-ideas mailing list<br class=""><a href="mailto:Python-ideas@python.org" class="">Python-ideas@python.org</a><br class="">https://mail.python.org/mailman/listinfo/python-ideas<br class="">Code of Conduct: http://python.org/psf/codeofconduct/<br class=""></div></blockquote></div><br class=""></body></html>