-
-
Notifications
You must be signed in to change notification settings - Fork 167
Use node.findall if available (docutils 18.x) #403
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
Conversation
You can fix the linter warnings via:
Or do
and it will automatically run when you try to commit. |
We will want to make sure we still support |
pre-commit is failing, looks like it mistakes python 3.10 for python 3.1 (!!) here's the log version information
error information
EDIT fixed by manually typing the zero into |
my change to |
Co-authored-by: Jarrod Millman <[email protected]>
numpydoc/numpydoc.py
Outdated
"""Triage node.traverse (docutils <0.18) vs node.findall. | ||
|
||
TODO: This check can be removed when the minimum supported docutils version | ||
for numpydoc is docutils>=0.18 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be clear, the findall
method was only added in docutils 0.18, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I double-checked, and in fact it wasn't introduced until 0.18.1:
Release 0.18.1
==============
* docutils/nodes.py
- `Node.traverse()` returns a list again to restore backwards
compatibility. Fixes bug #431.
- New method `Node.findall()`: like `Node.traverse()` but returns an
iterator. Obsoletes `Node.traverse()`.
(from https://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/HISTORY.txt)
I'll push a commit to be more specific about the version.
Just a note that although the CIs were coming back green before the last commit, I don't think they're actually testing against sphinx 5.0beta / docutils 0.18 ? Locally I still see this:
and I'm not sure how to fix it... that |
Never mind, I'm wrong, I just spotted the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes LGTM, +1 for merge. Feel free to merge if you're happy @jarrodmillman !
I can also confirm that on docutils 0.18.1 I have failures building MNE-Python's doc, and with this PR things build fine.
See #404. That should fix the test failures. |
Ok great! Can you manually re-trigger the failing runs? I can't just push an empty commit; as a first time contrib here, the CIs will wait for maintainer approval anyway. |
Since it's a change to the CI yaml you'll need to merge or rebase I think |
Ah right, of course. Will do when I'm not on a phone |
All green! |
Thanks!! |
closes #399