Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: enabling doctestplus #23812

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft

DRAFT: enabling doctestplus #23812

wants to merge 16 commits into from

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented May 25, 2023

This is a WIP, and I'm opening a PR only to enable @seberg to push to this branch directly.

@seberg
Copy link
Member

seberg commented Jun 19, 2023

@bsipocz I pushed a small fix for a merge conflict. But, could you remind me of the correct incantation (currently?), I already added:

 norecursedirs =
+    # Skip potential temporary environments:
+    build
+    benchmarks/env

to the pytest.ini (both can contain a conftest.py which fixed the below issue for it), but I keep getting import errors like:

_pytest.pathlib.ImportPathMismatchError: ('random', '/opt/homebrew/Caskroom/mambaforge/base/lib/python3.10/random.py', PosixPath('/Users/sebastianb/forks/numpy/numpy/typing/tests/data/pass/random.py'))

so I think I am probably just approaching running pytest wrong.

EDIT: I think the problem was only that I didn't add --continue-on-collection-errors

@seberg
Copy link
Member

seberg commented Jun 19, 2023

There are now quite a few plots popping up again and failures due to deprecations. Maybe we should just ignore deprecation warnings in the docs. Or if we don't want to do that, just remove the examples for clearly deprecated functionality?

@mattip
Copy link
Member

mattip commented Jun 19, 2023

remove the examples for clearly deprecated functionality

+1

@mattip
Copy link
Member

mattip commented Jun 19, 2023

Would a rebase help clear some of the collection issues?

# NumPy should probably use more `.. plot::` directives even in
# examples, but as long as we don't, do not block on `plt.show()`
import matplotlib
matplotlib.use("Agg")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsipocz where could this go and is this OK? This fixes the plt.show() not popping up things. There are some that can just be plot directives, but the histogram re-uses the data and has comments, etc. so I thought this is the easier path.

Maybe we need distinct runs, also so that we can make sure that warnings are not raised as errors?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this should be the fix for the mpl pop ups.

As for warnings, I think they really should be raised as errors, unless they are handled properly. For doctestplus we can use either +IGNORE_WARNINGS or +SHOW_WARNINGS

@seberg
Copy link
Member

seberg commented Jun 20, 2023

I think the collection issues are maybe all expected, i.e. trying to find doctests in places we shouldn't look or just something to do with how I ran it.

@bsipocz
Copy link
Member Author

bsipocz commented Jun 21, 2023

Thanks Sebastian for the commits! I'm sorry for being too slow with this, I'm trying to come back to it in a more timely manner.

@rgommers
Copy link
Member

rgommers commented Sep 6, 2023

I'll note that the tool we currently use is tools/refguide_check.py. It is run in CircleCI only. It can also be run via runtests.py and should still be plugged into spin test.

If you want to iterate on CI, perhaps easiest to use that same job (or port it to a single GHA job).

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.

None yet

4 participants