From b36d2388b1d25ddb351aebe4550f64951a6d1e26 Mon Sep 17 00:00:00 2001 From: Alex Wolf Date: Tue, 23 Jul 2024 23:23:21 +0200 Subject: [PATCH] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20to=20pydantic=20?= =?UTF-8?q?v2=20(#284)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nbproject/dev/_meta_store.py | 6 ++---- pyproject.toml | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nbproject/dev/_meta_store.py b/nbproject/dev/_meta_store.py index 34be956..008ff43 100644 --- a/nbproject/dev/_meta_store.py +++ b/nbproject/dev/_meta_store.py @@ -1,7 +1,7 @@ from pathlib import Path from typing import List, Mapping, Optional, Union -from pydantic import BaseModel, Extra +from pydantic import BaseModel, ConfigDict from nbproject._logger import logger @@ -61,9 +61,7 @@ class MetaContainer(BaseModel): """User ID from lamindb.""" user_name: Optional[str] = None """User name from lamindb.""" - - class Config: - extra = Extra.allow + model_config = ConfigDict(extra="allow") class MetaStore: diff --git a/pyproject.toml b/pyproject.toml index 4e26ef7..db26402 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", ] dependencies = [ - "pydantic<2.0.0", + "pydantic>=2.0.0", "pyyaml", "packaging", "orjson",