Skip to content

Commit 94c1ad1

Browse files
Merge pull request #1104 from openforcefield/consolidate-config
Consolidate Python config files
2 parents 78460a1 + 734613f commit 94c1ad1

File tree

20 files changed

+129
-173
lines changed

20 files changed

+129
-173
lines changed

.codecov.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/workflows/beta.yaml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828

2929
env:
3030
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
31-
COV: --cov=openff/interchange --cov-report=xml --cov-config=setup.cfg --cov-append
3231

3332
steps:
3433
- uses: actions/checkout@v4
@@ -52,9 +51,7 @@ jobs:
5251
python=${{ matrix.python-version }}
5352
5453
- name: Install package
55-
run: |
56-
micromamba remove --force openff-interchange openff-interchange-base
57-
python -m pip install . plugins/
54+
run: python -m pip install . plugins/
5855

5956
- name: Install and license OpenEye Toolkits
6057
if: ${{ matrix.openeye == true }}
@@ -71,7 +68,7 @@ jobs:
7168

7269
- name: Run all tests
7370
if: always()
74-
run: python -m pytest -v $COV openff/interchange/
71+
run: python -m pytest -v openff/interchange/
7572

7673
- name: Codecov
7774
uses: codecov/codecov-action@v5

.github/workflows/ci.yaml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ jobs:
2020
name: Test on ${{ matrix.os }}, Python ${{ matrix.python-version }}, OpenMM ${{ matrix.openmm }}, OpenEye ${{ matrix.openeye }}
2121
runs-on: ${{ matrix.os }}
2222
strategy:
23-
fail-fast: false
2423
matrix:
2524
os:
2625
- macos-latest
@@ -33,11 +32,10 @@ jobs:
3332
- false
3433
openmm:
3534
- true
36-
- false
3735

3836
env:
3937
OE_LICENSE: ${{ github.workspace }}/oe_license.txt
40-
COV: --cov=openff/interchange --cov-report=xml --cov-config=setup.cfg --cov-append
38+
COV: --cov=openff/interchange --cov-report=xml --cov-config=pyproject.toml --cov-append
4139

4240
steps:
4341
- uses: actions/checkout@v4
@@ -52,11 +50,7 @@ jobs:
5250
python=${{ matrix.python-version }}
5351
5452
- name: Install package
55-
run: |
56-
# These packages are brought in by conda (via the toolkit) and must be removed manually
57-
# since pip doesn't know about the -base split and does not uninstall the -base package
58-
micromamba remove --force openff-interchange openff-interchange-base
59-
python -m pip install . plugins/
53+
run: python -m pip install . plugins/
6054

6155
- name: Install and license OpenEye Toolkits
6256
if: ${{ matrix.openeye == true }}
@@ -85,9 +79,6 @@ jobs:
8579
# and also uninstalls RDKit
8680
run: micromamba install rdkit "ambertools =23" "lammps >=2023.08.02" "jax >=0.3" "jaxlib >=0.3" -c conda-forge
8781

88-
- name: Install Foyer
89-
run: micromamba install "foyer >=0.12.1" -c conda-forge -yq
90-
9182
- name: Run tests
9283
run: python -m pytest $COV openff/interchange/ -r fExs -n logical --durations=10
9384

.github/workflows/examples.yaml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ defaults:
1717

1818
jobs:
1919
test:
20+
name: Examples on ${{ matrix.os }}, Python ${{ matrix.python-version }}
2021
runs-on: ${{ matrix.os }}
2122
strategy:
22-
fail-fast: false
2323
matrix:
2424
os:
2525
- ubuntu-latest
@@ -45,8 +45,7 @@ jobs:
4545
python=${{ matrix.python-version }}
4646
4747
- name: Install package
48-
run: |
49-
python -m pip install .
48+
run: python -m pip install .
5049

5150
- name: License OpenEye
5251
run: |
@@ -56,12 +55,10 @@ jobs:
5655
SECRET_OE_LICENSE: ${{ secrets.OE_LICENSE }}
5756

5857
- name: Run docexamples
59-
run: |
60-
python -m pytest --doctest-modules openff/interchange/ --ignore=openff/interchange/_tests
58+
run: python -m pytest -c /dev/null/ --doctest-modules openff/interchange/ --ignore=openff/interchange/_tests
6159

6260
- name: Run example notebooks
63-
if: always()
6461
run: |
65-
python -m pytest --nbval-lax --dist loadscope -n logical --durations=20 examples/ \
62+
python -m pytest -c /dev/null/ --nbval-lax --dist loadscope -n logical --durations=20 examples/ \
6663
--ignore=examples/deprecated/ \
6764
--ignore=examples/experimental

devtools/conda-envs/examples_env.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ dependencies:
1515
# Optional features
1616
- openff-nagl ~=0.5
1717
- openff-nagl-models ~=0.3
18-
- mbuild ~=0.18
19-
- foyer =1
20-
- gmso ~=0.12
18+
- mbuild
19+
- foyer
2120
- nglview
2221
# Drivers
2322
- gromacs

devtools/conda-envs/test_env.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ dependencies:
2121
- openff-nagl-models ~=0.3
2222
- mbuild =1
2323
- foyer =1
24-
- gmso ~=0.12
2524
- nglview
2625
# Drivers
2726
- gromacs

