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

PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall() #238

Closed
GergelyKalmar opened this issue Dec 22, 2023 · 6 comments · Fixed by #237
Closed

Comments

@GergelyKalmar
Copy link

I'm seeing the following warning when using the current version of jupyter-sphinx with Sphinx 7.1.2:

.../site-packages/sphinx/application.py:351: in build
    self.builder.build_update()
.../site-packages/sphinx/builders/__init__.py:290: in build_update
    self.build(to_build,
.../site-packages/sphinx/builders/__init__.py:310: in build
    updated_docnames = set(self.read())
.../site-packages/sphinx/builders/__init__.py:417: in read
    self._read_serial(docnames)
.../site-packages/sphinx/builders/__init__.py:438: in _read_serial
    self.read_doc(docname)
.../site-packages/sphinx/builders/__init__.py:494: in read_doc
    publisher.publish()
.../site-packages/docutils/core.py:236: in publish
    self.apply_transforms()
.../site-packages/docutils/core.py:216: in apply_transforms
    self.document.transformer.apply_transforms()
.../site-packages/sphinx/transforms/__init__.py:80: in apply_transforms
    super().apply_transforms()
.../site-packages/docutils/transforms/__init__.py:182: in apply_transforms
    transform.apply(**kwargs)
.../site-packages/jupyter_sphinx/ast.py:628: in apply
    for cell_node in self.document.traverse(JupyterCellNode):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <document: <section "development"...>>, condition = <class 'jupyter_sphinx.ast.JupyterCellNode'>, include_self = True, descend = True, siblings = False, ascend = False

    def traverse(self, condition=None, include_self=True, descend=True,
                 siblings=False, ascend=False):
        """Return list of nodes following `self`.

        For looping, Node.findall() is faster and more memory efficient.
        """
        # traverse() may be eventually removed:
>       warnings.warn('nodes.Node.traverse() is obsoleted by Node.findall().',
                      PendingDeprecationWarning, stacklevel=2)
E       PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall().

.../site-packages/docutils/nodes.py:225: PendingDeprecationWarning

It seems to be coming from https://github.com/jupyter/jupyter-sphinx/blob/main/jupyter_sphinx/ast.py#L628.

@akhmerov
Copy link
Member

This will be closed by #237

@12rambau 12rambau linked a pull request Dec 23, 2023 that will close this issue
@GergelyKalmar
Copy link
Author

Awesome, thank you! Could we potentially get a new release? It's been a while since the last one :).

Happy holidays, too!

@12rambau
Copy link
Contributor

The repository was recently revived and updated to the current Jupyter standards. Let me try to do a 0.5.0 release today using the new workflow.

@12rambau
Copy link
Contributor

@GergelyKalmar I was forced to make small adjustments but I think it now works, could you try v0.5.3 and let me know if it works as expected from your side ?

@GergelyKalmar
Copy link
Author

It seems to have worked, thank you! However, the License field now contains the text of the license for the package, which is a little suboptimal. I'm using pip-licenses for license checks and it used to show the correct license before.

@12rambau
Copy link
Contributor

let me deal with that in another issue

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 a pull request may close this issue.

3 participants