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

Pydantic 1.10.3 incompatible with typing-extensions 4.1.1 #4885

Closed
5 of 15 tasks
hsheth2 opened this issue Dec 29, 2022 · 15 comments
Closed
5 of 15 tasks

Pydantic 1.10.3 incompatible with typing-extensions 4.1.1 #4885

hsheth2 opened this issue Dec 29, 2022 · 15 comments
Labels
bug V1 Bug related to Pydantic V1.X

Comments

@hsheth2
Copy link

hsheth2 commented Dec 29, 2022

Initial Checks

  • I have searched GitHub for a duplicate issue and I'm sure this is something new
  • I have searched Google & StackOverflow for a solution and couldn't find anything
  • I have read and followed the docs and still think this is a bug
  • I am confident that the issue is with pydantic (not my code, or another library in the ecosystem like FastAPI or mypy)

Description

  • Installed latest pydantic and typing-extensions 4.1.1
  • Code crashes on import pydantic

I suspect we just need to bump the min version requirement or fix a cross-version incompatibility, since it works with typing-extensions 4.4.0.

Example Code

# Set up a clean venv
# pip install pydantic==1.10.3 typing-extensions==4.1.1

>>> import pydantic
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pydantic/__init__.py", line 2, in init pydantic.__init__
  File "pydantic/dataclasses.py", line 46, in init pydantic.dataclasses
    # | None    | Attribute is set to None.               |
  File "pydantic/main.py", line 121, in init pydantic.main
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'

Python, Pydantic & OS Version

Crashes so I can't run that

Tested with python 3.7.9

Affected Components

@hsheth2 hsheth2 added bug V1 Bug related to Pydantic V1.X unconfirmed Bug not yet confirmed as valid/applicable labels Dec 29, 2022
@samuelcolvin
Copy link
Member

Grrr, good catch, sorry I didn't see this before.

PR welcome to fix this.

@samuelcolvin
Copy link
Member

See #4886

@adrianeboyd
Copy link

On behalf of spacy-related packages: would it be possible for you to temporarily yank v1.10.3?

To address this and be compatible with v1.10.4, we'd have to release new versions of a whole series of packages and nearly everyone (including me) is currently on vacation. Even if v1.10.4 is released with a fix, pip would still back off to v1.10.3 for spacy, etc. because of its current pins for typing_extensions. If it could instead back off to v1.10.2, we'd have a bit more breathing room to make the updates on our end.

@samuelcolvin
Copy link
Member

I'll make a new release of v1.10.4 today, I think that's better.

Sorry again for the inconvenience.

@samuelcolvin
Copy link
Member

Humm, just read your message fully 🙈.

Okay, unless @hramezani or @PrettyWood have a problem, I'll yank v1.10.3.

Once that's done, do you have a problem with me releasing v1.10.4 with just this fixed?

@adrianeboyd
Copy link

Thanks for the quick response! I don't think that a v1.10.4 release with the updated requirements should cause any problems on our end (and would be used for python 3.8+).

@samuelcolvin
Copy link
Member

v1.10.3 has been yanked.

@samuelcolvin
Copy link
Member

v1.10.4 is building now.

@kjozef-work
Copy link

we do see the same error with 1.10.4 still
Downloading pydantic-1.10.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)

@samuelcolvin
Copy link
Member

Have you checked the content of that wheel (it's just a zip file)? It should be correct.

@kjozef-work
Copy link

apologize for not providing details - pydantic 1.10.4 fails still on python 3.8 with typing-extensions 4.1.1 , it passes though on python 3.7 with te-4.1.1

@samuelcolvin
Copy link
Member

Yes, that's why we changed the minimum allowed version in dependencies

'typing-extensions>=4.2.0'

Please review the release details.

@Hunterlige
Copy link

Hello,

The pydantic release on conda does not enforce typing-extensions>=4.2.0 and cause the same error:
TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers'
https://github.com/conda-forge/pydantic-feedstock/blob/main/recipe/meta.yaml#L30

@samuelcolvin
Copy link
Member

Thanks for reporting, I thought the bot auto updated that, apparently not.

I'll check tomorrow if I can update it without having to create another patch release.

@samuelcolvin
Copy link
Member

Hello,

The pydantic release on conda does not enforce typing-extensions>=4.2.0 and cause the same error: TypeError: dataclass_transform() got an unexpected keyword argument 'field_specifiers' https://github.com/conda-forge/pydantic-feedstock/blob/main/recipe/meta.yaml#L30

See conda-forge/pydantic-feedstock#73

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

No branches or pull requests

6 participants