executablebooks / sphinx-book-theme

A clean book theme for scientific explanations and documentation with Sphinx
https://sphinx-book-theme.readthedocs.io
BSD 3-Clause "New" or "Revised" License
429 stars 198 forks source link

pydata-sphinx-theme 0.13.2 breaks sphinx-book-theme #711

Closed jakevdp closed 1 year ago

jakevdp commented 1 year ago

Describe the bug

After pydata-sphinx-theme updated to 0.13.2, our sphinx-build job in http://github.com/google/jax showed the following error:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/cmd/build.py", line 276, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 262, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/application.py", line 334, in _init_builder
    self.builder.init()
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/builders/html/__init__.py", line 248, in init
    self.init_templates()
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/builders/html/__init__.py", line 299, in init_templates
    self.theme = theme_factory.create(themename)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/theming.py", line 232, in create
    self.load_extra_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/theming.py", line 177, in load_extra_theme
    self.load_external_theme(name)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/theming.py", line 202, in load_external_theme
    self.app.registry.load_extension(self.app, entry_point.module)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/sphinx/registry.py", line 462, in load_extension
    raise ExtensionError(__('Could not import extension %s') % extname,
sphinx.errors.ExtensionError: Could not import extension sphinx_book_theme (exception: cannot import name '_get_theme_options' from 'pydata_sphinx_theme' (/home/docs/checkouts/readthedocs.org/user_builds/jax/envs/latest/lib/python3.9/site-packages/pydata_sphinx_theme/__init__.py))

We are pinning to pydata-sphinx-theme==0.13.1 for the time being to fix the error.

The breaking change in pydata-sphinx-theme seems to be this one: https://github.com/pydata/pydata-sphinx-theme/commit/fc975d0737a6096dcadd783128027aa4469e7261

I'm reporting here because it looks like sphinx-book-theme is using an API that is intended to be private.

welcome[bot] commented 1 year ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

AakashGfude commented 1 year ago

Hi @jakevdp, thank you for raising this. Your comments are on point. We will follow your advice and fix this soon.

jakevdp commented 1 year ago

It looks like pydata-sphinx-theme 0.13.3 has a new public method, pydata_sphinx_theme.utils.sphinx_book_theme_dict. The fix I think would be to pin pydata-sphinx-theme>=0.13.3 and use that new public API.