diff --git a/.github/workflows/ci-integration.yml b/.github/workflows/ci-integration.yml index 36e1d380..9e5bf6ab 100644 --- a/.github/workflows/ci-integration.yml +++ b/.github/workflows/ci-integration.yml @@ -29,6 +29,9 @@ jobs: python-version: - "3.9" - "3.10" + pydantic-version: + - "1.10.17" + - "2" steps: - uses: actions/checkout@v2 @@ -39,6 +42,10 @@ jobs: create-args: >- python=${{ matrix.python-version }} + - name: Optionally install Pydantic 1 + if: ${{ matrix.pydantic-version == '1.10.17' }} + run: pip install "pydantic==1.10.17" + - name: "Install" run: python -m pip install --no-deps -e . @@ -49,7 +56,7 @@ jobs: - name: "Run tests" run: | - pytest -v --cov=alchemiscale --cov-report=xml alchemiscale/tests + pytest -v --cov=alchemiscale --cov-report=xml alchemiscale/tests --durations=20 -x - name: codecov if: ${{ github.repository == 'openforcefield/alchemiscale' diff --git a/alchemiscale/compute/settings.py b/alchemiscale/compute/settings.py index 87c80f97..4c4c7319 100644 --- a/alchemiscale/compute/settings.py +++ b/alchemiscale/compute/settings.py @@ -1,6 +1,6 @@ from pathlib import Path from typing import Union, Optional, List, Dict, Tuple -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from ..models import Scope, ScopedKey diff --git a/alchemiscale/models.py b/alchemiscale/models.py index 75edd1d0..98480431 100644 --- a/alchemiscale/models.py +++ b/alchemiscale/models.py @@ -5,7 +5,7 @@ """ from typing import Optional, Union -from pydantic import BaseModel, Field, validator, root_validator +from pydantic.v1 import BaseModel, Field, validator, root_validator from gufe.tokenization import GufeKey from re import fullmatch diff --git a/alchemiscale/security/auth.py b/alchemiscale/security/auth.py index f4782ea1..5a30405a 100644 --- a/alchemiscale/security/auth.py +++ b/alchemiscale/security/auth.py @@ -12,7 +12,7 @@ from fastapi.security import OAuth2PasswordBearer from jose import JWTError, jwt from passlib.context import CryptContext -from pydantic import BaseModel +from pydantic.v1 import BaseModel from .models import Token, TokenData, CredentialedEntity diff --git a/alchemiscale/security/models.py b/alchemiscale/security/models.py index 62f0395c..6935dae3 100644 --- a/alchemiscale/security/models.py +++ b/alchemiscale/security/models.py @@ -7,7 +7,7 @@ from datetime import datetime, timedelta from typing import List, Union, Optional -from pydantic import BaseModel, validator +from pydantic.v1 import BaseModel, validator from ..models import Scope diff --git a/alchemiscale/settings.py b/alchemiscale/settings.py index 951d27d9..c6c724a9 100644 --- a/alchemiscale/settings.py +++ b/alchemiscale/settings.py @@ -7,7 +7,7 @@ from functools import lru_cache from typing import Optional -from pydantic import BaseSettings +from pydantic.v1 import BaseSettings class FrozenSettings(BaseSettings): diff --git a/alchemiscale/storage/models.py b/alchemiscale/storage/models.py index c9b000b8..e0075e98 100644 --- a/alchemiscale/storage/models.py +++ b/alchemiscale/storage/models.py @@ -13,7 +13,7 @@ import hashlib -from pydantic import BaseModel, Field +from pydantic.v1 import BaseModel, Field from gufe.tokenization import GufeTokenizable, GufeKey from ..models import ScopedKey, Scope diff --git a/alchemiscale/tests/unit/test_base_api.py b/alchemiscale/tests/unit/test_base_api.py index 6ba55ba6..38d162ce 100644 --- a/alchemiscale/tests/unit/test_base_api.py +++ b/alchemiscale/tests/unit/test_base_api.py @@ -1,7 +1,7 @@ import pytest from fastapi import HTTPException -from pydantic import ValidationError +from pydantic.v1 import ValidationError from alchemiscale.base.api import validate_scopes, validate_scopes_query from alchemiscale.models import Scope, ScopedKey diff --git a/alchemiscale/tests/unit/test_models.py b/alchemiscale/tests/unit/test_models.py index c8285fbf..13e9f76d 100644 --- a/alchemiscale/tests/unit/test_models.py +++ b/alchemiscale/tests/unit/test_models.py @@ -1,6 +1,6 @@ import pytest -from pydantic import ValidationError +from pydantic.v1 import ValidationError from alchemiscale.models import Scope diff --git a/devtools/conda-envs/alchemiscale-client.yml b/devtools/conda-envs/alchemiscale-client.yml index 6f583986..aaa54f22 100644 --- a/devtools/conda-envs/alchemiscale-client.yml +++ b/devtools/conda-envs/alchemiscale-client.yml @@ -15,7 +15,7 @@ dependencies: - requests - click - httpx - - pydantic<2.0 + - pydantic>=1.10.17,<3.0 ## user client printing - rich diff --git a/devtools/conda-envs/alchemiscale-compute.yml b/devtools/conda-envs/alchemiscale-compute.yml index c0f371d2..ec865baf 100644 --- a/devtools/conda-envs/alchemiscale-compute.yml +++ b/devtools/conda-envs/alchemiscale-compute.yml @@ -15,7 +15,7 @@ dependencies: - requests - click - httpx - - pydantic<2.0 + - pydantic>=1.10.17,<3.0 # perses dependencies - openeye-toolkits diff --git a/devtools/conda-envs/alchemiscale-server.yml b/devtools/conda-envs/alchemiscale-server.yml index f8909d40..6193b2b1 100644 --- a/devtools/conda-envs/alchemiscale-server.yml +++ b/devtools/conda-envs/alchemiscale-server.yml @@ -15,7 +15,7 @@ dependencies: - openmmforcefields>=0.12.0 - requests - click - - pydantic<2.0 + - pydantic>=1.10.17,<3.0 ## state store - neo4j-python-driver diff --git a/devtools/conda-envs/test.yml b/devtools/conda-envs/test.yml index fdab69d7..d225cb54 100644 --- a/devtools/conda-envs/test.yml +++ b/devtools/conda-envs/test.yml @@ -10,7 +10,7 @@ dependencies: - gufe>=1.0.0 - openfe>=1.0.1 - openmmforcefields>=0.12.0 - - pydantic<2.0 + - pydantic=2 ## state store - neo4j-python-driver