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

typing_extensions minimum version should be at least 3.10.0.0 #11740

Closed
malerichc opened this issue Nov 3, 2022 · 3 comments · Fixed by #11741
Closed

typing_extensions minimum version should be at least 3.10.0.0 #11740

malerichc opened this issue Nov 3, 2022 · 3 comments · Fixed by #11741
Labels

Comments

@malerichc
Copy link

As of version 22.10.0, typing_extensions.ParamSpec is imported in several places:

src/twisted/internet/defer.py:from typing_extensions import Literal, ParamSpec, Protocol
src/twisted/internet/defer.py:_P = ParamSpec("_P")
src/twisted/trial/runner.py:from typing_extensions import ParamSpec, Protocol, TypeAlias, TypeGuard
src/twisted/trial/runner.py:_P = ParamSpec("_P")
src/twisted/trial/util.py:from typing_extensions import ParamSpec
src/twisted/trial/util.py:_P = ParamSpec("_P")

ParamSpec was introduced in typing_extensions 3.10.0.0 but setup.cfg still
lists typing_extensions 3.6.5 as a minimum version:

https://github.com/twisted/twisted/blob/twisted-22.10.0/setup.cfg#L36

I noticed this issue while trying to use Twisted 22.10.0 with typing_extensions 3.7.4. Here is a reproduction of the error:

$ python3.10 -m venv venv
$ ./venv/bin/pip install -q typing_extensions==3.7.4
$ ./venv/bin/pip install -q Twisted==22.10.0
$ ./venv/bin/python -c "from twisted.internet import defer"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/malerichc/venv/lib/python3.10/site-packages/twisted/internet/defer.py", line 42, in <module>
    from typing_extensions import Literal, ParamSpec, Protocol
ImportError: cannot import name 'ParamSpec' from 'typing_extensions' (/home/malerichc/venv/lib/python3.10/site-packages/typing_extensions.py)

`

@malerichc malerichc added the bug label Nov 3, 2022
@adiroiban
Copy link
Member

Many thanks for the report.

I think we have a similar issue with attrs >= 19.2.0

Would updating setup.cfg to a newer version work for you?

@malerichc
Copy link
Author

Yes of course.

@adiroiban
Copy link
Member

Your suggestion was applied here #11741

If you have time, please take a look.

I tried to update the minimum dependency, but at the same time create a CI check, to prevent introducing similar issues in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants