diff --git a/menuinst/_schema.py b/menuinst/_schema.py index 522c6ef6..41e13799 100644 --- a/menuinst/_schema.py +++ b/menuinst/_schema.py @@ -10,8 +10,14 @@ from pprint import pprint from typing import Dict, List, Literal, Optional, Union -from pydantic import BaseModel as _BaseModel -from pydantic import Field, conlist, constr +try: + from pydantic.v1 import BaseModel as _BaseModel + from pydantic.v1 import Field, conlist, constr +except ImportError: + # pydantic v1 + from pydantic import BaseModel as _BaseModel + from pydantic import Field, conlist, constr + log = getLogger(__name__) diff --git a/recipe/meta.yaml b/recipe/meta.yaml index d36db425..e2c8b621 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -38,7 +38,7 @@ test: - conda - pytest - pytest-cov - - pydantic <2.0a0 + - pydantic - hypothesis - hypothesis-jsonschema source_files: diff --git a/tests/requirements.txt b/tests/requirements.txt index 5b82fa09..069186a1 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,7 +1,7 @@ python pip conda -pydantic<2.0a0 +pydantic pytest pytest-cov hypothesis