Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use LooseVersion instread of StrictVersion #774

merged 1 commit into from Sep 5, 2016


Copy link

@vallsv vallsv commented Sep 5, 2016

Feeback by @rgommers (, numpy version can look like "1.11.1rc1+fa248ad" in dev branches.

StrictVersion fail to parse this kind of string. One solution is to use LooseVersion.

In [6]: distutils.version.LooseVersion("1.11.1rc1+fa248ad") < distutils.version.LooseVersion('1.11.2')
Out[6]: True

In [7]: distutils.version.LooseVersion("1.11.3rc1+fa248ad") < distutils.version.LooseVersion('1.11.2')
Out[7]: False

Copy link

rgommers commented Sep 5, 2016

You guys are too fast for me:) Still not right unfortunately:

>>> LooseVersion('1.2.3') > LooseVersion('1.2.3a1')

This stuff in distutils really is not usable. There's something better for pretty much everything you want to do.

pkg_resources.extern.packaging.version.LegacyVersion looks right. Recent numpy versions comply with PEP 440, but older ones do not for dev versions.

Copy link
Contributor Author

vallsv commented Sep 6, 2016

Hi, after a long fighting with my env i am finally able to use pkg_reosurces.extern.
Here is a patch #775

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants