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
merged 1 commit into from Sep 5, 2016
Merged

Conversation

@vallsv
Copy link
Contributor

@vallsv vallsv commented Sep 5, 2016

Feeback by @rgommers (https://github.com/pypa/setuptools/pull/739/files/8d1eecaef52a1baf2b9fc6c772880d8c537b562f#r77445452), 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
@jaraco jaraco merged commit 60abc4e into pypa:master Sep 5, 2016
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rgommers
Copy link

@rgommers rgommers commented Sep 5, 2016

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

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

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.

@vallsv
Copy link
Contributor Author

@vallsv 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
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants