Bug 2221982 - python-sphinx-reredirects fails to build with Sphinx 7.x
Summary: python-sphinx-reredirects fails to build with Sphinx 7.x
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-sphinx-reredirects
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jerry James
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 2188968
TreeView+ depends on / blocked
 
Reported: 2023-07-11 12:10 UTC by Karolina Surma
Modified: 2023-07-11 18:42 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-07-11 18:42:54 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-07-11 12:10:53 UTC
python-sphinx-reredirects fails to build with Sphinx 7.x in Fedora 39 (currently Rawhide).

The issue detected:
```
+ sphinx-build -b html docs
<snip>
Theme error:
An error happened in rendering the page ....
Reason: UndefinedError("'style' is undefined")
```

Sphinx 7 has removed the `style` key for HTML templates (see: https://github.com/sphinx-doc/sphinx/pull/11381).
This can indicate an issue with the Sphinx theme the package uses rather than the package itself.

It should be possible to fix this by replacing the usage of `style` with `styles[-1] in `theme/layout.html`:
-    <link rel="stylesheet" href="{ pathto('_static/' + style, 1) }" type="text/css" />
+    <link rel="stylesheet" href="{ pathto('_static/' + styles[-1], 1) }" type="text/css" />

Please note it may not be the best solution in your specific case.

For the logs from testing build attempts, see:
https://copr.fedorainfracloud.org/coprs/ksurma/doc-stack/package/python-sphinx-reredirects/

You can test you package in mock running:

$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/doc-stack/fedora-rawhide-x86_64/ --no-clean your.src.rpm
$ mock -r fedora-rawhide-x86_64 --addrepo=https://download.copr.fedorainfracloud.org/results/ksurma/doc-stack/fedora-rawhide-x86_64/ shell

We'd like to include Sphinx 7 in Fedora 39.
Let us know here if you have any questions. Thank you!

Comment 1 Fedora Update System 2023-07-11 18:42:14 UTC
FEDORA-2023-72e781c2b8 has been submitted as an update to Fedora 39. https://bodhi.fedoraproject.org/updates/FEDORA-2023-72e781c2b8

Comment 2 Fedora Update System 2023-07-11 18:42:54 UTC
FEDORA-2023-72e781c2b8 has been pushed to the Fedora 39 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.