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

Shrink the mypy whitelist: sphinx.application #12568

Merged
merged 9 commits into from
Jul 15, 2024

Conversation

danieleades
Copy link
Contributor

just chipping away at the mypy whitelist

@danieleades
Copy link
Contributor Author

error in the docs build:

/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/sphinx/application.py:docstring of sphinx.application.Sphinx.add_autodocumenter:1: WARNING: py:class reference target not found: Documenter [ref.class]

looks a little like this one - #12286

assert issubclass(cls, SearchLanguage)
languages[cls.lang] = cls
from sphinx.search import languages
lang = cast(str, cls.lang) # SearchLanguage subclasses must set 'lang' to a str
Copy link
Member

Choose a reason for hiding this comment

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

I had thought that cast is meant to be avoided?

Suggested change
lang = cast(str, cls.lang) # SearchLanguage subclasses must set 'lang' to a str
lang = cls.lang
assert isinstance(lang, str) # SearchLanguage subclasses must set 'lang' to a str

@AA-Turner AA-Turner changed the title shrink mypy whitelist Shrink the mypy whitelist: sphinx.application Jul 15, 2024
@AA-Turner AA-Turner merged commit f4bb9ca into sphinx-doc:master Jul 15, 2024
21 checks passed
@AA-Turner AA-Turner added this to the 7.4.0 milestone Jul 15, 2024
@danieleades danieleades deleted the mypy-whitelist branch July 18, 2024 06:08
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants