Skip to content

asyncssh causes mypy to crash #542

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

Closed
JCHacking opened this issue Feb 17, 2023 · 7 comments
Closed

asyncssh causes mypy to crash #542

JCHacking opened this issue Feb 17, 2023 · 7 comments

Comments

@JCHacking
Copy link

JCHacking commented Feb 17, 2023

As soon as I install asyncssh and run mypy I get the following error:

Generated HTML report (via XSLT): C:\Users\jcmencia\PycharmProjects\test\reports\typing\index.html
Traceback (most recent call last):
File "", line 198, in run_module_as_main
File "", line 88, in run_code
File "C:\Users\jcmencia\PycharmProjects\test\venv\Scripts\mypy.exe_main
.py", line 7, in
File "C:\Users\jcmencia\PycharmProjects\test\venv\Lib\site-packages\mypy_main
.py", line 15, in console_entry
main()
File "mypy\main.py", line 95, in main
File "mypy\main.py", line 174, in run_build
File "mypy\build.py", line 194, in build
File "mypy\build.py", line 277, in _build
File "mypy\build.py", line 2923, in dispatch
File "mypy\build.py", line 3320, in process_graph
File "mypy\build.py", line 3443, in process_stale_scc
File "mypy\build.py", line 2504, in write_cache
File "mypy\build.py", line 1574, in write_cache
File "mypy\nodes.py", line 377, in serialize
File "mypy\nodes.py", line 3841, in serialize
File "mypy\nodes.py", line 3778, in serialize
File "mypy\nodes.py", line 3514, in serialize
File "mypy\types.py", line 2072, in serialize
File "mypy\types.py", line 605, in serialize
File "mypy\types.py", line 2876, in serialize
AssertionError: Internal error: unresolved placeholder type None

Mypy Configuration
mypy -> 1.0.0

[tool.mypy]
html_report = "reports/typing"
junit_xml = "reports/typing/junit.xml"
files = "src, tests"
disallow_any_generics = true
disallow_incomplete_defs = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
disallow_untyped_calls = true
disallow_subclassing_any = true
check_untyped_defs = true
no_implicit_optional = true
show_error_codes = true
warn_redundant_casts = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
warn_unreachable = true
strict_equality = true
strict_concatenate = true
plugins = ["pydantic.mypy"]
[tool.pydantic-mypy]
init_forbid_extra = true
init_typed = true
warn_required_dynamic_aliases = true
warn_untyped_fields = true

Edit

  • Without any configuration running mypy src also happens.
  • Set up a new project from scratch with the same files and packages. Now it works... I'm still investigating what could cause the error.
@ronf
Copy link
Owner

ronf commented Feb 17, 2023

It looks like you are running into python/mypy#14631. There's a fix available in mypy for this, but I'm not sure it has made it into a mypy release yet.

@ronf
Copy link
Owner

ronf commented Feb 18, 2023

The code in AsyncSSH that triggers this internal error was causing other problems, so I added a workaround in commit 0d49161, which seems to avoid the error for me.

@JCHacking
Copy link
Author

JCHacking commented Feb 18, 2023

In the project in which it failed me, changing the dependency to the one of the commit that you indicate me, mypy no longer fails. So in my case it is also solved!

Thanks a lot!!!

P.S. When will this correction be released to pypi?

@ronf
Copy link
Owner

ronf commented Feb 18, 2023

Great! Thanks for letting me know...

I'll try to put out a bug fix release of AsyncSSH with this change in the next few days.

@ronf
Copy link
Owner

ronf commented Feb 18, 2023

This is now released in AsyncSSH 2.13.1.

@JCHacking
Copy link
Author

Tested with the new version and it works, so the matter is finished. 👍

@ronf
Copy link
Owner

ronf commented Feb 19, 2023

Thanks for the confirmation!

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

2 participants