Open sla-te opened 1 year ago
I have tried to bump pydantic to >= 2 in #76 but am unsure whether my changes are correct. Please review!
We're currently doing rebuilds against pydantic >= 2 on Arch Linux and this project is one of the blockers for the TODO.
This is my lazy, quick & dirty temporary solution for Debian.
Forwarded: no
--- a/itemadapter/_imports.py
+++ b/itemadapter/_imports.py
@@ -23,6 +23,6 @@
attr = None # type: ignore [assignment]
try:
- import pydantic # pylint: disable=W0611 (unused-import)
+ import pydantic.v1 as pydantic # pylint: disable=W0611 (unused-import)
except ImportError:
pydantic = None # type: ignore [assignment]
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -102,7 +102,7 @@
try:
- from pydantic import BaseModel, Field as PydanticField
+ from pydantic.v1 import BaseModel, Field as PydanticField
except ImportError:
PydanticModel = None
PydanticSpecialCasesModel = None
Since release of Pydantic 2, the implementation is broken due to massive restructs.