Skip to content

Commit

Permalink
Merge pull request #746 from choderalab/test-rebase
Browse files Browse the repository at this point in the history
Update to PyTest (Rebased Edition)
See #741
  • Loading branch information
mikemhenry authored Sep 13, 2024
2 parents 9fc8ab7 + 254c454 commit b74a61a
Show file tree
Hide file tree
Showing 23 changed files with 6,335 additions and 2,983 deletions.
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# See https://github.com/choderalab/openmmtools/pull/741#issuecomment-2341717861
e7144c193ad307aa9ef2f852feecf0dcdd2ef352
7ebe1ab6e86582e8ed5e2cc2103d8eaa599ec3f2
562e0d305b96082cac337ce2320f5f7835385618
58 changes: 21 additions & 37 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,22 @@ concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

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

jobs:
test:
name: ${{ matrix.os }}, py-${{ matrix.python-version }}, OpenMM-${{ matrix.openmm }}, pymbar-${{ matrix.pymbar-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
openmm: ["7.7", "8.0"]
os: [macOS-latest, ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"]
openmm: ["8.0", "8.1.1", "8.1.2"]
os: [macOS-latest, ubuntu-latest, macOS-12]
pymbar-version: ["4"]
include:
# Test openmm dev build on newest python + linux
- openmm: "dev"
python-version: "3.10"
os: ubuntu-latest
pymbar-version: "4"
# Test newest python, openmm, and pymbar we support on windows
- openmm: "8.0"
python-version: "3.10"
Expand All @@ -45,61 +44,46 @@ jobs:
os: ubuntu-latest
pymbar-version: "3"
exclude:
# There are no py 3.10 builds of openmm 7.7
- openmm: "7.7"
python-version: "3.10"
# no py312 builds of openmm 8.0
- openmm: "8.0"
python-version: "3.12"

steps:
- uses: actions/checkout@v3
- name: Additional info about the build
shell: bash
run: |
uname -a
df -h
ulimit -a
- name: Setup micromamba for openmm dev
uses: mamba-org/provision-with-micromamba@main
if: ${{ matrix.openmm == 'dev' }}
with:
channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge/label/openmm_dev/linux-64,conda-forge
environment-file: devtools/conda-envs/test_env.yaml
channel-priority: flexible
environment-name: openmmtools-test
extra-specs: |
python==${{ matrix.python-version }}
openmm==8.0.0dev3
pymbar==${{ matrix.pymbar-version }}.*
- name: Setup micromamba
uses: mamba-org/provision-with-micromamba@main
if: ${{ matrix.openmm != 'dev' }}
uses: mamba-org/setup-micromamba@v1
with:
channels: jaimergp/label/unsupported-cudatoolkit-shim,conda-forge
environment-file: devtools/conda-envs/test_env.yaml
channel-priority: strict
environment-name: openmmtools-test
extra-specs: |
create-args: >-
python==${{ matrix.python-version }}
openmm==${{ matrix.openmm }}
pymbar==${{ matrix.pymbar-version }}.*
condarc: |
channels:
- conda-forge
- jaimergp/label/unsupported-cudatoolkit-shim
- name: Install package
shell: bash -l {0}
run: |
python -m pip install . --no-deps
python -m pip install -e . --no-deps
micromamba list
micromamba info
- name: Run tests
shell: bash -l {0}
run: |
# pytest -v --cov=openmmtools --cov-report=xml --color=yes openmmtools/tests/
nosetests openmmtools/tests --nocapture --cover-tests --with-coverage --cover-package=openmmtools --cover-xml --cover-xml-file=coverage.xml --verbosity=2 --with-timer --with-doctest -a '!slow'
pytest -n logical -v --cov=openmmtools --cov-report=xml --cov-report=term --color=yes openmmtools/tests/
- name: CodeCov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}-openmm-${{ matrix.openmm }}
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}-openmm-${{ matrix.openmm }}-pymbar-${{ matrix.pymbar-version }}
token: ${{ secrets.CODECOV_TOKEN }}
19 changes: 7 additions & 12 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,29 @@ name: openmmtools-test
channels:
- conda-forge
dependencies:
# Base depends
# Base depends
- cython
- hdf5 <=1.14.0 # Macos has problem with newer releases (1.14.x) to date
- libnetcdf >=4.6.2 # workaround for libssl issues
- mdtraj
- mpiplus
- netcdf4 >=1.4.2 # after bugfix: "always return masked array by default, even if there are no masked values"
- netcdf4
- numba
- numpy
- openmm
#- parmed # Test to see if this fixes the docs
- pip
- pymbar
- python
- python
- pyyaml
- scipy
- scipy < 1.14
- setuptools
- sphinxcontrib-bibtex
# Testing
# Testing
- codecov
- nose
- nose-timer
- coverage
- pytest
- pytest-cov
- coverage

- pytest-xdist
# docs
- numpydoc
- sphinxcontrib-bibtex
- sphinx-rtd-theme
- sphinxcontrib-bibtex
3 changes: 3 additions & 0 deletions openmmtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
__version__ = versions['version']
__git_revision__ = versions['full-revisionid']
del get_versions, versions

from . import _version
__version__ = _version.get_versions()['version']
Loading

0 comments on commit b74a61a

Please sign in to comment.