Repository navigation
permit sdk with pydantic v1 is incompatible with python 3.14 #124
Description
related: #45
pydantic has fully stopped development for v1, which itself is not an issue. however they've dropped any core existing functionality for python versions 3.14:
Pydantic V1 core functionality will not work properly with Python 3.14 or greater. As such, Python 3.13 is the latest supported Python version for V1.
this has caused any libraries still using v1 to crash on import, which is reported in various threads such as pydantic/pydantic#12363 .
this failure is also reproducible for the current permit sdk
❯ python3
Python 3.14.3 (main, Feb 3 2026, 15:32:20) [Clang 17.0.0 (clang-1700.6.3.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import permit
pydantic.v1.errors.ConfigError: unable to infer type for attribute "token"
❯ python3
Python 3.14.3 (main, Feb 3 2026, 15:32:20) [Clang 17.0.0 (clang-1700.6.3.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import permit
pydantic.v1.errors.ConfigError: unable to infer type for attribute "token"
❯ python3
Python 3.14.3 (main, Feb 3 2026, 15:32:20) [Clang 17.0.0 (clang-1700.6.3.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import permit
/Users/james/src/my-project/.venv/lib/python3.14/site-packages/permit/api/models.py:17: UserWarning: Core Pydantic V1 functionality isn't compatible with Python 3.14 or greater.
from pydantic.v1 import AnyUrl, BaseModel, EmailStr, Extra, Field, conint, constr # type: ignore
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
import permit
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/permit/__init__.py", line 3, in <module>
from .config import PermitConfig
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/permit/config.py", line 38, in <module>
class PermitConfig(BaseModel):
...<38 lines>...
arbitrary_types_allowed = True
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/pydantic/v1/main.py", line 221, in __new__
inferred = ModelField.infer(
name=var_name,
...<3 lines>...
config=config,
)
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 504, in infer
return cls(
name=name,
...<7 lines>...
field_info=field_info,
)
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 434, in __init__
self.prepare()
~~~~~~~~~~~~^^
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 544, in prepare
self._set_default_and_type()
~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/Users/james/src/my-project/.venv/lib/python3.14/site-packages/pydantic/v1/fields.py", line 576, in _set_default_and_type
raise errors_.ConfigError(f'unable to infer type for attribute "{self.name}"')
pydantic.v1.errors.ConfigError: unable to infer type for attribute "token"
we want to be on latest supported python (3.14) with our web app, so i think we'll be falling back to httpx with our permit calls in the meantime. sorry for raising this issue without making a proposed PR to fix the core underlying issue. i'm not sure now critical v1 is to the sdk's dependencies.
perhaps, in the meantime, add a pydantic <= 2.11.0 upper bound to the requirements?
Activity
orweis commentedon Feb 13, 2026
Thanks for reaching out and raising awareness.
We have an open ticket to address this; no clear timeline as of yet.
zeevmoney commentedon Sep 28, 2026
Thanks @jameswu1991 for the clear report and traceback, and sorry it took a while to close the loop.
The crash came from the pydantic v1 engine: on Python 3.14 it could not read class annotations. pydantic has since fixed that upstream, in pydantic 1.10.25 and in pydantic 2.13, whose
pydantic.v1is 1.10.26. #126, now merged to main and shipping in permit 3.0.0, builds on that:pydantic>=1.10.25,<2orpydantic>=2.13, so resolvers can no longer pick a version that crashes atimport permit.If you're on permit 2.x and can't upgrade yet, upgrading pydantic to
>=2.13(or>=1.10.25,<2) fixes it; we verified that with permit 2.8.3 on 3.14. One note on the workaround in the issue: capping pydantic at<=2.11doesn't help on 3.14, because those releases have no 3.14 builds.Please reopen if you still see it after upgrading.