From 7cdbc7d2fd22c461aaec45a1bb2215fa5f4cfb0a Mon Sep 17 00:00:00 2001 From: Peter Kraus Date: Tue, 22 Aug 2023 10:29:35 +0200 Subject: [PATCH] Force pydantic 2.0 (#42) --- requirements.txt | 2 +- tasks.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index a6c6800..479a913 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,5 +3,5 @@ invoke linkml mongomock pre-commit -pydantic +pydantic~=2.0 uvicorn diff --git a/tasks.py b/tasks.py index d93f0b1..1400c5a 100644 --- a/tasks.py +++ b/tasks.py @@ -21,7 +21,7 @@ def regenerate_models(_): for schema in schemas: print(schema) schema_path = Path(schema) - gen = pd.PydanticGenerator(schema, verbose=True) + gen = pd.PydanticGenerator(schema, pydantic_version="2", verbose=True) output = gen.serialize() with open(MODEL_DIRECTORY / f"{schema_path.name.strip('.yml')}.py", "w") as f: f.writelines(output)