Skip to content

Commit

Permalink
Force v1 pydantic API if running v2
Browse files Browse the repository at this point in the history
  • Loading branch information
timj committed Jul 3, 2023
1 parent 806fb6d commit 958c90c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
6 changes: 5 additions & 1 deletion python/lsst/pipe/base/_task_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,11 @@
from collections.abc import Collection, Iterator, Mapping, Sequence
from typing import Any, Protocol

from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
try:
from pydantic.v1 import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr
except ModuleNotFoundError:
from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr


_DEPRECATION_REASON = "Will be removed after v25."
_DEPRECATION_VERSION = "v24"
Expand Down
6 changes: 5 additions & 1 deletion python/lsst/pipe/base/graph/quantumNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
Quantum,
SerializedQuantum,
)
from pydantic import BaseModel

try:
from pydantic.v1 import BaseModel
except ModuleNotFoundError:
from pydantic import BaseModel

from ..pipeline import TaskDef

Expand Down
5 changes: 4 additions & 1 deletion python/lsst/pipe/base/tests/mocks/_storage_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@
from collections.abc import Callable, Iterable, Mapping
from typing import Any, cast

import pydantic
try:
import pydantic.v1 as pydantic
except ModuleNotFoundError:
import pydantic
from lsst.daf.butler import (
DatasetComponent,
Formatter,
Expand Down

0 comments on commit 958c90c

Please sign in to comment.