Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Regression with #10850

Closed
larsoner opened this issue Sep 22, 2022 · 6 comments · Fixed by #10851
Closed

BUG: Regression with #10850

larsoner opened this issue Sep 22, 2022 · 6 comments · Fixed by #10851
Labels
Milestone

Comments

@larsoner
Copy link
Contributor

Describe the bug

#10717 (cc @marxin, @AA-Turner) broke things in sphinx-gallery tests:

https://dev.azure.com/sphinx-gallery/sphinx-gallery/_build/results?buildId=881&view=logs&j=afeff7a1-1360-5c62-1669-7f018f69783f&t=b0b17f84-1475-5e62-5f43-b0e7d65ffba0&l=232

sphinx_gallery/tests/test_full.py:569: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../sphinx/sphinx/application.py:350: in build
    self.builder.build_update()
../sphinx/sphinx/builders/__init__.py:301: in build_update
    self.build(to_build,
../sphinx/sphinx/builders/__init__.py:367: in build
    self.write(docnames, list(updated_docnames), method)
../sphinx/sphinx/builders/__init__.py:551: in write
    self.prepare_writing(docnames)
../sphinx/sphinx/builders/html/__init__.py:470: in prepare_writing
    self.load_indexer(docnames)
../sphinx/sphinx/builders/html/__init__.py:947: in load_indexer
    self.indexer.prune(keep)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <sphinx.search.IndexBuilder object at 0x7fb4081792a0>
docnames = {'auto_examples/future/plot_future_imports', 'auto_examples/local_module', 'auto_examples/plot_animation', 'auto_examples/plot_command_line_args', 'auto_examples/plot_defer_figures', 'auto_examples/plot_log', ...}

    def prune(self, docnames: Iterable[str]) -> None:
        """Remove data for all docnames not in the list."""
        new_titles = {}
        new_alltitles = {}
        new_filenames = {}
        for docname in docnames:
            if docname in self._titles:
                new_titles[docname] = self._titles[docname]
>               new_alltitles[docname] = self._all_titles[docname]
E               KeyError: 'auto_examples/local_module'

../sphinx/sphinx/search/__init__.py:399: KeyError

How to Reproduce

$ git clone https://github.com/sphinx-gallery/sphinx-gallery.git
$ cd sphinx-gallery
$ pip install matplotlib pytest
$ pytest sphinx_gallery -k rebuild

Expected behavior

No error

Your project

https://github.com/sphinx-gallery/sphinx-gallery/

Screenshots

No response

OS

Linux

Python version

3.10

Sphinx version

5.0dev

Sphinx extensions

sphinx-gallery

Extra tools

No response

Additional context

No response

@AA-Turner
Copy link
Member

Is there a smaller reproducer or single failing test?

A

@larsoner
Copy link
Contributor Author

Is there a smaller reproducer or single failing test?

The -k rebuild in the commands above will select a single test from our test suite already. Or do you mean something else?

marxin added a commit to marxin/sphinx that referenced this issue Sep 22, 2022
When there is a document with no entry in _all_titles, we must
add empty array when loading from frozenset.

Fixes: sphinx-doc#10850.
marxin added a commit to marxin/sphinx that referenced this issue Sep 22, 2022
When there is a document with no entry in _all_titles, we must
add empty array when loading from frozenset.

Fixes: sphinx-doc#10850.
@marxin
Copy link
Contributor

marxin commented Sep 22, 2022

Thanks for the bug report and I've got a fix for it :)

@AA-Turner AA-Turner added this to the 5.2.0 milestone Sep 23, 2022
@AA-Turner
Copy link
Member

@larsoner please confirm the fix works for you, I intend to release 5.2.0 tomorrow.

A

@larsoner
Copy link
Contributor Author

Yes it fixes the broken test, thanks for the quick fix @AA-Turner !

@AA-Turner
Copy link
Member

It was @marxin's work, thank him!

A

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants