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

Update needed for Sphinx 8.0 #619

Closed
WarrenWeckesser opened this issue Aug 5, 2024 · 4 comments · Fixed by #620
Closed

Update needed for Sphinx 8.0 #619

WarrenWeckesser opened this issue Aug 5, 2024 · 4 comments · Fixed by #620
Labels
bug Something isn't working

Comments

@WarrenWeckesser
Copy link

WarrenWeckesser commented Aug 5, 2024

Describe the bug

The CI build of the SciPy docs is failing with the recently updated Sphinx 8.0.2. Initially the problem was coming from jupyterlite_sphinx (see jupyterlite/jupyterlite-sphinx#197). A current pull request there fixes the error that occurs in jupyterlite_sphinx, but the build of the SciPy docs fails again in myst_nb code:

[...snip...]
reading sources... [ 96%] tutorial/interpolate/interp_transition_guide
Traceback (most recent call last):
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/cmd/build.py", line 337, in build_main
    app.build(args.force_all, args.filenames)
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/application.py", line 378, in build
    self.builder.build_update()
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 296, in build_update
    self.build(to_build,
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 317, in build
    updated_docnames = set(self.read())
                           ^^^^^^^^^^^
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 424, in read
    self._read_serial(docnames)
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 476, in _read_serial
    self.read_doc(docname)
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/builders/__init__.py", line 535, in read_doc
    publisher.publish()
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/docutils/core.py", line 234, in publish
    self.document = self.reader.read(self.source, self.parser,
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/io.py", line 106, in read
    self.parse()
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/docutils/readers/__init__.py", line 76, in parse
    self.parser.parse(self.input, document)
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/myst_nb/sphinx_.py", line 85, in parse
    nb_reader = create_nb_reader(document_path, md_config, nb_config, inputstring)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/myst_nb/core/read.py", line 71, in create_nb_reader
    if path.endswith(suffix):
       ^^^^^^^^^^^^^
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/util/_pathlib.py", line 96, in __getattr__
    warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
sphinx.deprecation.RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.

Exception occurred:
  File "/home/warren/py3.12.4/lib/python3.12/site-packages/sphinx/util/_pathlib.py", line 96, in __getattr__
    warnings.warn(_MSG, RemovedInSphinx90Warning, stacklevel=2)
sphinx.deprecation.RemovedInSphinx90Warning: Sphinx 9 will drop support for representing paths as strings. Use "pathlib.Path" or "os.fspath" instead.
The full traceback has been saved in /tmp/sphinx-err-1o84nyhg.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [Makefile:114: html-build] Error 2

The error occurs in 'core/read.py' at line 71:

if path.endswith(suffix):

If I follow the example of the jupyterlite_sphinx pull request, and change that line to:

         if path.suffix == suffix:

the build of the SciPy docs completes successfully.

Reproduce the bug

See above.

List your environment

No response

@agoose77
Copy link
Collaborator

agoose77 commented Aug 6, 2024

Thanks for this report. Will try and get a fix out today (we have been slow to test Sphinx 8).

@WarrenWeckesser
Copy link
Author

Thanks @agoose77. For now, we are sticking with Sphinx 7.4.7 in CI, so we're not blocked.

@bsipocz
Copy link
Collaborator

bsipocz commented Aug 13, 2024

I've run into this issue, too for some tutorial CIs.

Naively went ahead and opened the PR as it looked all good locally.

@raphaelquast
Copy link

Hey, any updates on this one? Just noticed the warning after updating to sphinx v8...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants