From 0aef3885ce4ddb1cdac033af8bab3800350ac89b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 11:16:23 +0100 Subject: [PATCH 1/6] Add GHA CI --- .github/workflows/CI.yaml | 143 ++++++++++++++++++++++++++++++ devtools/conda-envs/test_env.yaml | 42 +++++++++ 2 files changed, 185 insertions(+) create mode 100644 .github/workflows/CI.yaml create mode 100644 devtools/conda-envs/test_env.yaml diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml new file mode 100644 index 00000000..fd810e5d --- /dev/null +++ b/.github/workflows/CI.yaml @@ -0,0 +1,143 @@ +name: CI + +on: + pull_request: + branches: + - "master" + schedule: + # nightly tests + - cron: "0 0 * * *" + push: + branches: + - master + +jobs: + test: + name: Test on ${{ matrix.cfg.os }}, Python ${{ matrix.cfg.python-version }}, OpenMM ${{ matrix.cfg.openmm }} + runs-on: ${{ matrix.cfg.os }} + strategy: + fail-fast: false + matrix: + cfg: + - { os: ubuntu-latest, python-version: 3.7, docs: true, openmm: latest } + - { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: latest } + - { os: ubuntu-latest, python-version: 3.7, docs: false, openmm: nightly } + - { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: nightly } + - { os: ubuntu-latest, python-version: 3.7, docs: false, openmm: conda-forge } + - { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: conda-forge } + + env: + OPENMM: ${{ matrix.cfg.openmm }} + OE_LICENSE: ${{ github.workspace }}/oe_license.txt + PACKAGENAME: yank + + steps: + - uses: actions/checkout@v2 + + - name: Additional info about the build + shell: bash + run: | + uname -a + df -h + ulimit -a + + # More info on options: https://github.com/conda-incubator/setup-miniconda + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.cfg.python-version }} + environment-file: devtools/conda-envs/test_env.yaml + activate-environment: test + auto-update-conda: true + auto-activate-base: false + show-channel-urls: true + + - name: Refine test environment + shell: bash -l {0} + run: | + case ${{ matrix.cfg.openmm }} in + latest) + echo "Using latest release OpenMM." + conda install --quiet -c omnia openmm;; + rc) + echo "Using OpenMM rc" + conda install --quiet -c omnia/label/rc openmm;; + beta) + echo "Using OpenMM beta" + conda install --quiet -c omnia/label/beta openmm;; + nightly) + echo "Using OpenMM nightly dev build." + conda install --quiet -c omnia-dev openmm;; + conda-forge) + echo "Using OpenMM conda-forge testing build." + conda install --quiet -c conda-forge/label/test openmm;; + esac + + - name: Install package + shell: bash -l {0} + run: | + python -m pip install --no-deps -v . + + - name: Environment Information + shell: bash -l {0} + run: | + conda info -a + conda list + + - name: Decrypt licenses + # TODO: MODELLER license? + shell: bash -l {0} + env: + OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} + run: | + echo "${OE_LICENSE_TEXT}" > ${OE_LICENSE} + python -c "import openeye; assert openeye.oechem.OEChemIsLicensed(), 'OpenEye license checks failed!'" + + - name: Test the package + shell: bash -l {0} + run: | + export OE_LICENSE="$HOME/oe_license.txt" + export TRAVIS=true + pushd . + nosetests ${PACKAGENAME} --nocapture --with-coverage --verbosity=3 --with-timer -a '!slow' --cover-xml --cover-xml-file=./coverage.xml + popd + + - name: Codecov + uses: codecov/codecov-action@v1 + with: + file: ./coverage.xml + fail_ci_if_error: false + + - name: Build docs + shell: bash -l {0} + if: matrix.cfg.docs + run: | + cd docs && make html; cd .. + # Move the docs into a versioned subdirectory + python devtools/travis-ci/set_doc_version.py + # Prepare versions.json + python devtools/travis-ci/update_versions_json.py + + docs: + name: Docs + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Additional info about the build + shell: bash + run: | + uname -a + df -h + ulimit -a + + # More info on options: https://github.com/conda-incubator/setup-miniconda + - uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.cfg.python-version }} + environment-file: devtools/conda-envs/test_env.yaml + activate-environment: test + auto-update-conda: true + auto-activate-base: false + show-channel-urls: true + + + diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml new file mode 100644 index 00000000..dc957d80 --- /dev/null +++ b/devtools/conda-envs/test_env.yaml @@ -0,0 +1,42 @@ +name: test +channels: + - conda-forge + - defaults + - omnia + - openeye + - salilab +requirements: + - compilers + - python + - pip + - pandas + - numpy >=1.14 + - scipy + - openmm >=7.3 + - mdtraj >=1.7.2 + - openmmtools >=0.18.3 + - pymbar + - ambermini >=16.16.0 + - docopt + - openmoltools >=0.7.5 + - mpiplus + - pyyaml + - clusterutils + - sphinxcontrib-bibtex + - cerberus ==1.1 # yank uses buggy cerberus 1.1 behavior as a feature ¯\_(ツ)_/¯ + - matplotlib + - jupyter + - pdbfixer + - openeye-toolkits + - modeller + # test + - nose + - nose-timer + - coverage + # docs + - sphinx + - sphinx_rtd_theme + - jinja2 + - runipy + - pip: + - msmb_theme \ No newline at end of file From 7ba1d10dd5896f2c0d5e289070a8b6e5170d7176 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 11:35:25 +0100 Subject: [PATCH 2/6] Fix typo in env yaml --- .github/workflows/CI.yaml | 27 +-------------------------- devtools/conda-envs/test_env.yaml | 2 +- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index fd810e5d..de20b8d6 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -84,7 +84,7 @@ jobs: conda list - name: Decrypt licenses - # TODO: MODELLER license? + # TODO: MODELLER shell: bash -l {0} env: OE_LICENSE_TEXT: ${{ secrets.OE_LICENSE }} @@ -116,28 +116,3 @@ jobs: python devtools/travis-ci/set_doc_version.py # Prepare versions.json python devtools/travis-ci/update_versions_json.py - - docs: - name: Docs - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Additional info about the build - shell: bash - run: | - uname -a - df -h - ulimit -a - - # More info on options: https://github.com/conda-incubator/setup-miniconda - - uses: conda-incubator/setup-miniconda@v2 - with: - python-version: ${{ matrix.cfg.python-version }} - environment-file: devtools/conda-envs/test_env.yaml - activate-environment: test - auto-update-conda: true - auto-activate-base: false - show-channel-urls: true - - - diff --git a/devtools/conda-envs/test_env.yaml b/devtools/conda-envs/test_env.yaml index dc957d80..a78abaab 100644 --- a/devtools/conda-envs/test_env.yaml +++ b/devtools/conda-envs/test_env.yaml @@ -5,7 +5,7 @@ channels: - omnia - openeye - salilab -requirements: +dependencies: - compilers - python - pip From 127c0dcf7984c58a4457101cac284b4ecb29cccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 12:11:46 +0100 Subject: [PATCH 3/6] Add README badge --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 02272104..cc717fcf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ +[![GH Actions Status](https://github.com/choderalab/perses/workflows/CI/badge.svg)](https://github.com/choderalab/perses/actions?query=branch%3Amaster) [![Travis Build Status](https://travis-ci.org/choderalab/yank.png)](https://travis-ci.org/choderalab/yank) [![Anaconda Cloud Badge](https://anaconda.org/omnia/yank/badges/version.svg)](https://anaconda.org/omnia/yank) [![Anaconda Cloud Downloads](https://anaconda.org/omnia/yank/badges/downloads.svg)](https://anaconda.org/omnia/yank) From e51ae16e7c90857538a304ca482160cdaf117598 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 12:14:46 +0100 Subject: [PATCH 4/6] Add osx to build matrix --- .github/workflows/CI.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/CI.yaml b/.github/workflows/CI.yaml index de20b8d6..fbc85aea 100644 --- a/.github/workflows/CI.yaml +++ b/.github/workflows/CI.yaml @@ -20,6 +20,7 @@ jobs: matrix: cfg: - { os: ubuntu-latest, python-version: 3.7, docs: true, openmm: latest } + - { os: macos-latest, python-version: 3.7, docs: true, openmm: latest } - { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: latest } - { os: ubuntu-latest, python-version: 3.7, docs: false, openmm: nightly } - { os: ubuntu-latest, python-version: 3.8, docs: false, openmm: nightly } From c7e788e843f415b64ba8ae756af2db3f0fde300a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 12:28:25 +0100 Subject: [PATCH 5/6] Patch version checking --- Yank/__init__.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Yank/__init__.py b/Yank/__init__.py index 3bce4bef..e7e23e1e 100644 --- a/Yank/__init__.py +++ b/Yank/__init__.py @@ -6,7 +6,11 @@ """ # Define global version. -from . import version # Needed for yank 3.X. +try: + from . import version # Needed for yank 3.X. + __version__ = version.version +except ImportError: + __version__ = "0.0.0dev" # Self module imports from . import utils @@ -14,5 +18,3 @@ from . import pipeline from . import experiment from .yank import Topography, AlchemicalPhase - -__version__ = version.version From de648714663a4e7f38e52c51b8417b862fdcf535 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaime=20Rodr=C3=ADguez-Guerra?= Date: Sat, 14 Nov 2020 12:48:07 +0100 Subject: [PATCH 6/6] More __version__ patches --- Yank/__init__.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/Yank/__init__.py b/Yank/__init__.py index e7e23e1e..92c81ce9 100644 --- a/Yank/__init__.py +++ b/Yank/__init__.py @@ -8,9 +8,18 @@ # Define global version. try: from . import version # Needed for yank 3.X. - __version__ = version.version -except ImportError: - __version__ = "0.0.0dev" +except: + # Fill in information manually. + class _Version: + short_version = "dev" + version = "dev" + full_version = "dev" + git_revision = "dev" + release = False + + version = _Version() + +__version__ = version.version # Self module imports from . import utils