Skip to content

Update to sphinx 3 #28856

@timokau

Description

@timokau

Migrate to sphinx 3.

The attributes todo_all_todos and citations were previously
implicitly initialized by sphinx. That changed in sphinx 2.1 due to some
refactoring:

sphinx-doc/sphinx@9abb482
sphinx-doc/sphinx@885d35e

So now we need to check for the case where they are not initialized yet.
We can't actually update to sphinx 2.1 yet, since it's python3 only. This
is mostly intended to make things easier for distros and allow us to
update in the future.

Another issue occurs with intersphinx. Since a refactoring (sphinx-doc/sphinx#5826) the build fails with

[manifolds] Exception occurred:
[manifolds]   File "/nix/store/ldl3rb92yvl070c7q3nnjgwl5mdx2wvb-python3.7-sphinx-2.0.0/lib/python3.7/site-packages/sphinx/ext/intersphinx.py", line 207, in load_mappings
[manifolds]     for key, (name, (uri, invs)) in app.config.intersphinx_mapping.items():
[manifolds] ValueError: too many values to unpack (expected 2)
[manifolds] The full traceback has been saved in /build/sphinx-err-e6h8o39l.log, if you want to report the issue to the developers.
[manifolds] Please also report this if it was a user error, so that a better error message can be provided next time.
[manifolds] A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
Traceback (most recent call last):
  File "/nix/store/9894fxjpg8v99j14kip6b13rdfgf4m5k-python3-3.7.5/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nix/store/9894fxjpg8v99j14kip6b13rdfgf4m5k-python3-3.7.5/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/sphinxbuild.py", line 328, in <module>
    runsphinx()
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/sphinxbuild.py", line 317, in runsphinx
    sys.stderr.raise_errors()
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/sphinxbuild.py", line 252, in raise_errors
    raise OSError(self._error)
OSError: Exception occurred:
Error building the documentation.
Traceback (most recent call last):
  File "/nix/store/9894fxjpg8v99j14kip6b13rdfgf4m5k-python3-3.7.5/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/nix/store/9894fxjpg8v99j14kip6b13rdfgf4m5k-python3-3.7.5/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/__main__.py", line 2, in <module>
    main()
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/__init__.py", line 1671, in main
    builder()
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/__init__.py", line 310, in _wrapper
    getattr(get_builder(document), name)(*args, **kwds)
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/__init__.py", line 504, in _wrapper
    build_many(build_ref_doc, L)
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/__init__.py", line 258, in build_many
    _build_many(target, args, processes=NUM_THREADS)
  File "/nix/store/i0gjbmskaxkmj2qif96ayvb803l6hm4k-python3.7-sagelib-9.0.beta6/lib/python3.7/site-packages/sage_setup/docbuild/utils.py", line 283, in build_many
    raise worker_exc.original_exception

which seems to suggest that the normalization hook added in the refactoring PR is not called.

Tarballs:

Depends on #28000
Depends on #29547

CC: @antonio-rojas @kiwifb @saraedum @fchapoton @jhpalmieri @jdemeyer @qed777 @tobihan @strogdon

Component: packages: standard

Keywords: sphinx

Author: Timo Kaufmann, John Palmieri, François Bissey, Antonio Rojas

Branch: bd99462

Reviewer: Timo Kaufmann, John Palmieri, François Bissey, Antonio Rojas

Issue created by migration from https://trac.sagemath.org/ticket/28856

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions