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

cattrs ==23.1.1 depends on typing_extensions >4 #372

Closed
jvesely opened this issue Jun 1, 2023 · 4 comments
Closed

cattrs ==23.1.1 depends on typing_extensions >4 #372

jvesely opened this issue Jun 1, 2023 · 4 comments

Comments

@jvesely
Copy link

jvesely commented Jun 1, 2023

  • cattrs version: 23.1.1
  • Python version: python3.7
  • Operating System: linux

Description

cattrs dependency on typing_extensions doesn't indicate the minimum version needed:
Requires-Dist: typing_extensions; python_version < "3.8"

What I Did

$ python3.7 -mvenv test-venv
$ source test-venv/bin/activate
$ pip install cattrs==23.1.1 'typing_extensions<4'
$ python -c 'import cattrs'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/root/test-venv/lib/python3.7/site-packages/cattrs/__init__.py", line 1, in <module>
    from .converters import BaseConverter, Converter, GenConverter, UnstructureStrategy
  File "/root/test-venv/lib/python3.7/site-packages/cattrs/converters.py", line 26, in <module>
    from ._compat import (
  File "/root/test-venv/lib/python3.7/site-packages/cattrs/_compat.py", line 177, in <module>
    from typing_extensions import Annotated, NotRequired, Required
ImportError: cannot import name 'NotRequired' from 'typing_extensions' (/root/test-venv/lib/python3.7/site-packages/typing_extensions.py)

cattr==22.2.0 works ok. allowing typing_extensions >=4 also works around the problem

@Tinche
Copy link
Member

Tinche commented Jun 1, 2023

Right you are, but I think is already fixed on main. Can you verify?

@jvesely
Copy link
Author

jvesely commented Jun 1, 2023

Right you are, but I think is already fixed on main. Can you verify?

right! looks like 0cb1872 added the lower bound. Any plans for a release with his fix?

jvesely added a commit to PrincetonUniversity/PsyNeuLink that referenced this issue Jun 1, 2023
@jvesely jvesely changed the title cattrs >=23.1.1 depends on typing_extensions >4 cattrs ==23.1.1 depends on typing_extensions >4 Jun 2, 2023
@Tinche
Copy link
Member

Tinche commented Jun 2, 2023

I published 23.1.2 with the fix, let me know!

@Tinche Tinche closed this as completed Jun 2, 2023
@jvesely
Copy link
Author

jvesely commented Jun 2, 2023

looks like it worked:

root@60246eb5a736:~# python3.7 -m venv test-venv
root@60246eb5a736:~# source test-venv/bin/activate
(test-venv) root@60246eb5a736:~# pip install -U pip
Cache entry deserialization failed, entry ignored
Collecting pip
  Using cached https://files.pythonhosted.org/packages/08/e3/57d4c24a050aa0bcca46b2920bff40847db79535dc78141eb83581a52eb8/pip-23.1.2-py3-none-any.whl
Installing collected packages: pip
  Found existing installation: pip 9.0.1
    Uninstalling pip-9.0.1:
      Successfully uninstalled pip-9.0.1
Successfully installed pip-23.1.2
(test-venv) root@60246eb5a736:~# pip install cattrs 'typing_extensions<4'
Collecting cattrs
  Using cached cattrs-23.1.2-py3-none-any.whl (50 kB)
Collecting typing_extensions<4
  Using cached typing_extensions-3.10.0.2-py3-none-any.whl (26 kB)
Collecting attrs>=20 (from cattrs)
  Using cached attrs-23.1.0-py3-none-any.whl (61 kB)
Collecting exceptiongroup (from cattrs)
  Using cached exceptiongroup-1.1.1-py3-none-any.whl (14 kB)
INFO: pip is looking at multiple versions of cattrs to determine which version is compatible with other requirements. This could take a while.
Collecting cattrs
  Using cached cattrs-23.1.1-py3-none-any.whl (50 kB)
Collecting importlib-metadata (from attrs>=20->cattrs)
  Using cached importlib_metadata-6.6.0-py3-none-any.whl (22 kB)
Collecting zipp>=0.5 (from importlib-metadata->attrs>=20->cattrs)
  Using cached zipp-3.15.0-py3-none-any.whl (6.8 kB)
Installing collected packages: typing_extensions, zipp, exceptiongroup, importlib-metadata, attrs, cattrs
Successfully installed attrs-23.1.0 cattrs-23.1.1 exceptiongroup-1.1.1 importlib-metadata-6.6.0 typing_extensions-3.10.0.2 zipp-3.15.0

pip falls back to 23.1.1.

thank you

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