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

mypy findings with traitlets 5.10.1 #14181

Open
bollwyvl opened this issue Sep 29, 2023 · 0 comments
Open

mypy findings with traitlets 5.10.1 #14181

bollwyvl opened this issue Sep 29, 2023 · 0 comments

Comments

@bollwyvl
Copy link
Contributor

Downstream on conda-forge, mypy found the following issues when run under the pyproject.toml settings vs traitlets 5.10.1. Of course, some of these might be false positives.

/core/magics/ast_mod.py:244: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
/core/extensions.py:89: error: Item "None" of "Optional[Any]" has no attribute "builtin_trap"  [union-attr]
/terminal/prompts.py:100: error: Item "None" of "Optional[Any]" has no attribute "mime_renderers"  [union-attr]
/terminal/prompts.py:102: error: Item "None" of "Optional[Any]" has no attribute "mime_renderers"  [union-attr]
/core/formatters.py:56: error: Need type annotation for "ipython_display_formatter"  [var-annotated]
/core/formatters.py:61: error: Need type annotation for "mimebundle_formatter"  [var-annotated]
/core/interactiveshell.py:1785: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
/core/interactiveshell.py:2380: error: Item "None" of "Optional[Any]" has no attribute "lazy_magics"  [union-attr]
/core/interactiveshell.py:2403: error: Item "None" of "Optional[Any]" has no attribute "lazy_magics"  [union-attr]
/core/interactiveshell.py:2431: error: Item "None" of "Optional[Any]" has no attribute "__enter__"  [union-attr]
/core/interactiveshell.py:2431: error: Item "None" of "Optional[Any]" has no attribute "__exit__"  [union-attr]
/core/interactiveshell.py:3184: error: Incompatible types in assignment (expression has type "int", variable has type "None")  [assignment]
/core/interactiveshell.py:3232: error: Item "None" of "Optional[Any]" has no attribute "store_inputs"  [union-attr]
/core/interactiveshell.py:3246: error: "object" not callable  [operator]
/core/interactiveshell.py:3250: error: Item "None" of "Optional[Any]" has no attribute "__enter__"  [union-attr]
/core/interactiveshell.py:3250: error: Item "None" of "Optional[Any]" has no attribute "__exit__"  [union-attr]
/core/interactiveshell.py:3253: error: Item "None" of "Optional[Any]" has no attribute "__enter__"  [union-attr]
/core/interactiveshell.py:3253: error: Item "None" of "Optional[Any]" has no attribute "__exit__"  [union-attr]
/core/interactiveshell.py:3297: error: Item "None" of "Optional[Any]" has no attribute "store_output"  [union-attr]

We'll skip and ship anyhow, but wanted to note this someplace more visible.

Carreau added a commit to Carreau/ipython that referenced this issue Oct 1, 2023
See ipython#14181

This fixes the first few errors.
Carreau added a commit to Carreau/ipython that referenced this issue Oct 1, 2023
See ipython#14181.  Most of those are never None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant