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

Broken on Sphinx 7.2.0 #219

Closed
hynek opened this issue Aug 17, 2023 · 12 comments · Fixed by #220
Closed

Broken on Sphinx 7.2.0 #219

hynek opened this issue Aug 17, 2023 · 12 comments · Fixed by #220
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code

Comments

@hynek
Copy link

hynek commented Aug 17, 2023

docs: commands[0]> sphinx-build -n -T -W -b html -d /Users/hynek/FOSS/svcs/.tox/docs/tmp/doctrees docs docs/_build/html
Running Sphinx v7.2.0

Traceback (most recent call last):
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/cmd/build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/application.py", line 232, in __init__
    self.setup_extension(extension)
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/application.py", line 405, in setup_extension
    self.registry.load_extension(self, extname)
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/registry.py", line 460, in load_extension
    metadata = setup(app)
               ^^^^^^^^^^
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/notfound/extension.py", line 337, in setup
    from sphinx.builders.html import setup_js_tag_helper
ImportError: cannot import name 'setup_js_tag_helper' from 'sphinx.builders.html' (/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/builders/html/__init__.py)

Exception occurred:
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/notfound/extension.py", line 337, in setup
    from sphinx.builders.html import setup_js_tag_helper
ImportError: cannot import name 'setup_js_tag_helper' from 'sphinx.builders.html' (/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/builders/html/__init__.py)
The full traceback has been saved in /var/folders/8c/ffnfsd7s3y151ptr05s8v3tw0000gn/T/sphinx-err-_fb_typ5.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!

Full traceback referenced in log:

# Platform:         darwin; (macOS-13.5-arm64-arm-64bit)
# Sphinx version:   7.2.0
# Python version:   3.11.4 (CPython)
# Docutils version: 0.20.1
# Jinja2 version:   3.1.2
# Pygments version: 2.16.1

# Last messages:


# Loaded extensions:


# Traceback:
Traceback (most recent call last):
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/cmd/build.py", line 293, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/application.py", line 232, in __init__
    self.setup_extension(extension)
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/application.py", line 405, in setup_extension
    self.registry.load_extension(self, extname)
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphinx/registry.py", line 460, in load_extension
    metadata = setup(app)
               ^^^^^^^^^^
  File "/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/notfound/extension.py", line 337, in setup
    from sphinx.builders.html import setup_js_tag_helper
ImportError: cannot import name 'setup_js_tag_helper' from 'sphinx.builders.html' (/Users/hynek/FOSS/svcs/.tox/docs/lib/python3.11/site-packages/sphi
nx/builders/html/__init__.py)
@humitos
Copy link
Member

humitos commented Aug 17, 2023

The helper was removed in Sphinx 7.2.0 at sphinx-doc/sphinx@4b082f7db. We will need to use the new API for CSS and JS here. See sphinx-doc/sphinx#11608

@humitos humitos added Improvement Minor improvement to code Accepted Accepted issue on our roadmap labels Aug 17, 2023
@github-project-automation github-project-automation bot moved this to Planned in 📍Roadmap Aug 17, 2023
ru-fu added a commit to ru-fu/lxd that referenced this issue Aug 18, 2023
Seems the latest Sphinx update has caused more issues ...

