Repository: Becksteinlab/GromacsWrapper (language: python)

Issue:
test on MacOS
Since the switch of CI to GitHub actions #200 we are currently only testing on **Linux** runners. There are versions of GROMACS available for MacOS #202 so we should be running at least some tests (Python 2.7 and 3.8) on MacOS runners, too.

The GROMACS versions can be limited, e.g.
- [ ] Python 2.7, GROMACS 2021
- [ ] Python 3.8, GROMACS 2021

for a start.


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 200daaec..5247ee3d 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -15,16 +15,42 @@ 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]
+        os: [ubuntu-latest, macOS-latest]
         python-version: [2.7, 3.6, 3.7, 3.8, 3.9]
+        gromacs-version: ["2021.1"]
+        # Test other GROMACS versions selectively on a recent Python.
+        # On macOS only test one GROMACS version and two Python versions
+        # to keep the testing matrix manageable.
+        exclude:
+          - os: macOS-latest
+            python-version: 3.6
+          - os: macOS-latest
+            python-version: 3.7
+          - os: macOS-latest
+            python-version: 3.9
+        include:
+          - os: ubuntu-latest
+            python-version: 2.7
+            gromacs-version: "4.6.5"	
+          - os: ubuntu-latest
+            python-version: 3.8
+            gromacs-version: "4.6.5"
+          - os: ubuntu-latest
+            python-version: 3.8
+            gromacs-version: "2018.6"
+          - os: ubuntu-latest
+            python-version: 3.8
+            gromacs-version: "2019.1"
+          - os: ubuntu-latest
+            python-version: 3.8
+            gromacs-version: "2020.6"
+
     env:
       MPLBACKEND: agg
         
@@ -34,7 +60,7 @@ jobs:
 
     - uses: conda-incubator/setup-miniconda@v2
       with:
-        python-version: ${{ matrix.python-version }}      
+        python-version: ${{ matrix.python-version }}
         auto-update-conda: true
         mamba-version: "*"
         channels: conda-forge,bioconda,defaults
@@ -65,11 +91,10 @@ jobs:
       run: |
          mamba install pytest pytest-pep8 pytest-cov codecov
 
-    # TODO: test different GROMACS versions
-    - name: Install GROMACS (latest)
+    - name: Install GROMACS (${{ matrix.gromacs-version }})
       shell: bash -l {0}
       run: |
-         mamba install gromacs pocl
+         mamba install 'gromacs==${{ matrix.gromacs-version }}' pocl
 
     - name: Install package
       shell: bash -l {0}
@@ -79,7 +104,7 @@ jobs:
     - name: Run tests
       shell: bash -l {0}
       run: |
-        pytest -v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs --cov-report=xml ./tests
+        pytest -v --disable-pytest-warnings --durations=20 --low-performance --cov=gromacs --cov-report=xml --color=yes ./tests
 
     - name: Codecov
       uses: codecov/codecov-action@v1
diff --git a/CHANGES b/CHANGES
index f791604a..229b01a7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -5,6 +5,8 @@
 2021-xx-xx     0.8.1
 orbeckst, PolyachenkoYA, whitead 
 