docs/developing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Style is enforced with automated linters that run in CI. See `.github/workflows/
2424

2525
### Type-checking
2626

27-
Type hints are **optional** but encouraged. Many optional flags are passed to `mypy`; check the action for a recommended invocation. Check `setup.cfg` for some configuration, mostly ignoring libraries that do not have support for type-checking.
27+
Type hints are **optional** but encouraged. Many optional flags are passed to `mypy`; check the action for a recommended invocation. Check `pyproject.toml` for some configuration, mostly ignoring libraries that do not have support for type-checking.
2828

2929
### Pre-commit
3030

openff/interchange/_tests/energy_tests/test_energies.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
)
1515
from openff.interchange.constants import kj_mol
1616
from openff.interchange.drivers import get_openmm_energies
17+
from openff.interchange.foyer._guard import has_foyer
1718

1819
if has_package("openmm"):
1920
import openmm
@@ -31,7 +32,7 @@
3132
from openff.interchange.drivers.lammps import get_lammps_energies
3233

3334

34-
@skip_if_missing("foyer")
35+
@pytest.mark.skipif(not has_foyer, reason="Foyer is not installed")
3536
class TestEnergies:
3637
@pytest.fixture(scope="session")
3738
def oplsaa(self):
@@ -99,7 +100,7 @@ def test_energies_single_mol(self, constrained, sage, sage_unconstrained, mol_sm
99100
lmp_energies.compare(other_energies, tolerances)
100101

101102
@needs_gmx
102-
@skip_if_missing("foyer")
103+
@pytest.mark.skipif(not has_foyer, reason="Foyer is not installed")
103104
@skip_if_missing("mbuild")
104105
def test_process_rb_torsions(self, oplsaa):
105106
"""Test that the GROMACS driver reports Ryckaert-Bellemans torsions"""

openff/interchange/_tests/unit_tests/components/test_foyer.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,17 @@
44
import parmed as pmd
55
import pytest
66
from openff.toolkit import Molecule, Topology, unit
7-
from openff.utilities.testing import has_package, skip_if_missing
7+
from openff.utilities.testing import skip_if_missing
88

99
from openff.interchange import Interchange
1010
from openff.interchange._tests import HAS_GROMACS, get_test_files_dir_path, needs_gmx
1111
from openff.interchange.components.potentials import Potential
1212
from openff.interchange.constants import kj_mol
1313
from openff.interchange.drivers import get_openmm_energies
14+
from openff.interchange.foyer._guard import has_foyer
1415
from openff.interchange.models import PotentialKey, TopologyKey
1516

16-
if has_package("foyer"):
17+
if has_foyer:
1718
import foyer
1819

1920
from openff.interchange.foyer._valence import _RBTorsionHandler
@@ -27,13 +28,13 @@
2728
)
2829

2930

30-
@skip_if_missing("foyer")
31+
@pytest.mark.skipif(not has_foyer, reason="Foyer is not installed")
3132
class TestFoyer:
32-
@pytest.fixture(scope="session")
33+
@pytest.fixture
3334
def oplsaa(self):
3435
return foyer.forcefields.load_OPLSAA()
3536

36-
@pytest.fixture(scope="session")
37+
@pytest.fixture
3738
def oplsaa_interchange_ethanol(self, oplsaa):
3839
molecule = Molecule.from_file(
3940
get_test_files_dir_path("foyer_test_molecules") / "ethanol.sdf",
@@ -47,7 +48,7 @@ def oplsaa_interchange_ethanol(self, oplsaa):
4748
interchange.box = [4, 4, 4]
4849
return interchange
4950

50-
@pytest.fixture(scope="session")
51+
@pytest.fixture
5152
def get_interchanges(self, oplsaa):
5253
def interchanges_from_path(molecule_path):
5354
molecule_or_molecules = Molecule.from_file(molecule_path)
@@ -150,7 +151,6 @@ def test_interchange_energies(self, molecule_path, get_interchanges, oplsaa):
150151
)
151152

152153

153-
@skip_if_missing("foyer")
154154
class TestRBTorsions(TestFoyer):
155155
@pytest.fixture
156156
def ethanol_with_rb_torsions(self, sage):
@@ -204,7 +204,6 @@ def test_rb_torsions(self, ethanol_with_rb_torsions):
204204
assert (gmx - omm).m_as(kj_mol) < 1e-6
205205

206206
@pytest.mark.filterwarnings("ignore:Parameters have not been assigned to all impropers.")
207-
@skip_if_missing("foyer")
208207
@skip_if_missing("mbuild")
209208
@needs_gmx
210209
def test_rb_torsions_vs_foyer(self, oplsaa, ethanol_with_rb_torsions):

openff/interchange/_tests/unit_tests/components/test_interchange.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ def test_input_topology_not_modified(self, sage):
118118
@needs_gmx
119119
@needs_lmp
120120
@pytest.mark.slow
121-
@skip_if_missing("foyer")
122121
def test_atom_ordering(self):
123122
"""Test that atom indices in bonds are ordered consistently between the slot map and topology"""
124123
import foyer

0 commit comments

Comments
 (0)