Repository navigation
Conversation
This only manifests itself during the test collection phase of pytest. More investigation required.
|
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 labelled 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 😃. I noticed the following issue with this pull request:
Would it be possible to fix this? Thanks! |
|
I've added 2.0.2 as anticipatory milestone, however this seems to be a big overhaul, so I'm not sure whether it should indeed go into the bugfix rather the next major. If it goes into the bugfix we definitely need to make sure it doesn't break anything for affiliates. |
|
@bsipocz that's perfectly fine, just let me know if/when you need me to update the change log. |
|
I will try and review this in more detail once I'm back from holidays (in a week or so), but if possible I think it would be nice to have a way to define the plugins to use in setup.cfg instead of setup.py (for affiliated packages we try and make sure as much as possible is defined in setup.cfg so that they can all share the same setup.py file). |
|
Plugin discovery actually requires |
|
Not sure if CircleCI failure is related. I am attaching the log here because CircleCI made me download it anyway (400+ KB) so might as well: Should really test this against an affiliated package (http://www.astropy.org/affiliated/). For example, If this breaks compatibility with affiliated packages, here are my thoughts on how to go forward (FWIW):
|
|
I would suggest to test it against multiple affiliated or otherwise related packages. In addition to photutils, e.g. gammapy and sunpy can be a good testbed as they are already quite complicated ones. Also if we go ahead with this, I would suggest to send out an e-mail to astropy-dev as well as astropy-affiliated-maintainers list to ask maintainers to do some testing before we merge this in. |
|
It sounds like something we shouldn't rush to merge, and definitely agree about emailing astropy-dev (maybe a decision could be taken when the core maintainers meet in september) I do personally like the idea of just releasing separate individual pytest plugin packages as @pllim suggest. |
|
@pllim, I think that sounds like a reasonable approach. Do you think it makes sense in the meantime to submit a separate PR just to reorganize the plugins within astropy without changing the way they are loaded? In my view this just builds on the work that @Cadair did in #6384. I should point out that I believe it will not be possible to have the plugins loaded in both This probably isn't the right place to have this discussion but I want to mention a related train of thought:
Incidentally, I believe the 'quirks' I mentioned were actually real issues that should be addressed in a separate PR. In particular, I think the file @astrofrog, that's a good idea to make use of @astrofrog, @bsipocz, @pllim, I've been looking at testing a lot recently (in case you couldn't tell) and have a lot of related thoughts/questions/issues that I'd like to discuss. Is astropy-dev the right place for these? Should I open an issue here? Should I think about writing an APE? |
either of those would work, though I slightly prefer github or an APE rather than astropy-dev. Will you be around during the coordination meeting (either locally or remotely)? I think this is a topic that would hugely benefit of a discussion slot there. |
|
I think it would make sense to have an in-person or hangouts discussion, and once there is some consensus, an APE could be written to formalize this (since it would be a big change). |
|
Also just a quick note - regardless of what we do with the pytest plugins, the main motivation for |
Yes, it is entirely possible and it is not a deal-breaker as this is a long-known issue anyway, so no one is going to cry over something that never really worked being not working still.
I agree with this completely. It was actually one of the GSoC 2017 projects proposed, but unfortunately not accepted.
Personally, I am not opposed to complete overhaul if it is deemed necessary and someone has the time to do it. I believe a lot of these were written back in Astropy's infancy, when these
In-person discussions during coordination meeting would be very useful indeed. For the rest of the community, APE seems appropriate (although I sometimes dislike how slow things go over there).
If they are actually self-contained bugs that can be fixed without overhauling our |
|
While we're at this topic, though unrelated to this particular PR specifically, I find that some astropy runner (
I am not saying you should fix these as well, but perhaps they support your case for re-implementation of Astropy test runner above. |
|
@astrofrog I'll do some research (unfortunately [edit] [another edit] |
|
I agree that this probably shouldn't be integrated immediately and that we need to have more discussion about it. I hope to be able to attend the coordination meeting but am waiting for funding to be approved. In the meantime, I thought I would share the results of some testing against affiliated packages:
All-in-all, it seems like fairly minor changes could get most packages working with these changes. However, there are some issues that need to be investigated first. In particular, it looks like the @pllim, thanks for the log from CircleCI. It's not obvious to me either whether the failure is related, but I'll try to see if I can reproduce it locally. |
|
Superseded by #6606 |
It should now be possible to run the test suite directly from
pytest. This fixes #6424 and also fixes #5402. In addition, my opinion (fwiw) is that being able to run tests directly frompytestis a satisfactory resolution to #6392 since allpytestfunctionality is available directly from the native interface. You'll notice that astropy-specific options are also available and documented when runningpytest -h.The problem seems to be related to the order in which
pytestdiscovers plugins. Apparently declaring them inastropy/conftest.pywas too late when runningpytestdirectly, so plugins are now declared insetup.py. In addition to updating the way that plugins are declared, I did some further refactoring of plugins into separate modules to isolate functionality as much as possible.This exposed a few latent quirks in the way things are imported by
astropy, which have been resolved here.This change doesn't come without baggage--there are now warnings when running the tests from
setup.py:These warnings are from
pytestitself and I haven't figured out a way to suppress them yet. They don't seem to be actual pythonWarnings so I can't filter them out. I believe they are caused by the fact that our test runner itself is insideastropyitself, so we importastropybefore callingpytest, which is pretty unusual. This doesn't happen when running frompytestdirectly. I feel confident that this issue will be resolved if/when we move the test machinery to a separate package--in fact, I believe this issue provides further motivation for doing just that.