dapper91 / pydantic-xml

python xml for humans
https://pydantic-xml.readthedocs.io
The Unlicense
141 stars 14 forks source link

AttributeError: module 'pydantic_core' has no attribute 'TuplePositionalSchema' #167

Closed maurosilber closed 5 months ago

maurosilber commented 5 months ago

Installing and running pydantic-xml on a new environment raises this error:

.../lib/python3.10/site-packages/pydantic_xml/serializers/factories/heterogeneous.py:14: in ElementSerializer
    def from_core_schema(cls, schema: pcs.TuplePositionalSchema, ctx: Serializer.Context) -> 'ElementSerializer':
.../lib/python3.10/site-packages/pydantic_core/core_schema.py:3974: in __getattr__
    raise AttributeError(f"module 'pydantic_core' has no attribute '{attr_name}'")
E   AttributeError: module 'pydantic_core' has no attribute 'TuplePositionalSchema'. Did you mean: 'tuple_positional_schema'?

They seem to have removed that class in this commit: https://github.com/pydantic/pydantic-core/commit/4df7624c12b57dc47fe1de72acb2795c1631dbb9

It works with pydantic_core < 2.16 and pedantic < 2.6.

gizmo84 commented 5 months ago

Same here since the release of pydantic 2.6.0

dapper91 commented 5 months ago

fixed in version 2.9.0