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

sphinx 8.1.3 is breaking things (sage-doc) #799

Open
kiwifb opened this issue Nov 6, 2024 · 9 comments
Open

sphinx 8.1.3 is breaking things (sage-doc) #799

kiwifb opened this issue Nov 6, 2024 · 9 comments

Comments

@kiwifb
Copy link
Collaborator

kiwifb commented Nov 6, 2024

# 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:
#   complex_dynamics
#   
#   
#   reading sources... [ 18%]
#   index
#   
#   
#   reading sources... [ 24%]
#   sage/dynamics/arithmetic_dynamics/affine_ds
#   

# 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'

Looks like a new update to sage_autodoc will be required. In the meantime, stay on sphinx-8.0.x.

@strogdon
Copy link
Contributor

strogdon commented Nov 6, 2024

Did you get this when building or when running a doctest?

@strogdon
Copy link
Contributor

strogdon commented Nov 6, 2024

I see, sphinx was upgraded after I had built sage-doc-9999. It now fails to build.

@kiwifb
Copy link
Collaborator Author

kiwifb commented Nov 6, 2024

The same thing kind of happened to me. Build one day and not the next with no obvious reason until I noticed sphinx install date. A sage_autodoc change is needed, I do not know when I will have time to do it.

@strogdon
Copy link
Contributor

strogdon commented Nov 7, 2024

It appears that the warningiserror keyword had been removed from sphinx/ext/autodoc/importer.py (see sphinx-doc/sphinx@fadb6b1#diff-7889318d4dc88e0a7b10ab819483443dd071d1357fe8a91891c19736cd820723). Not sure what it needs to be replaced with if anything. I was able to build the docs by removing the warningiserror=self.config.autodoc_warningiserror argument from the calls to import_object( ... ) in sage_autodoc.py, as for example

                ret = import_object(self.modname, self.objpath, self.objtype,
                                    attrgetter=self.get_attr)
#                                    attrgetter=self.get_attr,
#                                    warningiserror=self.config.autodoc_warningiserror)

@kiwifb
Copy link
Collaborator Author

kiwifb commented Nov 7, 2024

sage_autodoc.py is based on sphinx/ext/autodoc/__init__.py and there is only one reference left to warningiserror in that file in sphinx 8.1.x.

@kiwifb kiwifb changed the title sphinx 8.1.3 is breaking things sphinx 8.1.3 is breaking things (sage-doc) Nov 7, 2024
@kiwifb
Copy link
Collaborator Author

kiwifb commented Nov 12, 2024

Pushed sagemath/sage#38957 upstream seems to work in sage-on-gentoo. I will make it more widely available tomorrow.

@kiwifb
Copy link
Collaborator Author

kiwifb commented Nov 13, 2024

OK I have pushed the patch to master for both 9999 and 10.4 now. Allow 15mn for synchronisation before trying it out.

@kiwifb
Copy link
Collaborator Author

kiwifb commented Nov 13, 2024

I should mention that you need to re-install sage_docbuild before trying to install sage-doc with sphinx-8.1.3.

@strogdon
Copy link
Contributor

This works here.

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

No branches or pull requests

2 participants