Skip to content

Commit

Permalink
test pydantic v2 (#541)
Browse files Browse the repository at this point in the history
* test pydantic v2

* fix issues with mypy

* add one job that does only pydantic

* dumb hack

* see how bad this looks, might just need to use an if statement

* forgot it needs to be an array

* playing around with ci job names

* why not emoji (V) (°,,,,°) (V)

* forgot a pydantic version number

* I think the -> looks too much like an arrow
  • Loading branch information
mikemhenry authored Sep 1, 2023
1 parent 754ce7b commit 6f91cbc
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,24 @@ defaults:

jobs:
tests:
runs-on: ${{ matrix.OS }}-latest
name: "tests"
runs-on: ${{ matrix.os }}-latest
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} 🗃️${{ matrix.pydantic-version }}"
strategy:
fail-fast: false
matrix:
os: ['ubuntu']
os: ["ubuntu"]
pydantic-version: [">1"]
python-version:
- "3.9"
- "3.10"
- "3.11"
include:
- os: 'macos'
- os: "macos"
python-version: "3.11"
pydantic-version: ">1"
- os: "ubuntu"
python-version: "3.11"
pydantic-version: "<2"

steps:
- uses: actions/checkout@v3
Expand All @@ -52,6 +57,7 @@ jobs:
cache-downloads: true
extra-specs: |
python==${{ matrix.python-version }}
pydantic=${{ matrix.pydantic-version }}
- name: "Install GUFE from main@HEAD"
run: python -m pip install --no-deps git+https://github.com/OpenFreeEnergy/gufe@main
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ dependencies:
- pytest-xdist
- pytest-cov
- pytest-rerunfailures
- pydantic <2
- pydantic >1
- coverage
- cinnabar ==0.3.0
- openff-toolkit>=0.13.0
Expand Down
2 changes: 1 addition & 1 deletion openfe/protocols/openmm_rfe/equil_rfe_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator
from pydantic import validator # type: ignore[assignment]


class AlchemicalSettings(SettingsBaseModel):
Expand Down
2 changes: 1 addition & 1 deletion openfe/protocols/openmm_utils/omm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator
from pydantic import validator # type: ignore[assignment]

class SystemSettings(SettingsBaseModel):
"""Settings describing the simulation system settings."""
Expand Down

0 comments on commit 6f91cbc

Please sign in to comment.