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

te 4.7.0 breaks Mypy daemon on Python 3.7 (TypeError: metaclass conflict) #265

Closed
NiklasRosenstein opened this issue Jul 2, 2023 · 3 comments

Comments

@NiklasRosenstein
Copy link

NiklasRosenstein commented Jul 2, 2023

Using typing-extensions 4.7.0 on Python 3.7 breaks the Mypy daemon:

$ dmypy run src/
Traceback (most recent call last):
  File "mypy/dmypy/client.py", line 274, in main
  File "mypy/dmypy/client.py", line 394, in do_run
  File "mypy/dmypy/client.py", line 350, in start_server
  File "mypy/dmypy_server.py", line 35, in <module>
    from mypy.suggestions import SuggestionEngine, SuggestionFailure
  File "mypy/suggestions.py", line 86, in <module>
    class PyAnnotateSignature(TypedDict):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Pinning typing-extensions 4.6.3 fixes this error. It seems like a break in backwards compatibility in typing-extensions.

@JelleZijlstra
Copy link
Member

This was fixed in mypy recently (python/mypy#15543) but not released. Given that 3.7 has reached its end of life, we're not planning to fix this in typing-extensions.

@JelleZijlstra JelleZijlstra closed this as not planned Won't fix, can't repro, duplicate, stale Jul 2, 2023
@NiklasRosenstein
Copy link
Author

NiklasRosenstein commented Jul 2, 2023

Thanks for the fast response.

Could you tell me why typing-extension 4.7.0 is stilled tagged with requires-python = ">=3.7" then? Would it make sense to yank 4.7.0 and 4.7.1 and update that to >=3.8?

NiklasRosenstein added a commit to kraken-build/kraken that referenced this issue Jul 2, 2023
…g()` (#64)

* Remove `Property.config()`, add `Property.required()` and `Property.help`

* kraken-std/: improvement: Adjust task property definitions to replace `Property.config()` with `Property.default()` and `Property.default_factory()`

* Updated PR references in 1 changelogs.

skip-checks: true

* try Mypy 1.4.0

* Try Mypy <1.4.0

* use older typing-extensions

* fix pyperoject.toml

* Set upper constraint for typing-extensions due to python/typing_extensions#265

---------

Co-authored-by: GitHub Action <github-action@users.noreply.github.com>
@JelleZijlstra
Copy link
Member

typing-extensions 4.7 generally works fine with Python 3.7. It's broken only when using dmypy (not mypy itself, which apparently doesn't use any TypedDict), or potentially with other mypyc-compiled applications that use TypedDict. A relatively obscure case in a single third-party tool on a version that has reached end of life isn't enough to justify yanking the release.

NiklasRosenstein added a commit to NiklasRosenstein/python-databind that referenced this issue Aug 17, 2023
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