Repository navigation
Simplify, standardize, and reduce repetition of version checks - #3389
Conversation
|
Looks like my docstrings need fixing, and that I might have broken something on Numpy 1.7 (probably changed some conditional to the wrong thing--I'll go through and double check again. |
f9e9031 to
a43cead
Compare
|
Should be fixed up now. |
|
That's odd. 0a5b2f0 should have fixed the tests that were failing. I confirmed this locally. |
There was a problem hiding this comment.
Think this would be NUMPY_LT_1_7, no?
There was a problem hiding this comment.
Yeah that could work here.
|
Nice! Will make it all the easier to remove cruft once older numpy versions are no longer supported. I made in-line comments in two places were I think the pre-defined variables should do. |
|
BTW, happy with this, so can be merged as far as I'm concerned. But maybe @astrofrog wants to have a quick look? |
0ed5905 to
7a337ed
Compare
|
appveyor fell over for no reason |
|
|
|
Since this fixes #3471, I might go ahead and merge it for 1.0? Or is it too late? I just need to rebase. |
…only used by minversion (and in fact for a feature that we don't really need right now. But it may be useful in other places.
…d-written comparisons. Also use save some common Numpy version tests off in the numpycompat module and use those in code rather than redefining them repeatedly.
…be used. I didn't really care here since it was in a test but might as well.
…lass just replace it with a subclass that is.
7a337ed to
e21832e
Compare
|
@astrofrog - what do you think about this re: 1.0? It does make sense to be more consistent on this, but it touches a lot of files... If the test pass I think I'm fine with it, though. Should there be a changelog entry, or did you think this shouldn't be "public", @embray? |
|
Alright, we concluded it should go in for v1.0. Tests passing, so I'm going to go ahead and merge. If you think this should have a changelog entry, @embray, feel free to add it in master (and backport to v1.0.x) |
Simplify, standardize, and reduce repetition of version checks
Simplify, standardize, and reduce repetition of version checks
|
backported to v1.0.x in 1350b96 |
|
Oh, yeah. And I did want this to have a changelog entry before merging it. I think the minversion utility is useful for affiliated packages to know about as well. |
This adds a new utility
minversionthat can be used to check Python module version dependencies. I also went through and used this where appropriate, but I also cut down on the number of Numpy version checks by putting several of them in thenumpycompatmodule and just importing Numpy version checks from there where needed (in many cases).I should also add, though it is unlikely to matter 99.99% of the time,
minversiondefaults to usingpkg_resources.parse_versionwhich, as of setuptools 8.0 uses PEP-440-compliant version comparison by default. If for whatever reason that's unavailable we fall back ondistutils.verison.LooseVersionwhich is still good enough for most cases.