+* confirmed support for GROMACS 4.6.5, 2018, 2019, 2020, 2021 on Python 2.7 and
+  3.6--3.9 on Linux and macOS (#200, #202, #203)
 * fixed: core._run_command capture_output_file argument fixed to us python-3.0 
   file open (#181)
 * fixed: xvg._decimate used python-2.0-specific func_name() (issue #183)
diff --git a/README.rst b/README.rst
index 69f5516f..b3ac6a0e 100644
--- a/README.rst
+++ b/README.rst
@@ -10,8 +10,9 @@
 |build| |cov| |docs| |zenodo| |PRsWelcome|
 
 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--3.9.
+tested with GROMACS 4.6.5, 2018.x, 2019.x, 2020.x, and 2021.x (and 5.x
+and 2016.x should also work). It supports Python 2.7 and
+3.6--3.9 on Linux and macOS.
 
 GromacsWrapper also provides a small library (cook book) of often-used
 recipes and helper functions to set up MD simulations.
diff --git a/doc/sphinx/source/INSTALL.txt b/doc/sphinx/source/INSTALL.txt
index da1e282e..fe4a6c72 100644
--- a/doc/sphinx/source/INSTALL.txt
+++ b/doc/sphinx/source/INSTALL.txt
@@ -51,12 +51,8 @@ The tar archive from https://github.com/Becksteinlab/GromacsWrapper/releases
 contains a full source code distribution.
 
 In order to follow code development you can also browse the code
-**git** repository at https://github.com/Becksteinlab/GromacsWrapper or
-clone the git repository from
-
-   git://github.com/Becksteinlab/GromacsWrapper.git
- 
-and checkout the *master& branch::
+**git** repository at https://github.com/Becksteinlab/GromacsWrapper
+and checkout the *master* branch::
 
    git clone https://github.com/Becksteinlab/GromacsWrapper.git
    cd GromacsWrapper
@@ -65,10 +61,11 @@ and checkout the *master& branch::
 Requirements
 ============
 
-Python_ 2.7.x or Python >= 3.4 and Gromacs_ (4.6.x, 2016, 2018) must
-be installed. ipython_ is very much recommended. These packages might
-already be available through your local package manager such as
-``aptitude/apt``, ``yum``, ``yast``, ``fink`` or ``macports``.
+Python_ 2.7.x or Python >= 3.6 and Gromacs_ (4.6.x, 2016, 2018, 2019,
+2020, 2021) must be installed. ipython_ is very much
+recommended. These packages might already be available through your
+local package manager such as ``aptitude/apt``, ``yum``, ``yast``,
+``fink`` or ``macports``.
 
 .. _Python: http://www.python.org
 .. _Gromacs: http://www.gromacs.org
@@ -78,13 +75,9 @@ already be available through your local package manager such as
 System requirements
 -------------------
 
-Tested with Python 2.7.x and Python 3.5/3.6 on Linux and Mac
+Tested with Python 2.7.x and Python 3.6--3.9 on Linux and Mac
 OS X. Earlier Python versions are not supported.
 
-.. Note:: Python 3 support is currently in alpha state; in principle
-  it is fully supported but if you find bugs please report them
-  through the `Issue Tracker`_.
-
 
 Required Python modules
 -----------------------
diff --git a/doc/sphinx/source/configuration.txt b/doc/sphinx/source/configuration.txt
index d6e39e93..bcc8b9bd 100644
--- a/doc/sphinx/source/configuration.txt
+++ b/doc/sphinx/source/configuration.txt
@@ -112,7 +112,7 @@ files are located::
   templatesdir = %(configdir)s/templates
 
 
-And there are yet options for how to handle logging::
+And there are options for how to handle logging::
 
   [Logging]
   # name of the logfile that is written to the current directory
diff --git a/doc/sphinx/source/index.txt b/doc/sphinx/source/index.txt
index 3bbfac2b..d7960cfb 100644
--- a/doc/sphinx/source/index.txt
+++ b/doc/sphinx/source/index.txt
@@ -18,7 +18,7 @@ also allows for modularization and code re-use. In addition, commands,
 warnings and errors are logged to a file so that there exists a
 complete history of what has been done.
 
-Gromacs_ versions 4.6.x, 2016.x, 2018.x, and 2019.x are all
+Gromacs_ versions 4.6.x, 2016.x, 2018.x, 2019.x, 2020.x, and 2021.x are all
 supported. GromacsWrapper detects your Gromacs tools and provides them
 as :func:`gromacs.grompp`, :func:`gromacs.mdrun`, etc, regardless of
 your Gromacs version, which allows one to write scripts that are


Test patch:
diff --git a/tests/test_cbook.py b/tests/test_cbook.py
index ac5b716d..984aa1be 100644
--- a/tests/test_cbook.py
+++ b/tests/test_cbook.py
@@ -11,6 +11,7 @@
 import pytest
 from numpy.testing import assert_almost_equal
 
+import gromacs
 from gromacs import cbook
 import gromacs.setup
 
@@ -24,6 +25,8 @@ def simulation(tmpdir):
         f = gromacs.setup.topology(struct=pdb, ff="oplsaa", water="tip4p")
         yield f
 
+@pytest.mark.xfail(gromacs.release.startswith("2020.6"),
+                   reason="pdb2gmx 2020.6 fails to build the TIP4P waters")
 def test_grompp_qtot(tmpdir, simulation):
     with tmpdir.mkdir("qtot").as_cwd():
         with open('none.mdp', 'w') as mdp:
@@ -33,7 +36,8 @@ def test_grompp_qtot(tmpdir, simulation):
     assert_almost_equal(qtot, -4, decimal=5,
                         err_msg="grompp_qtot() failed to compute total charge correctly")
 
-
+@pytest.mark.xfail(gromacs.release.startswith("2020.6"),
+                   reason="pdb2gmx 2020.6 fails to build the TIP4P waters")
 def test_portable_topology(tmpdir, simulation):
     with tmpdir.mkdir("processed").as_cwd():
         pptopol = cbook.create_portable_topology(simulation['top'], simulation['struct'])
diff --git a/tests/test_setup.py b/tests/test_setup.py
index f47a4715..801f58a7 100644
--- a/tests/test_setup.py
+++ b/tests/test_setup.py
@@ -10,10 +10,13 @@
 
 from numpy.testing import assert_almost_equal
 
+import gromacs
 import gromacs.setup
 
 from .datafiles import datafile
 
+@pytest.mark.xfail(gromacs.release.startswith("2020.6"),
+                   reason="pdb2gmx 2020.6 fails to build the TIP4P waters")
 def test_trj_compact_main(tmpdir):
     pdb = datafile("1ake_A.pdb")
     top = tmpdir.mkdir("top")