Skip to content

Conversation

@keewis
Copy link
Contributor

@keewis keewis commented Dec 12, 2019

fixes #872

distutils.version.StrictVersion cannot parse numpy development versions like 1.19.0.dev0+578f4e7. LooseVersion is able to parse the version, but it compares

>>> LooseVersion("1.19.0.dev0+578f4e7") < LooseVersion("1.19")
False

Using pkg_resources.extern.packaging.version.parse instead makes this work as expected. Since setup.py requires setuptools, I think it being installed is a reasonable assumption?

@hgrecco
Copy link
Owner

hgrecco commented Dec 12, 2019

See also #872, maybe we can fix both things at the same time.

@keewis
Copy link
Contributor Author

keewis commented Dec 12, 2019

it's now in install_requires. Is that the right place to put it?

@hgrecco
Copy link
Owner

hgrecco commented Dec 12, 2019

it's now in install_requires. Is that the right place to put it?

I think so

@hgrecco
Copy link
Owner

hgrecco commented Dec 12, 2019

bors r+

bors bot added a commit that referenced this pull request Dec 12, 2019
926: use packaging.version.parse instead of StrictVersion for version checking r=hgrecco a=keewis

fixes #872

`distutils.version.StrictVersion` cannot parse numpy development versions like `1.19.0.dev0+578f4e7`. `LooseVersion` is able to parse the version, but it compares
```python
>>> LooseVersion("1.19.0.dev0+578f4e7") < LooseVersion("1.19")
False
```
Using `pkg_resources.extern.packaging.version.parse` instead makes this work as expected. Since `setup.py` requires `setuptools`, I think it being installed is a reasonable assumption?

Co-authored-by: Keewis <[email protected]>
@bors
Copy link
Contributor

bors bot commented Dec 12, 2019

Build succeeded

@bors bors bot merged commit 4b3fc6c into hgrecco:master Dec 12, 2019
@keewis keewis deleted the version-checking branch December 12, 2019 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pint doesn't declare setuptools as a dependency.

2 participants