community icon indicating copy to clipboard operation
community copied to clipboard

Sphinx `7.0.0` is incompatible due to usage of `style` key.

Open misl6 opened this issue 2 years ago • 9 comments
trafficstars

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

misl6 avatar May 03 '23 05:05 misl6

Hey! I'm new around here. I would like to work on this task.

jhonatancaetano avatar May 16 '23 19:05 jhonatancaetano

Hi @jhonatancaetano !

I've assigned the issue to you 😀

misl6 avatar May 21 '23 08:05 misl6

This issue occurs due to incompatibility between Kivy and Sphinx 7.0.0 or higher. To resolve this issue, I follow these steps:

  1. 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.

  2. I uninstalled the current Sphinx: I used the pip uninstall sphinx command to uninstall the current version of Sphinx.

  3. 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.1 to specifically install the 6.2.1 version of Sphinx.

  4. 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.

jhonatancaetano avatar May 25 '23 19:05 jhonatancaetano

When I went to follow these steps, it already shows Sphinx in version 6.2.1. Kivy - Sphinx

jhonatancaetano avatar May 25 '23 19:05 jhonatancaetano

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

misl6 avatar May 26 '23 06:05 misl6

Hi @jhonatancaetano. Are you still working on this? Do you mind giving a status report here? Thanks.

Julian-O avatar Oct 29 '23 17:10 Julian-O

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.

misl6 avatar Dec 17 '23 13:12 misl6

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.

kbaikov avatar Mar 04 '24 13:03 kbaikov

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.

doulikecookiedough avatar Apr 11 '24 20:04 doulikecookiedough