-
-
Notifications
You must be signed in to change notification settings - Fork 63
Handling deprecation of astropy.tests.plugins.display items #435
Comments
Yes, there has been some refactoring in preparation for astropy 4.0, and the changes hasn't yet been propagated all the way downstream. |
Hmm I didn't consider that the deprecation warnings would end up causing CI failures. We could always remove the deprecation warning for a transition period? |
I think the real issue is that As for deprecations, I think that packages should fix those, that's why we're raising them. |
I updated =============================== warnings summary ===============================
2094/home/travis/miniconda/envs/test/lib/python3.6/site-packages/_pytest/config/__init__.py:830
2095 /home/travis/miniconda/envs/test/lib/python3.6/site-packages/_pytest/config/__init__.py:830: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: pytest_astropy_header
2096 self._mark_plugins_for_rewrite(hook)
WARNING: AstropyDeprecationWarning: The astropy.tests.plugins.display plugin has been deprecated. See the pytest-astropy-header documentation for information on migrating to using pytest-astropy-header to customize the pytest header. [astropy.tests.plugins.display] while running travis ASTROPY_VERSION=development EVENT_TYPE='pull_request push cron' |
@tcassanelli , are you doing a |
@pllim I'm still trying to debug the problem, so far I tried several combinations in the Installing the dependency astropy with conda was unsuccessful, using pip instead.
1854ERROR: Invalid requirement: 'astropystable.*' I'm using the I have also tried adding |
it doesn't I tried it. First I get an issue with |
I tracked the deprecation warning down to a leftover reference to the plugin in astropy core, which I've fixed in astropy/astropy#9539 - with that and using the recommended
Everything works fine for me. @tcassanelli - I'll let you know once the astropy PR is merged and if it still doesn't work for you after that, can you push your changes to a branch and send me a link so I can take a look? |
@tcassanelli , astropy/astropy#9539 is merged. FYI. Your CI should now pick up development version of Astropy with that patch. |
Thanks @astrofrog, @pllim , now I am having another error in the developer version. Everything else builds fine in travis CI. This is the error: /home/travis/miniconda/envs/test/lib/python3.6/site-packages/astropy/units/quantity.py:1774: UnitsError This is related to env: ASTROPY_VERSION=development
EVENT_TYPE='pull_request push cron' |
@tcassanelli , that failure is out of scope as far as the template (this repo) is concerned. If you have astropy dev installed locally, you can see if you can reproduce it. If so, please open an issue at https://github.com/astropy/astropy/issues with a minimal snippet to reproduce the failure. Thanks! |
Fixed in #438 |
In the course of using the package template, we found some tests against the development version of astropy failing due to deprecation of items in
astropy.tests.plugins.display
. In particular, inconftest.py
there is:The import is successful in astropy 3.2.3 but fails in the development version.
The fix is to instead import these items from
pytest_astropy_header.display
. Does this mean that the packagepytest_astropy_header
should be required for the package template? How do we handle the tests against earlier versions of astropy?For reference, #this PR from our new package has the solution that we implemented for the time being, which is to catch an
ImportError
from the import frompytest_astropy_header
and then import fromastropy.tests.plugins.display
in the except clause.The text was updated successfully, but these errors were encountered: