Skip to content

Update to the latest version of Sphinx to fix build of developer documentation#14011

Merged
seanbudd merged 1 commit into
nvaccess:masterfrom
lukaszgo1:updateSphinx
Aug 15, 2022
Merged

Update to the latest version of Sphinx to fix build of developer documentation#14011
seanbudd merged 1 commit into
nvaccess:masterfrom
lukaszgo1:updateSphinx

Conversation

@lukaszgo1

Copy link
Copy Markdown
Contributor

Link to issue number:

None, reported several times on NVDA-devel

Summary of the issue:

Currently when trying to execute scons devDocs build fails, and the following error is shown:

D:\my_repos\nvda\.venv\Scripts\python.exe -m sphinx.cmd.build -M html devDocs devDocs\_build
Traceback (most recent call last):
  File "C:\Python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "C:\Python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\my_repos\nvda\.venv\lib\site-packages\sphinx\cmd\build.py", line 25, in <module>
    from sphinx.application import Sphinx
  File "D:\my_repos\nvda\.venv\lib\site-packages\sphinx\application.py", line 43, in <module>
    from sphinx.registry import SphinxComponentRegistry
  File "D:\my_repos\nvda\.venv\lib\site-packages\sphinx\registry.py", line 24, in <module>
    from sphinx.builders import Builder
  File "D:\my_repos\nvda\.venv\lib\site-packages\sphinx\builders\__init__.py", line 26, in <module>
    from sphinx.util import import_object, logging, progress_message, rst, status_iterator
  File "D:\my_repos\nvda\.venv\lib\site-packages\sphinx\util\rst.py", line 21, in <module>
    from jinja2 import Environment, environmentfilter
ImportError: cannot import name 'environmentfilter' from 'jinja2' (D:\my_repos\nvda\.venv\lib\site-packages\jinja2\__init__.py)
scons: *** [devDocs\_build] Error 1
scons: building terminated because of errors.

The error is caused by the fact that the version of Sphinx we're using incorrectly specifies the range of Jinja2 on which it depends, and authors of Jinja2 removed various deprecated methods in version 3.1. The more recent version of Sphinx fixes this issue.

Description of user facing changes

Developers can once again build developer documentation.

Description of development approach

I've updated the version of Sphinx in our requirements file to the latest at the time. While at it I've also specified explicitly the version of sphinx_rtd_theme we need.

Testing strategy:

Made sure that developer documentation can be build correctly.

Known issues with pull request:

None known

Change log entries:

None needed.

Code Review Checklist:

  • Pull Request description:
    • description is up to date
    • change log entries
  • Testing:
    • Unit tests
    • System (end to end) tests
    • Manual testing
  • API is compatible with existing add-ons.
  • Documentation:
    • User Documentation
    • Developer / Technical Documentation
    • Context sensitive help for GUI changes
  • UX of all users considered:
    • Speech
    • Braille
    • Low Vision
    • Different web browsers
    • Localization in other languages / culture than English

@lukaszgo1 lukaszgo1 requested a review from a team as a code owner August 13, 2022 15:18
@lukaszgo1 lukaszgo1 requested a review from seanbudd August 13, 2022 15:18
@seanbudd seanbudd merged commit a0bd47d into nvaccess:master Aug 15, 2022
@nvaccessAuto nvaccessAuto added this to the 2022.4 milestone Aug 15, 2022
@lukaszgo1 lukaszgo1 deleted the updateSphinx branch August 15, 2022 09:28
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.

3 participants