Remove unneeded type: ignore annotations by jakobandersen · Pull Request #813 · breathe-doc/breathe (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation4 Commits3 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
mypy seems to have gotten more clever.
I also had to do somethings to get the pygments API typing.
--- breathe/filetypes.py +++ breathe/filetypes.py
- import pygments # type: ignore
- from pygments.lexers import get_lexer_for_filename
- from pygments.util import ClassNotFound
def get_pygments_alias(filename: str) -> Optional[str]: "Find first pygments alias from filename" try:
lexer_cls = pygments.lexers.get_lexer_for_filename(filename)return lexer_cls.aliases[0]
lexer_cls = get_lexer_for_filename(filename)return lexer_cls.aliases[0] # type: ignore
- except pygments.util.ClassNotFound:
- except ClassNotFound: return None
and add
to requirements/development.txt
@2bndy5, there are indeed other typing issues that should be fixed in various places. Locally my mypy also complains about more stuff, but maybe it's because it's an older Python version than in the CI.
For now I'll just make the CI green :-).
I also had to do somethings to get the pygments API typing.
Interesting to see! I struggled to understand how to make mypy happy with that.
github-actions bot added a commit to Diapolo10/lidar-projekti that referenced this pull request
github-actions bot added a commit to MaRDI4NFDI/open-interfaces that referenced this pull request
jpthiele added a commit to instatdealii/idealii that referenced this pull request
github-merge-queue bot pushed a commit to openvinotoolkit/openvino that referenced this pull request