tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
pydantic/pydantic-core mismatch
Upgrading synapse to 1.143.0 (on 9/2025Q3) results in an exception at
start, which is reproducible (NetBSD 10, pkgsrc HEAD):
$ python3.13
Python 3.13.10 (main, Dec 4 2025, 12:19:57) [GCC 10.5.0] on netbsd10
Type "help", "copyright", "credits" or "license" for more information.
>>> from pydantic import BaseModel
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
from pydantic import BaseModel
File "/usr/pkg/lib/python3.13/site-packages/pydantic/__init__.py", line 435, in __getattr__
module = import_module(module_name, package=package)
File "/usr/pkg/lib/python3.13/importlib/__init__.py", line 88, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/pkg/lib/python3.13/site-packages/pydantic/main.py", line 36, in <module>
from ._internal import (
...<11 lines>...
)
File "/usr/pkg/lib/python3.13/site-packages/pydantic/_internal/_decorators.py", line 18, in <module>
from ._core_utils import get_type_ref
File "/usr/pkg/lib/python3.13/site-packages/pydantic/_internal/_core_utils.py", line 9, in <module>
from pydantic_core import validate_core_schema as _validate_core_schema
ImportError: cannot import name 'validate_core_schema' from 'pydantic_core' (/usr/pkg/lib/python3.13/site-packages/pydantic_core/__init__.py)
The problem is pydantic, basically, in that while 2.11.7's pyproject.toml
says >= 2.33.1, apparently it really is "equal".
Running make test in py-pydantic fails immediately (well, after it
installs 26 test dependencies!):
===> Testing for py313-pydantic-2.11.7
/bin/rm -f /tmp/work/devel/py-pydantic/work/pydantic-2.11.7/tests/test_docs.py /tmp/work/devel/py-pydantic/work/pydantic-2.11.7/tests/test_pickle.py
ImportError while loading conftest '/tmp/work/devel/py-pydantic/work/pydantic-2.11.7/tests/conftest.py'.
tests/conftest.py:21: in <module>
from pydantic._internal._generate_schema import GenerateSchema
pydantic/_internal/_generate_schema.py:62: in <module>
from ..functional_validators import AfterValidator, BeforeValidator, FieldValidatorModes, PlainValidator, WrapValidator
pydantic/functional_validators.py:15: in <module>
from ._internal import _decorators, _generics, _internal_dataclass
pydantic/_internal/_decorators.py:18: in <module>
from ._core_utils import get_type_ref
pydantic/_internal/_core_utils.py:9: in <module>
from pydantic_core import validate_core_schema as _validate_core_schema
E ImportError: cannot import name 'validate_core_schema' from 'pydantic_core' (/usr/pkg/lib/python3.13/site-packages/pydantic_core/__init__.py)
*** Error code 4
My installed packages:
-rw-r--r-- 1 root wheel 2095 Oct 15 15:59 py313-pydantic-core-2.35.2
-rw-r--r-- 1 root wheel 39390 Oct 15 16:20 py313-pydantic-2.11.7
The upstream bug:
https://github.com/pydantic/pydantic/issues/12189
At this point I lean to:
downgrade pydantic-core to 1.33.2
because use of pydantic as is seems troubled for many users.
Downgrading is just changing the version and regenerating
distinfo/crates, as simple as it gets with rust.
Maya: ok to downgrade, or would you like another approach?
Post branch, we probably should upgrade pydantic and pydantic core both
to the latest (minding the dependency in pyproject.toml which is likely
more careful now).
Home |
Main Index |
Thread Index |
Old Index