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

ConstrainedStr gone in pydantic v2 #17

Closed
ibz opened this issue Jul 3, 2023 · 1 comment
Closed

ConstrainedStr gone in pydantic v2 #17

ibz opened this issue Jul 3, 2023 · 1 comment

Comments

@ibz
Copy link

ibz commented Jul 3, 2023

This library fails to work with pydantic v2, since ConstrainedStr was removed https://docs.pydantic.dev/dev-v2/migration/#removed-in-pydantic-v2

As a workaround, I have locked my pydantic to 1.10.4 in my requirements.txt.

Looking for a way to solve the issue - change InitializationVector and Max144Str in types.py to use constr https://docs.pydantic.dev/latest/usage/types/#arguments-to-constr would probably be the way, but I don't immediately see how, since the old way used to rely on inheritance. Maybe somebody more familiar with pydantic could give me a hint.

@dni
Copy link
Member

dni commented Jul 5, 2023

hi! thanks, i just fixed it! by locking to v1

@dni dni closed this as completed Jul 5, 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