Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Pydantic v1 from v2 backdoor #281

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
python-version:
- "3.9"
- "3.10"
pydantic-version:
- "1.10.17"
- "2"

steps:
- uses: actions/checkout@v2
Expand All @@ -38,6 +41,7 @@ jobs:
environment-file: devtools/conda-envs/test.yml
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantci-version }}
j-wags marked this conversation as resolved.
Show resolved Hide resolved

- name: "Install"
run: python -m pip install --no-deps -e .
Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/compute/settings.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/security/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/security/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/storage/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/tests/unit/test_base_api.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion alchemiscale/tests/unit/test_models.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import pytest

from pydantic import ValidationError
from pydantic.v1 import ValidationError

from alchemiscale.models import Scope

Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/alchemiscale-client.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- requests
- click
- httpx
- pydantic<2.0
- pydantic>=1.10.17,<3.0

## user client printing
- rich
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/alchemiscale-compute.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- requests
- click
- httpx
- pydantic<2.0
- pydantic>=1.10.17,<3.0

# perses dependencies
- openeye-toolkits
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/alchemiscale-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dependencies:
- gufe>=1.0.0
- openfe>=1.0.1
- openmmforcefields>=0.12.0
- pydantic<2.0
- pydantic>=1.10.17,<3.0

## state store
- neo4j-python-driver
Expand Down
Loading