7.2.2 doesn't work with the notfound extension (see
readthedocs/sphinx-notfound-page#219 ).
When restricting Sphinx to <7.2.0, RTD uses 6.2.1 though, which
is incompatible with a Furo change (see
pradyunsg/furo#693 ).

Therefore, restrict Sphinx to 7.1.2 until the issues are resolved.

Signed-off-by: Ruth Fuchss <[email protected]>
ru-fu added a commit to ru-fu/starter-pack that referenced this issue Aug 18, 2023
Seems the latest Sphinx update has caused some issues ...

7.2.2 doesn't work with the notfound extension (see
readthedocs/sphinx-notfound-page#219 ).
When restricting Sphinx to <7.2.0, RTD uses 6.2.1 though, which
is incompatible with a Furo change (see
pradyunsg/furo#693 ).

Therefore, restrict Sphinx to 7.1.2 until the issues are resolved.

Signed-off-by: Ruth Fuchss <[email protected]>
stgraber pushed a commit to stgraber/incus that referenced this issue Aug 20, 2023
Seems the latest Sphinx update has caused more issues ...

7.2.2 doesn't work with the notfound extension (see
readthedocs/sphinx-notfound-page#219 ).
When restricting Sphinx to <7.2.0, RTD uses 6.2.1 though, which
is incompatible with a Furo change (see
pradyunsg/furo#693 ).

Therefore, restrict Sphinx to 7.1.2 until the issues are resolved.

Signed-off-by: Ruth Fuchss <[email protected]>
@github-project-automation github-project-automation bot moved this from Planned to Done in 📍Roadmap Aug 24, 2023
@humitos
Copy link
Member

humitos commented Aug 24, 2023

I released https://pypi.org/project/sphinx-notfound-page/1.0.0rc1/, please give it a try and let me know if it works fine for your use case.

@hugovk
Copy link
Contributor

hugovk commented Aug 24, 2023

Works locally with python/devguide#1155 with requirements.txt:

-sphinx-notfound-page
+sphinx-notfound-page==1.0.0rc1

Thanks!

@ru-fu
Copy link

ru-fu commented Aug 24, 2023

Works fine here as well - thanks for the quick fix!

@humitos
Copy link
Member

humitos commented Aug 24, 2023

I plan to wait a couple of days before releasing the final 1.0.0 -- I think I will do it next Wednesday.

@return42
Copy link

return42 commented Aug 27, 2023

Not sure if it is related, but I got an error::

Theme error:
An error happened in rendering the page 404.
Reason: ValueError("invalid literal for int() with base 10: ''")

.. I'm still in analysis

return42 added a commit to return42/searxng that referenced this issue Aug 27, 2023
- Sphinx-doc 7.2.0 drops py3.8 support [1][2]
- last version with py3.8 support is 7.1.2

Many LTS distributions still have py3.8 which EOL is in 2024-10 [3].

To continue to support a development environment on py3.8 the rigid dependency
in the development environment is unpinned in py3.8 / environment markers [4].

To get 7.2.3. work, a fix in sphinx-notfound-page is needed.

[1] searxng#2658 (comment)
[2] sphinx-doc/sphinx#11621
[3] https://devguide.python.org/versions/#supported-versions
[4] https://peps.python.org/pep-0508/#environment-markers
[5] readthedocs/sphinx-notfound-page#219

Signed-off-by: Markus Heiser <[email protected]>
@return42
Copy link

return42 commented Aug 27, 2023

FWI: in the theme.conf I had to set globaltoc_maxdepth to an integer ..

[options]
globaltoc_maxdepth = 5

it seems the default is an empty string ...

  File "site-packages/sphinx/themes/basic/../basic/layout.html", line 60, in template
    {%- include sidebartemplate %}
  File "site-packages/sphinx/themes/basic/globaltoc.html", line 11, in top-level template code
    {{ toctree(includehidden=theme_globaltoc_includehidden, collapse=theme_globaltoc_collapse, maxdepth=theme_globaltoc_maxdepth) }}
  File "site-packages/jinja2/sandbox.py", line 393, in call
    return __context.call(__obj, *args, **kwargs)
  File "site-packages/notfound/extension.py", line 128, in toctree
    toc = global_toctree_for_doc(
  File "sphinx/environment/adapters/toctree.py", line 86, in global_toctree_for_doc
    maxdepth=int(maxdepth),
ValueError: invalid literal for int() with base 10: ''

There was a similar issue in the past:

I assume the issue has been back by:

return42 added a commit to return42/searxng that referenced this issue Aug 27, 2023
- Sphinx-doc 7.2.0 drops py3.8 support [1][2]
- last version with py3.8 support is 7.1.2

Many LTS distributions still have py3.8 which EOL is in 2024-10 [3].

To continue to support a development environment on py3.8 the rigid dependency
in the development environment is unpinned in py3.8 / environment markers [4].

To get 7.2.3. work, a fix in sphinx-notfound-page is needed [5][6].

[1] searxng#2658 (comment)
[2] sphinx-doc/sphinx#11621
[3] https://devguide.python.org/versions/#supported-versions
[4] https://peps.python.org/pep-0508/#environment-markers
[5] readthedocs/sphinx-notfound-page#219
[6] readthedocs/sphinx-notfound-page#219 (comment)

Signed-off-by: Markus Heiser <[email protected]>
return42 added a commit to searxng/searxng that referenced this issue Aug 27, 2023
- Sphinx-doc 7.2.0 drops py3.8 support [1][2]
- last version with py3.8 support is 7.1.2

Many LTS distributions still have py3.8 which EOL is in 2024-10 [3].

To continue to support a development environment on py3.8 the rigid dependency
in the development environment is unpinned in py3.8 / environment markers [4].

To get 7.2.3. work, a fix in sphinx-notfound-page is needed [5][6].

[1] #2658 (comment)
[2] sphinx-doc/sphinx#11621
[3] https://devguide.python.org/versions/#supported-versions
[4] https://peps.python.org/pep-0508/#environment-markers
[5] readthedocs/sphinx-notfound-page#219
[6] readthedocs/sphinx-notfound-page#219 (comment)

Signed-off-by: Markus Heiser <[email protected]>
@humitos
Copy link
Member

humitos commented Aug 27, 2023

@return42 I opened #221 to track the issue you are reporting more in deep.

@humitos
Copy link
Member

humitos commented Aug 30, 2023

I released v1.0.0. I hope it works for everybody 🙏🏼

@hynek
Copy link
Author

hynek commented Aug 30, 2023

Can confirm – thanks for fixing!

@return42
Copy link

Works 👍 .. thanks a lot for fixing! Not sure, may you also want to close ...?


Related:

@humitos
Copy link
Member

humitos commented Aug 30, 2023

Not sure, may you also want to close ...?

I think we can close it because I understand it's an upstream issue, yeah 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Accepted issue on our roadmap Improvement Minor improvement to code
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants