Skip to content

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

Closed as not planned

Description

@NiklasRosenstein

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.

Activity

  1. JelleZijlstra commented on Jul 2, 2023

    @JelleZijlstra
    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.

  2. NiklasRosenstein commented on Jul 2, 2023

    @NiklasRosenstein
    Author

    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?

  3. JelleZijlstra commented on Jul 2, 2023

    @JelleZijlstra
    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions