Repository: Becksteinlab/GromacsWrapper (language: python)

Issue:
transition from Travis CI to GitHub actions
Use the free GitHub actions for CI.

**Important** because we ran out of Travis credits.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
new file mode 100644
index 00000000..200daaec
--- /dev/null
+++ b/.github/workflows/ci.yaml
@@ -0,0 +1,88 @@
+name: CI
+
+on:
+  # run once a day at 4:44 UTC
+  schedule:
+    - cron: "44 4 * * *"
+  push:
+    branches:
+      - "master"
+  pull_request:
+    branches:
+      - "master"
+
+concurrency:
+  group: "${{ github.ref }}-${{ github.head_ref }}"
+  cancel-in-progress: true
+
+# TODO: test different OS (but difficult with GROMACS versions)
+#       for right now: test on Linux only
+jobs:
+  test:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest]
+        python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
+    env:
+      MPLBACKEND: agg
+        
+
+    steps:
+    - uses: actions/checkout@v2
+
+    - uses: conda-incubator/setup-miniconda@v2
+      with:
+        python-version: ${{ matrix.python-version }}      
+        auto-update-conda: true
+        mamba-version: "*"
+        channels: conda-forge,bioconda,defaults
+        channel-priority: true
+        show-channel-urls: true
+          
+    - name: Conda info
+      shell: bash -l {0}
+      run: |
+         conda info
+         conda list
+         conda config --show-sources
+         conda config --show
+
+    - name: Python version
+      shell: bash -l {0}
+      run: |
+         python -c "import sys; print(sys.version)"                
+
+    - name: Install package dependencies
+      shell: bash -l {0}
+      run: |
+         mamba install six numpy scipy matplotlib pandas
+         python -m pip install --no-deps numkit 
+
+    - name: Install pytest and plugins
+      shell: bash -l {0}
+      run: |
+         mamba install pytest pytest-pep8 pytest-cov codecov
+
+    # TODO: test different GROMACS versions
+    - name: Install GROMACS (latest)
+      shell: bash -l {0}
+      run: |
+         mamba install gromacs pocl
+
+    - name: Install package
+      shell: bash -l {0}
+      run: |
+        python -m pip install --no-deps .
+
+    - name: Run tests
+      shell: bash -l {0}
+      run: |
+        pytest -v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs --cov-report=xml ./tests
+
+    - name: Codecov
+      uses: codecov/codecov-action@v1
+      with:
+        file: ./coverage.xml
+        fail_ci_if_error: true
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 81c24268..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,69 +0,0 @@
-language: generic
-group: travis_latest
-sudo: false
-
-# whitelist
-branches:
-    only:
-        - master
-
-env:
-  global:
-    - PYTHON_VERSION=3.6
-    - CODECOV=true
-    - PYTEST_FLAGS="-v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs"
-    - PYTEST_LIST="tests"
-    - MAIN_CMD="pytest ${PYTEST_LIST}"
-    - SETUP_CMD="${PYTEST_FLAGS}"
-    - BUILD_CMD="pip install -v ."
-    - CONDA_DEPENDENCIES="six scipy matplotlib pandas gromacs"
-    # Gromacs 2018 packages from bioconda require conda-forge for
-    # dependency, see https://bioconda.github.io/#set-up-channels
-    - CONDA_CHANNELS="defaults conda-forge bioconda"
-    - CONDA_CHANNEL_PRIORITY=True
-    - PIP_DEPENDENCIES="numkit codecov"
-    - NUMPY_VERSION=stable
-    - MPLBACKEND=agg
-
-  matrix:
-    # use ci-helper's PACKAGENAME_VERSION magic to pin the 'gromacs' package
-    - GROMACS_VERSION=4.6.5   PYTHON_VERSION=2.7 NUMPY_VERSION=1.16
-    - GROMACS_VERSION=2019.1  PYTHON_VERSION=2.7 NUMPY_VERSION=1.16
-    - GROMACS_VERSION=4.6.5   PYTHON_VERSION=3.6
-    - GROMACS_VERSION=2018.6  PYTHON_VERSION=3.6
-    - GROMACS_VERSION=2019.1  PYTHON_VERSION=3.6
-    - GROMACS_VERSION=2019.1  PYTHON_VERSION=3.7
-    # Test "append_suffix" implementation
-    - GROMACS_VERSION=2018.6  PYTHON_VERSION=3.6
-      SETUP_CMD="${SETUP_CMD} --link-gmx-mpi --no-append-suffix"
-
-
-matrix:
-  fast_finish: true
-
-  include:
-    # see Gromacs packages on bioconda https://anaconda.org/bioconda/gromacs/files
-    - os: osx
-      env: GROMACS_VERSION=4.6.5 PYTHON_VERSION=3.6
-    - os: osx
-      env: GROMACS_VERSION=2019.1 PYTHON_VERSION=2.7 NUMPY_VERSION=1.16
-    - os: osx
-      env: GROMACS_VERSION=2019.1 PYTHON_VERSION=3.6
-
-
-install:
-  - git clone --depth 1 git://github.com/astropy/ci-helpers.git
-  - source ci-helpers/travis/setup_conda.sh
-  - eval $BUILD_CMD
-
-script:
-  - cd ${TRAVIS_BUILD_DIR}
-  - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then ulimit -S -n 2048; fi
-  - echo $MAIN_CMD $SETUP_CMD
-  - eval $MAIN_CMD $SETUP_CMD
-
-after_success:
-  - |
-    if [[ $CODECOV == 'true' ]]; then \
-      codecov; \
-    fi
diff --git a/README.rst b/README.rst
index 2ee99152..69f5516f 100644
--- a/README.rst
+++ b/README.rst
@@ -11,7 +11,7 @@
 
 A primitive Python wrapper around the Gromacs_ tools. The library is
 tested with Gromacs 4.6.5, 2018.x, 2019.x (and 2016.x also works) and
-is tested with Python 2.7 and 3.6.
+is tested with Python 2.7 and 3.6--3.9.
 
 GromacsWrapper also provides a small library (cook book) of often-used
 recipes and helper functions to set up MD simulations.
@@ -30,8 +30,8 @@ running simulations with sensible parameters.
    https://gromacswrapper.readthedocs.org/en/latest/
 .. _GromacsWrapper git repository:
    https://github.com/Becksteinlab/GromacsWrapper
-.. |build| image:: https://travis-ci.com/Becksteinlab/GromacsWrapper.svg?branch=master
-   :target: https://travis-ci.com/Becksteinlab/GromacsWrapper
+.. |build| image:: https://github.com/Becksteinlab/GromacsWrapper/actions/workflows/ci.yaml/badge.svg?branch=master
+   :target: https://github.com/Becksteinlab/GromacsWrapper/actions/workflows/ci.yaml
    :alt: Build Status	     
 .. |cov| image:: https://codecov.io/gh/Becksteinlab/GromacsWrapper/badge.svg
    :target: https://codecov.io/gh/Becksteinlab/GromacsWrapper
diff --git a/setup.py b/setup.py
index b57df831..3680d6db 100644
--- a/setup.py
+++ b/setup.py
@@ -16,7 +16,7 @@
 setup(name="GromacsWrapper",
       version=versioneer.get_version(),
       cmdclass=versioneer.get_cmdclass(),
-      description="A python wrapper around the Gromacs tools.",
+      description="A Python wrapper around the Gromacs tools.",
       long_description=long_description,
       author="Oliver Beckstein",
       author_email="orbeckst@gmail.com",
@@ -24,17 +24,27 @@
       url="https://github.com/Becksteinlab/GromacsWrapper",
       download_url="https://github.com/Becksteinlab/GromacsWrapper/downloads",
       keywords="science Gromacs analysis 'molecular dynamics'",
-      classifiers=['Development Status :: 4 - Beta',
-                   'Environment :: Console',
-                   'Intended Audience :: Science/Research',
-                   'License :: OSI Approved :: GNU General Public License (GPL)',
-                   'Operating System :: POSIX',
-                   'Operating System :: MacOS :: MacOS X',
-                   'Programming Language :: Python',
-                   'Topic :: Scientific/Engineering :: Bio-Informatics',
-                   'Topic :: Scientific/Engineering :: Chemistry',
-                   'Topic :: Software Development :: Libraries :: Python Modules',
-                   ],
+      classifiers=[
+        'Development Status :: 4 - Beta',
+        'Environment :: Console',
+        'Intended Audience :: Science/Research',
+        'License :: OSI Approved :: GNU General Public License (GPL)',
+        'License :: OSI Approved :: BSD License',
+        'Operating System :: POSIX',
+        'Operating System :: MacOS :: MacOS X',
+        'Operating System :: Microsoft :: Windows ',
+        'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.6',
+        'Programming Language :: Python :: 3.7',
+        'Programming Language :: Python :: 3.8',
+        'Programming Language :: Python :: 3.9',
+        'Topic :: Scientific/Engineering :: Bio-Informatics',
+        'Topic :: Scientific/Engineering :: Chemistry',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+      ],
       packages=find_packages(
           exclude=['scripts', 'tests', 'tests.*', 'extras', 'doc/examples']),
       scripts=[


Test patch:
diff --git a/tests/data/custom_em.mdp b/tests/data/custom_em.mdp
index c45544bc..863d84ad 100644
--- a/tests/data/custom_em.mdp
+++ b/tests/data/custom_em.mdp
@@ -1,7 +1,7 @@
 ; custom EM
 
 include        = -I. -I.. -I../top
-define         = -DPOSRES -DFLEXSPC
+define         = -DPOSRES
 
 integrator     = cg
 emtol          = 500
diff --git a/tests/fileformats/test_mdp.py b/tests/fileformats/test_mdp.py
index 44ab9510..dafc117f 100644
--- a/tests/fileformats/test_mdp.py
+++ b/tests/fileformats/test_mdp.py
@@ -16,15 +16,11 @@ def CUSTOM_EM_MDP(request, tmpdir):
     autoconvert = not request.param == 'no_autoconvert'
     mdp = gromacs.fileformats.mdp.MDP(datafile('custom_em.mdp'),
                                       autoconvert=autoconvert)
-
     if request.param == 'written':
         # to check that written mdp has same data
         out = str(tmpdir.join('out.mdp'))
-
         mdp.write(out)
-
         mdp = gromacs.fileformats.mdp.MDP(out)
-
     return mdp, autoconvert
 
 
@@ -41,10 +37,10 @@ def conv(val):
 
         if autoconvert:
             assert_equal(mdp['include'], ['-I.', '-I..', '-I../top'])
-            assert_equal(mdp['define'], ['-DPOSRES', '-DFLEXSPC'])
+            assert_equal(mdp['define'], '-DPOSRES')
         else:
             assert mdp['include'] == '-I. -I.. -I../top'
-            assert mdp['define'] == '-DPOSRES -DFLEXSPC'
+            assert mdp['define'] == '-DPOSRES'
         assert mdp['integrator'] == 'cg'
         assert mdp['emtol'] == conv(500)
         assert mdp['emstep'] == conv(0.01)
diff --git a/tests/test_tools.py b/tests/test_tools.py
index 526dd13e..fa247584 100644
--- a/tests/test_tools.py
+++ b/tests/test_tools.py
@@ -49,11 +49,13 @@ def test_failure_ignore():
         raise AssertionError("Should have ignored exception {}".format(err))
 
 class TestRelease(object):
+    major_releases = ('4', '5', '2016', '2018', '2019', '2020', '2021')
+
     def test_release(self):
-        assert gromacs.release().startswith(('4', '2016', '2018', '2019'))
+        assert gromacs.release().startswith(self.major_releases)
 
     def test_release_startswith(self):
-        assert gromacs.release.startswith(('4', '2016', '2018', '2019'))
+        assert gromacs.release.startswith(self.major_releases)
 
     def test_str(self):
         assert str(gromacs.release()) == gromacs.release()