Skip to content

Commit

Permalink
test on pydantic 2
Browse files Browse the repository at this point in the history
try with interchange-rc label packages

unpin other openff deps

actually order channels correctly

remove interchange-rc channel

Revert toolkit change

Just use Pydantic v1 API, test both versions
  • Loading branch information
j-wags authored and mattwthompson committed Sep 9, 2024
1 parent 9176d73 commit 45c788c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
matrix:
os: [ubuntu-latest, macOS-latest]
python-version: ["3.10", "3.11"]
pydantic-version: ["1"]
pydantic-version: ["1", "2"]
openeye: [true, false]
integration: [true]

Expand Down
26 changes: 4 additions & 22 deletions openff/bespokefit/_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

import numpy

try:
from pydantic.v1 import BaseModel as PydanticBaseModel
from pydantic.v1 import (
from pydantic.v1 import BaseModel as PydanticBaseModel
from pydantic.v1 import (
BaseSettings,
Extra,
Field,
Expand All @@ -17,25 +16,8 @@
parse_obj_as,
parse_raw_as,
validator,
)
from pydantic.v1.generics import GenericModel
except ImportError:
from pydantic import BaseModel as PydanticBaseModel
from pydantic import ( # noqa
BaseSettings,
Extra,
Field,
PositiveFloat,
PositiveInt,
ValidationError,
conint,
conlist,
parse_file_as,
parse_obj_as,
parse_raw_as,
validator,
)
from pydantic.generics import GenericModel # noqa
)
from pydantic.v1.generics import GenericModel


class BaseModel(PydanticBaseModel):
Expand Down

0 comments on commit 45c788c

Please sign in to comment.