Repository navigation
Add new pytest plugins as extern packages to v2.0.x series - #6918
Conversation
|
Hi there @drdavella 👋 - thanks for the pull request! I'm just a friendly 🤖 that checks for issues related to the changelog and making sure that this pull request is milestoned and labeled correctly. This is mainly intended for the maintainers, so if you are not a maintainer you can ignore this, and a maintainer will let you know if any action is required on your part 😃. Everything looks good from my point of view! 👍 If there are any issues with this message, please report them here. |
| env: SETUP_CMD='test --coverage --remote-data=astropy -a "--mpl"' | ||
| CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES | ||
| PIP_DEPENDENCIES='cpp-coveralls objgraph jplephem pytest-mpl bintrees' | ||
| PIP_DEPENDENCIES='cpp-coveralls objgraph jplephem pytest-astropy pytest-mpl bintrees' |
There was a problem hiding this comment.
Oops, the pytest-mpl dependency actually isn't in a released version of pytest-astropy yet.
bsipocz
left a comment
There was a problem hiding this comment.
I find this approach much more clean and probably better maintainable.
| - Fixed a bug that meant that the data.astropy.org mirror could not be used when | ||
| using --remote-data=astropy. [#6724] | ||
|
|
||
| - Support compatibility with new ``pytest-astropy`` plugins. [#6918] |
There was a problem hiding this comment.
please add the version number of pytest-astropy that's being bundled in here
There was a problem hiding this comment.
The external plugins are actually straight from the master branches of the repositories right now. Can I update and provide this with the next release of pytest-astropy?
There was a problem hiding this comment.
yes, that sounds good. That case it can go to the bottom under "Other Changes"
There was a problem hiding this comment.
I agree with @bsipocz here - we should tie this to a specific pytest-astropy release so affiliated package devs can be sure how to map this onto the "stand-alone" version.
|
CircleCI build looks like it choked. Can someone restart? |
|
Ideally we would do this with submodules since it would make it easier to keep up-to-date. However, that means more infrastructure to support, which is maybe not worth it. |
|
I don't think it's particularly worth doing submodules here, we just make sure to update to the latest pytest-astropy before doing a release. |
|
Current test failures on Py27 appear to be unrelated. Test failures against |
31f3636 to
136b997
Compare
|
@mhvk any ideas about how to account for the behavior of |
| - os: linux | ||
| env: PYTHON_VERSION=2.7 SETUP_CMD='test --remote-data=astropy -a "--mpl"' | ||
| CONDA_DEPENDENCIES=$CONDA_ALL_DEPENDENCIES | ||
| CONDA_DEPENDENCIES="`echo $CONDA_ALL_DEPENDENCIES mkl=11.3.3`" |
There was a problem hiding this comment.
Maybe you already tried this but I think it should be possible to just do:
CONDA_DEPENDENCIES="$CONDA_ALL_DEPENDENCIES mkl=11.3.3"
There was a problem hiding this comment.
I think I tried it (I've tried a few variants), and it picked up mkl as a separate env variable
|
I can confirm this fixes the affiliated package |
eteq
left a comment
There was a problem hiding this comment.
Overall this looks good. I tested both <package>.test() and python setup.py test for this version with several affiliated packages and it seems to run without a hitch.
Just one new comment here to add a note in the changelog. But I think this should wait on merge until there's a specific version of pytest-astropy that it can be tied to? I think that means just tagging releases on pytest-astropy and any relevant contained packages and then updating the changelog, though, right @drdavella ?
| - Fixed a bug that meant that the data.astropy.org mirror could not be used when | ||
| using --remote-data=astropy. [#6724] | ||
|
|
||
| - Support compatibility with new ``pytest-astropy`` plugins. [#6918] |
There was a problem hiding this comment.
I agree with @bsipocz here - we should tie this to a specific pytest-astropy release so affiliated package devs can be sure how to map this onto the "stand-alone" version.
|
|
||
| def pytest_addoption(parser): | ||
|
|
||
| parser.addoption('--repeat', action='store', |
There was a problem hiding this comment.
This is technically a "new feature" in the 2.0.x series, right? I think that should be mentioned in the changelog. I think it's justifiable in a 2.0.x release given that it's really tied to the testing architecture, but it should be mentioned rather than silently appearing.
There was a problem hiding this comment.
This is actually available in v2.0.2, so I don't think any action is required:
astropy/astropy/tests/pytest_plugins.py
Lines 112 to 113 in 93f7e75
|
To pass on the results of some Slack discussion here: if possible we'll wait for the new |
| # plugin since we need to support older versions of numpy that | ||
| # do not provide the 'equal_nan' argument, which was added in | ||
| # numpy-1.10. | ||
| if np.isnan(ngf) and np.isnan(nwf): |
There was a problem hiding this comment.
This looks OK, except just to be sure: since this is for astropy itself, we can just import NUMPY_LT_1_10 from astropy.utils.compat somewhere above and do if NUMPY_LT_1_10 and np.isnan(ngf) and np.isnan(nwf):
-- that way we don't slow down the rest and also have an easier time removing this if it is no longer necessary.
|
I'm not sure what's up with the current test failures on travis. |
|
I might have an idea. Experimental PR forthcoming... ??? |
|
FWIW, I'm now happy with this once the tests are passing. (:crossed_fingers: that @pllim is fixing it...) |
|
Ahaha... Ops. I now see the that failures here are different. I was thinking of #6942. I'll have a look here too, I guess. |
|
Numpy is too old (1.9). |
|
There is still this failure but it is not obvious to me what the fix should be -- In > assert np.all((obj2 == obj1) == [True, False])
E AssertionError |
|
Thanks @drdavella! The failures are supposed to be worked around already in 2.0.x, so I took the liberty to merge this now. |
| from ....utils.compat import NUMPY_LT_1_10 | ||
|
|
||
|
|
||
| _ALLCLOSE_KWARGS = {} |
There was a problem hiding this comment.
actually we shouldn't do this and any of the numpy compatibility here. anything in externs should be verbatim of an external package release (maybe with the exception of the six imports).
There was a problem hiding this comment.
It's a little awkward in this case because I'm not sure we want to have to support numpy<1.10 in the plugin itself, but this was necessary in order to get the backport to work. You make a very good point, though. I'm not sure what the right solution is.
There was a problem hiding this comment.
well, I'm not sure we will be able to drop that support for the LTS, so that case two version need to be maintained
There was a problem hiding this comment.
Okay, I guess we might as well add this to the plugin itself then.
This is an alternative approach to #6833 for providing compatibility with
pytest-astropyfor thev2.0.xseries. It adds the new pytest plugins as extern packages. I believe this is a cleaner approach and it appears to work better 🤞.Thanks to @eteq for the idea.