Skip to content

BUG: Fix bug with show_api_usage#1095

Merged
larsoner merged 4 commits intosphinx-gallery:masterfrom
larsoner:bug
Mar 9, 2023
Merged

BUG: Fix bug with show_api_usage#1095
larsoner merged 4 commits intosphinx-gallery:masterfrom
larsoner:bug

Conversation

@larsoner
Copy link
Copy Markdown
Contributor

@larsoner larsoner commented Mar 9, 2023

This is going to be hard to test without a run that uses sphinx-autoapi.

@tamasgal can you try this branch? Something like pip install https://github.com/larsoner/sphinx-gallery/zipball/bug should do it. If it fails, can you use the verbose mode again so I can see the failing traceback?

Closes #1093

@larsoner
Copy link
Copy Markdown
Contributor Author

larsoner commented Mar 9, 2023

... also @tamasgal please set show_api_usage=False (which is/should be the default) or remove it from your config for now. For 0.12.1 we should just fix the broken default case I think. Then later we can try to make show_api_usage=True work correctly.

@larsoner larsoner added the bug label Mar 9, 2023
@tamasgal
Copy link
Copy Markdown

tamasgal commented Mar 9, 2023

Thanks for the quick response! I tried your branch and also removed the show_api_usage but I still get the error with api_entries:

generating gallery...

Traceback (most recent call last):
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx/cmd/build.py", line 279, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx/application.py", line 262, in __init__
    self._init_builder()
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx/application.py", line 335, in _init_builder
    self.events.emit('builder-inited')
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx/events.py", line 96, in emit
    results.append(listener.handler(self.app, *args))
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx_gallery/gen_gallery.py", line 501, in generate_gallery_rst
    gallery_conf = parse_config(app)
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx_gallery/gen_gallery.py", line 134, in parse_config
    gallery_conf = _complete_gallery_conf(
  File "/Users/tamasgal/Dev/km3io/venv/lib/python3.10/site-packages/sphinx_gallery/gen_gallery.py", line 172, in _complete_gallery_conf
    raise ConfigError(msg.strip())
sphinx.errors.ConfigError: Unknown key(s) in sphinx_gallery_conf:
'api_entries'

Configuration error:
Unknown key(s) in sphinx_gallery_conf:
'api_entries'

It might not be the best way to test it (far from a MWE 😆) but at least we can decrease the iteration time if you try one of my packages, this copy&paste block should reproduce the error within a minute or so:

git clone https://git.km3net.de/km3py/km3io.git
cd km3io
python3 -m venv venv
. venv/bin/activate
make install-dev
pip install https://github.com/larsoner/sphinx-gallery/zipball/bug
cd doc
sphinx-build -M html "." "_build" -vvv

Of course I am happy to help with the testing (currently stuck in teaching).

@larsoner
Copy link
Copy Markdown
Contributor Author

larsoner commented Mar 9, 2023

Okay I pushed another commit, with that one I get:

~/python/km3pipe/doc$ make html SPHINXOPTS="-v -Dplot_gallery=False"
...
Build finished. The HTML pages are in _build/html.

Feel free to check!

@larsoner
Copy link
Copy Markdown
Contributor Author

larsoner commented Mar 9, 2023

Now show_api_usage=True with -Dplot_gallery=False at least runs without error, as does show_api_usage=False and omitting it from the sphinx_gallery_conf entirely, at least at my end. I'll merge when green but please do confirm things are fixed at your end @tamasgal when you get a chance!

@larsoner larsoner enabled auto-merge (squash) March 9, 2023 16:44
@tamasgal
Copy link
Copy Markdown

tamasgal commented Mar 9, 2023

Yes, confirmed, works with a simple make html just like before. Thanks! 🙂

@larsoner larsoner merged commit 68ffa3c into sphinx-gallery:master Mar 9, 2023
@larsoner larsoner deleted the bug branch March 9, 2023 17:25
larsoner added a commit that referenced this pull request Mar 9, 2023
@larsoner
Copy link
Copy Markdown
Contributor Author

larsoner commented Mar 9, 2023

0.12.1 cut with this fix: https://pypi.org/project/sphinx-gallery/0.12.1/

clrpackages referenced this pull request in clearlinux-pkgs/pypi-sphinx_gallery Mar 11, 2023
… to version 0.12.1

v0.12.1
-------

**Fixed bugs:**

-  BUG: Fix bug with show_api_usage `#1095 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1095>`__ (`larsoner <https://github.com/larsoner>`__)
-  FIX: Add blank line at end of table of contents block `#1094 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1094>`__ (`sdhiscocks <https://github.com/sdhiscocks>`__)

v0.12.0
-------
Support for Sphinx < 4 dropped in this release. Requirement is Sphinx >= 4.

**Implemented enhancements:**

-  ENH: allow rst files to pass through `#1071 <https://github.com/sphinx-gallery/sphinx-gallery/pull/1071>`__ (`jklymak <https://github.com/jklymak>`__)

(NEWS truncated at 15 lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gallery HTML build broken after upgrade vom 0.11.1 to 0.12.0

2 participants