executablebooks / sphinx-external-toc

A sphinx extension that allows the site-map to be defined in a single YAML file
https://sphinx-external-toc.readthedocs.io
MIT License
34 stars 18 forks source link

ENH: Support for sphinx 5 #85

Closed coretl closed 1 year ago

coretl commented 2 years ago

Sphinx 5 seems to work with sphinx-external-toc in my projects. This PR just enables it in pyproject.toml. The Contributing Guide seems to suggest the latest 2 major releases of sphinx should be supported, so maybe this should be "sphinx>=4,<6" instead?

Fixes #83

welcome[bot] commented 2 years ago

Thanks for submitting your first pull request! You are awesome! :hugs:
If you haven't done so already, check out EBP's Code of Conduct and our Contributing Guide, as this will greatly help the review process.
Welcome to the EBP community! :tada:

mmcky commented 1 year ago

thanks @coretl for this update. Greatly appreciated. Sorry it has taken so long to loop around to it. We are currently in the process of updating a number of executable books projects to sphinx5 so we can release the next version of jupyter book.

mmcky commented 1 year ago

@AakashGfude when running this through tox and enforcing sphinx==5.3.0 there are a number of deprecation warnings we should attend to:

tests/test_sphinx.py: 47 warnings
  /Users/mmcky/work/executablebooks/sphinx-external-toc/sphinx_external_toc/events.py:167: PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall().
    for node in doctree.traverse(toctree_node):

tests/test_sphinx.py: 47 warnings
  /Users/mmcky/work/executablebooks/sphinx-external-toc/sphinx_external_toc/events.py:177: PendingDeprecationWarning: nodes.Node.traverse() is obsoleted by Node.findall().
    doctree.traverse(TableOfContentsNode)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
codecov[bot] commented 1 year ago

Codecov Report

Base: 91.02% // Head: 91.06% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (89c03fa) compared to base (2462700). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #85 +/- ## ========================================== + Coverage 91.02% 91.06% +0.04% ========================================== Files 7 7 Lines 735 739 +4 ========================================== + Hits 669 673 +4 Misses 66 66 ``` | Flag | Coverage Δ | | |---|---|---| | pytests | `91.06% <100.00%> (+0.04%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/executablebooks/sphinx-external-toc/pull/85?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | | |---|---|---| | [sphinx\_external\_toc/\_compat.py](https://codecov.io/gh/executablebooks/sphinx-external-toc/pull/85/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-c3BoaW54X2V4dGVybmFsX3RvYy9fY29tcGF0LnB5) | `88.33% <100.00%> (+0.61%)` | :arrow_up: | | [sphinx\_external\_toc/events.py](https://codecov.io/gh/executablebooks/sphinx-external-toc/pull/85/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-c3BoaW54X2V4dGVybmFsX3RvYy9ldmVudHMucHk=) | `90.47% <100.00%> (+0.05%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

mmcky commented 1 year ago

@chrisjsewell I went through this PR and updated it to resolve the warnings being issued by tox for the docutils issue around traverse and findall. Would you mind reviewing this PR?

welcome[bot] commented 1 year ago

Congrats on your first merged pull request in this project! :tada: congrats
Thank you for contributing, we are very proud of you! :heart: