lnbits / lnurl

LNURL implementation for Python.
https://pypi.org/project/lnurl
MIT License
64 stars 19 forks source link

ConstrainedStr gone in pydantic v2 #17

Closed ibz closed 1 year ago

ibz commented 1 year ago

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 commented 1 year ago

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