Skip to content

Commit

Permalink
Merge pull request #251 from lsst/tickets/DM-39876
Browse files Browse the repository at this point in the history
DM-39876: Fallback to v1 API if pydantic v2 is installed
  • Loading branch information
timj authored Jul 5, 2023
2 parents 3a50dcc + 66160c3 commit 88183d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = [
"lsst-pipe-base",
"click",
"astropy",
"pydantic",
"pydantic <3.0",
"networkx",
"psutil"
]
Expand Down
6 changes: 5 additions & 1 deletion python/lsst/ctrl/mpexec/reports.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@

from lsst.daf.butler import DataCoordinate, DataId, DataIdValue
from lsst.utils.introspection import get_full_type_name
from pydantic import BaseModel, validator

try:
from pydantic.v1 import BaseModel, validator
except ModuleNotFoundError:
from pydantic import BaseModel, validator # type: ignore


def _serializeDataId(dataId: DataId) -> dict[str, DataIdValue]:
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
click
astropy
psutil
pydantic < 2
pydantic < 3.0
networkx
git+https://github.com/lsst/resources@main#egg=lsst-resources
git+https://github.com/lsst/daf_butler@main#egg=lsst-daf-butler
Expand Down

0 comments on commit 88183d3

Please sign in to comment.