community
community copied to clipboard
Sphinx `7.0.0` is incompatible due to usage of `style` key.
Software Versions
- Python: *
- OS: *
- Kivy: master
- Kivy installation method: source
Describe the bug
We needed to pin Sphinx ~=6.2.1 since we're incompatible with Sphinx 7.0.0.
This is due to usage of style key which has been removed.
Theme error:
/home/runner/work/kivy/kivy/kivy/__init__.py
An error happened in rendering the page api-index.
Reason: UndefinedError("'style' is undefined")
Auto-generation finished
The issue tracker is a tool to address bugs only (search known bugs: https://git.io/vM1iE). Please use the #support Discord channel at https://chat.kivy.org/ or Stack Overflow for support questions, more information at https://git.io/vM1yQ.
Expected behavior Docs built successfully
To Reproduce
Build docs with a sphinx version >=7.0.0
Code and Logs and screenshots
Additional context
Hey! I'm new around here. I would like to work on this task.
Hi @jhonatancaetano !
I've assigned the issue to you 😀
This issue occurs due to incompatibility between Kivy and Sphinx 7.0.0 or higher. To resolve this issue, I follow these steps:
-
Checked the Sphinx version: I checked if the Sphinx version installed in my environment was 7.0.0 or higher. If that were the case, you would need to downgrade to a previous Kivy-compatible version.
-
I uninstalled the current Sphinx: I used the
pip uninstall sphinxcommand to uninstall the current version of Sphinx. -
Install a compatible version of Sphinx: I have installed a compatible version of Sphinx that is supported by Kivy. Using the command
pip install -Iv sphinx==6.2.1to specifically install the 6.2.1 version of Sphinx. -
Rebuild the documents: After installing the correct version of Sphinx, I tried to rebuild the Kivy docs using the command
python -m sphinx <path_to_your_project>/docs <path_to_your_project>/docs/_build.
I tried to solve this problem in this way.
When I went to follow these steps, it already shows Sphinx in version 6.2.1.
Hi @jhonatancaetano !
Yeah, sphinx>=7.0.0 is incompatible with Kivy ATM, what we should do in a related PR is to fix how we interact with sphinx, in order to support a more recent version.
This PR, in sphinx, which have removed support for the style key, also suggest a migration path 😀: https://github.com/sphinx-doc/sphinx/pull/11381
Hi @jhonatancaetano. Are you still working on this? Do you mind giving a status report here? Thanks.
Moving to milestone 3.0.0, who was in charge of this issue changed his mind, so the issue is still looking for a parent.
The error is still reproducible with sphinx 7++
But can someone point me to this style attribute? I can't see it in *.rst files. Is it in some CSS? in html template? in sphinx_rtd_theme ? A friendly point out would be appreciated.
Custom themes in sphinx contain a layout.html document that the docs are based on when they are rendered (ex. via make html). The style key is deprecated since 7.0.0, so you must use the new styles key to link to your static docs. You will likely need to update the base template (ex. layout.html) with the new syntax. Hope this helps.