Skip to content

Fix docs build with sphinx 'extensions' config key#2352

Open
Yann-P wants to merge 1 commit intopydata:mainfrom
Yann-P:fix-extensions
Open

Fix docs build with sphinx 'extensions' config key#2352
Yann-P wants to merge 1 commit intopydata:mainfrom
Yann-P:fix-extensions

Conversation

@Yann-P
Copy link
Copy Markdown
Collaborator

@Yann-P Yann-P commented Apr 20, 2026

Fixes #2349

Regression introduced by 469e908, which adds a call to get_theme_options_dict, which reads self.builder, but self.builder is not yet defined if the extensions sphinx config is used.

https://github.com/sphinx-doc/sphinx/blob/cc7c6f435ad37bb12264f8118c8461b230e6830c/sphinx/application.py#L299
https://github.com/sphinx-doc/sphinx/blob/cc7c6f435ad37bb12264f8118c8461b230e6830c/sphinx/application.py#L334

Regression introduced by 469e908. extensions=["pydata_sphinx_theme"]
config makes sphinx call setup() in __init__, before self.builder is
defined.

https://github.com/sphinx-doc/sphinx/blob/master/sphinx/application.py#L299
https://github.com/sphinx-doc/sphinx/blob/master/sphinx/application.py#L334
@Yann-P Yann-P requested a review from Carreau April 20, 2026 13:44
Copy link
Copy Markdown
Collaborator

@Carreau Carreau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me,

Should we emit a warning when we encounter this case; or is there something the users should do ?

@Carreau
Copy link
Copy Markdown
Collaborator

Carreau commented Apr 20, 2026

And I'm not even sure if we can or should send a PR to sphinx to make sure that the types annotation can reflect this might be missing (or at least have it always define but be builder: Bulder|None, actual questions.

@Carreau Carreau added this to the 0.18.0 milestone Apr 20, 2026
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

Successfully merging this pull request may close these issues.

pydata-sphinx-theme v0.17 breaks with sphinx 9.1.0

3 participants