Skip to content

Commit

Permalink
Merge branch 'main' into testing-aws-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mikemhenry authored Aug 9, 2024
2 parents 1114298 + 27c9116 commit a02e729
Show file tree
Hide file tree
Showing 10 changed files with 77 additions and 78 deletions.
11 changes: 2 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jobs:
- "3.11"
- "3.12"
openeye: ["no"]
ommff-version: [">0.13"]
include:
- os: "macos-12"
python-version: "3.12"
Expand All @@ -53,11 +52,6 @@ jobs:
python-version: "3.11"
pydantic-version: ">1"
openeye: "yes"
- os: "ubuntu-latest"
python-version: "3.10"
pydantic-version: ">1"
openeye: "no"
ommff-version: "0.13"
- os: "macos-latest"
python-version: "3.12"
pydantic-version: ">1"
Expand Down Expand Up @@ -88,7 +82,6 @@ jobs:
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantic-version }}
openmmforcefields=${{ matrix.ommff-version }}
init-shell: bash

- name: "Install OpenEye"
Expand Down Expand Up @@ -129,7 +122,7 @@ jobs:
- name: codecov-pr
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand All @@ -144,7 +137,7 @@ jobs:
if: ${{ github.repository == 'OpenFreeEnergy/openfe'
&& github.event_name != 'schedule'
&& github.event_name != 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/conda_cron.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: "conda_cron"
on:
workflow_dispatch:
schedule:
# At 07:00 UTC every day
- cron: "0 7 * * *"

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

defaults:
run:
shell: bash -leo pipefail {0}

jobs:
condacheck:
runs-on: ${{ matrix.OS }}
name: "daily conda check"
strategy:
fail-fast: false
matrix:
os: ['ubuntu-latest', 'macos-latest', 'macos-12']
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
exclude:
- os: 'macos-latest'
python-version: '3.9'

steps:
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-name: openfe
create-args: >-
python=${{ matrix.python-version }}
pip
jq
condarc: |
channels:
- jaimergp/label/unsupported-cudatoolkit-shim
- conda-forge
init-shell: bash

- name: "Install openfe + optional deps"
run: |
# get latest version from conda-forge
LATEST_VERSION=$(micromamba search --json openfe | jq '.result.pkgs[0].version')
echo "LATEST_VERSION: $LATEST_VERSION"
# Removing the quotes from the vesrion number
# https://mywiki.wooledge.org/BashGuide/Parameters#Parameter_Expansion
micromamba install openfe=${LATEST_VERSION//\"} pytest -c conda-forge
python -m pip install pytest-xdist
- name: "env info"
run: |
micromamba info
micromamba list
pip list
- id: run-tests
name: "Run tests"
run: |
# note: this only runs the fast tests
pytest -n auto --pyargs openfe openfecli
2 changes: 1 addition & 1 deletion docs/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies:
- sphinx-toolbox
- sphinx<7
- git+https://github.com/OpenFreeEnergy/gufe@main
- git+https://github.com/OpenFreeEnergy/ofe-sphinx-theme@main
- git+https://github.com/OpenFreeEnergy/ofe-sphinx-theme@a45f3edd5bc3e973c1a01b577c71efa1b62a65d6

# These are added automatically by RTD, so we include them here
# for a consistent environment.
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dependencies:
- pytest-xdist
- pytest-cov
- pytest-rerunfailures
- pydantic >1
- pydantic >=1.10.17
- pyyaml
- coverage
- cinnabar ~=0.4.0
Expand Down
5 changes: 1 addition & 4 deletions openfe/protocols/openmm_afe/equil_afe_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,7 @@
)
import numpy as np

try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator # type: ignore[assignment]
from pydantic.v1 import validator


class AlchemicalSettings(SettingsBaseModel):
Expand Down
5 changes: 1 addition & 4 deletions openfe/protocols/openmm_md/plain_md_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
SettingsBaseModel,
OpenMMSystemGeneratorFFSettings
)
try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator # type: ignore[assignment]
from pydantic.v1 import validator


class PlainMDProtocolSettings(Settings):
Expand Down
5 changes: 1 addition & 4 deletions openfe/protocols/openmm_rfe/equil_rfe_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@
OpenFFPartialChargeSettings,
)

try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator # type: ignore[assignment]
from pydantic.v1 import validator


class LambdaSettings(SettingsBaseModel):
Expand Down
5 changes: 1 addition & 4 deletions openfe/protocols/openmm_utils/omm_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
)


try:
from pydantic.v1 import validator
except ImportError:
from pydantic import validator # type: ignore[assignment]
from pydantic.v1 import validator


class BaseSolvationSettings(SettingsBaseModel):
Expand Down
27 changes: 1 addition & 26 deletions openfe/tests/protocols/test_openmm_equil_rfe_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,32 +244,7 @@ def test_dry_run_gaff_vacuum(benzene_vacuum_system, toluene_vacuum_system,
mapping=benzene_to_toluene_mapping,
)
unit = list(dag.protocol_units)[0]

# If we do a lot of GAFF testing, this should be refactored so we don't
# have to copy it all over the place.
# https://github.com/OpenFreeEnergy/openfe/pull/847#issuecomment-2096810453


import openmmforcefields
from packaging import version

ommff_version = openmmforcefields.__version__

gaff_should_fail = version.parse(
ommff_version
) == version.parse("0.13.0")

if gaff_should_fail:
from openmmforcefields.generators.template_generators import (
GAFFNotSupportedError,
)

with pytest.raises(GAFFNotSupportedError):
with tmpdir.as_cwd():
sampler = unit.run(dry=True)["debug"]["sampler"]
else:
with tmpdir.as_cwd():
sampler = unit.run(dry=True)["debug"]["sampler"]
sampler = unit.run(dry=True)["debug"]["sampler"]


@pytest.mark.slow
Expand Down
26 changes: 1 addition & 25 deletions openfe/tests/protocols/test_openmm_plain_md_protocols.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,31 +176,7 @@ def test_dry_run_gaff_vacuum(benzene_vacuum_system, tmpdir):
mapping=None,
)
unit = list(dag.protocol_units)[0]

# If we do a lot of GAFF testing, this should be refactored so we don't
# have to copy it all over the place.
# https://github.com/OpenFreeEnergy/openfe/pull/847#issuecomment-2096810453

import openmmforcefields
from packaging import version

ommff_version = openmmforcefields.__version__

gaff_should_fail = version.parse(
ommff_version
) == version.parse("0.13.0")

if gaff_should_fail:
from openmmforcefields.generators.template_generators import (
GAFFNotSupportedError,
)

with pytest.raises(GAFFNotSupportedError):
with tmpdir.as_cwd():
system = unit.run(dry=True)["debug"]["system"]
else:
with tmpdir.as_cwd():
system = unit.run(dry=True)["debug"]["system"]
system = unit.run(dry=True)["debug"]["system"]


@pytest.mark.parametrize('method, backend, ref_key', [
Expand Down

0 comments on commit a02e729

Please sign in to comment.