You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
gh-38957: rebase sage_autodoc to sphinx 8.1.3
`sage_autodoc.py` is not currently working with sphinx 8.1+. In
particular `warningiserror` has mostly been removed. From logs generated
by sphinx:
```
# Platform: linux; (Linux-6.6.58-gentoo-dist-x86_64-Intel-R-
_Core-TM-_i7-9700_CPU_@_3.00GHz-with-glibc2.40)
# Sphinx version: 8.1.3
# Python version: 3.12.7 (CPython)
# Docutils version: 0.21.2
# Jinja2 version: 3.1.4
# Pygments version: 2.18.0
# Last messages:
# index
#
#
# reading sources... [ 8%]
# options
#
#
# reading sources... [ 11%]
# sage/misc/trace
#
# Loaded extensions:
# sphinx.ext.mathjax (8.1.3)
# alabaster (1.0.0)
# sphinxcontrib.applehelp (2.0.0)
# sphinxcontrib.devhelp (2.0.0)
# sphinxcontrib.htmlhelp (2.1.0)
# sphinxcontrib.serializinghtml (2.0.0)
# sphinxcontrib.qthelp (2.0.0)
# sage_docbuild.ext.inventory_builder (unknown version)
# sage_docbuild.ext.multidocs (unknown version)
# sphinx.ext.autodoc.preserve_defaults (8.1.3)
# sphinx.ext.autodoc.type_comment (8.1.3)
# sphinx.ext.autodoc.typehints (8.1.3)
# sage_docbuild.ext.sage_autodoc (8.1.3)
# sphinx.ext.todo (8.1.3)
# sphinx.ext.extlinks (8.1.3)
# sphinx.ext.linkcode (8.1.3)
# sphinx_copybutton (0.5.2)
# sphinx_inline_tabs (2023.04.21)
# IPython.sphinxext.ipython_directive (unknown version)
# matplotlib.sphinxext.plot_directive (3.9.2)
# jupyter_sphinx (0.5.3)
# Traceback:
Traceback (most recent call last):
File "/usr/lib/python3.12/site-packages/sphinx/cmd/build.py", line
514, in build_main
app.build(args.force_all, args.filenames)
File "/usr/lib/python3.12/site-packages/sphinx/application.py", line
381, in build
self.builder.build_update()
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py",
line 358, in build_update
self.build(
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py",
line 385, in build
updated_docnames = set(self.read())
^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py",
line 502, in read
self._read_serial(docnames)
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py",
line 567, in _read_serial
self.read_doc(docname)
File "/usr/lib/python3.12/site-packages/sphinx/builders/__init__.py",
line 630, in read_doc
publisher.publish()
File "/usr/lib/python3.12/site-packages/docutils/core.py", line 234,
in publish
self.document = self.reader.read(self.source, self.parser,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/sphinx/io.py", line 106, in
read
self.parse()
File "/usr/lib/python3.12/site-packages/docutils/readers/__init__.py",
line 76, in parse
self.parser.parse(self.input, document)
File "/usr/lib/python3.12/site-packages/sphinx/parsers.py", line 85,
in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 169, in run
results = StateMachineWS.run(self, input_lines, input_offset,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 233, in run
context, next_state, result = self.check_line(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 445, in check_line
return method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2790, in underline
self.section(title, source, style, lineno - 1, messages)
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 325, in section
self.new_subsection(title, lineno, messages)
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 391, in new_subsection
newabsoffset = self.nested_parse(
^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 279, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 233, in run
context, next_state, result = self.check_line(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 445, in check_line
return method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2359, in explicit_markup
self.explicit_list(blank_finish)
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2384, in explicit_list
newline_offset, blank_finish = self.nested_list_parse(
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 316, in nested_list_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 195, in run
results = StateMachineWS.run(self, input_lines, input_offset)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 233, in run
context, next_state, result = self.check_line(
^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-packages/docutils/statemachine.py",
line 445, in check_line
return method(match, context, next_state)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2662, in explicit_markup
nodelist, blank_finish = self.explicit_construct(match)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2369, in
explicit_construct
return method(self, expmatch)
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2106, in directive
return self.run_directive(
^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/docutils/parsers/rst/states.py", line 2156, in run_directive
result = directive_instance.run()
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/sphinx/ext/autodoc/directive.py", line 139, in run
documenter.generate(more_content=self.content)
File "/usr/lib/python3.12/site-
packages/sage_docbuild/ext/sage_autodoc.py", line 941, in generate
if not self.import_object():
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/sage_docbuild/ext/sage_autodoc.py", line 1073, in import_object
ret = super().import_object(raiseerror)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/site-
packages/sage_docbuild/ext/sage_autodoc.py", line 479, in import_object
ret = import_object(self.modname, self.objpath, self.objtype,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: import_object() got an unexpected keyword argument
'warningiserror'
```
This PR rebase sage_autodoc to the level of sphinx 8.1.3 while
preserving the previous compatibility for python3.9. Some more
compatibility fix may have to be added.
### 📝 Checklist
<!-- Put an `x` in all the boxes that apply. -->
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.
URL: #38957
Reported by: François Bissey
Reviewer(s):
0 commit comments