From 0f0c281fa2e21f9dab68a70c61951bbc20e6c1f0 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Aug 2023 10:13:14 +0100 Subject: [PATCH 1/5] Add tox-gh based CI --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ tox.ini | 9 +++++++- 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..09c5aea --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI tests +on: + pull_request: + push: + branches: + - master + +concurrency: + # cancels running checks on new pushes + group: check-${{ github.ref }} + cancel-in-progress: true + +jobs: + + pytest: + name: Run Python unit tests + # Note that 20.04 is currently required until galvani supports mdbtools>=1.0. + runs-on: ubuntu-20.04 + + strategy: + fail-fast: false + max-parallel: 4 + matrix: + python-version: ['3.8', '3.9', '3.10', '3.11'] + + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install MDBTools OS dependency + run: | + sudo apt install -y mdbtools + + # tox-gh workflow following instructions at https://github.com/tox-dev/tox-gh + - name: Install tox + run: python -m pip install tox-gh + + - name: Setup tests + run: | + tox -vv --notest + + - name: Run all tests + run: | + tox --skip-pkg-install diff --git a/tox.ini b/tox.ini index f689865..435ae8c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2017-2021 Christopher Kerr # SPDX-License-Identifier: GPL-3.0-or-later [tox] -envlist = py36,py37,py38,py39 +envlist = py36,py37,py38,py39,py310,py311 [testenv] deps = flake8 @@ -15,3 +15,10 @@ commands = [flake8] exclude = build,dist,*.egg-info,.cache,.git,.tox,__pycache__ max-line-length = 100 + +[gh] +python = + 3.11 = py311 + 3.10 = py310 + 3.9 = py39 + 3.8 = py38 From aa48c6d60f1d7b258d9a7c3e2214b36e15bc82c5 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Aug 2023 10:17:31 +0100 Subject: [PATCH 2/5] Remove 3.6 and 3.7 support in CI --- .github/workflows/ci.yml | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09c5aea..b74ab4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: strategy: fail-fast: false - max-parallel: 4 + max-parallel: 6 matrix: python-version: ['3.8', '3.9', '3.10', '3.11'] diff --git a/tox.ini b/tox.ini index 435ae8c..28fcabf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,7 +1,7 @@ # SPDX-FileCopyrightText: 2017-2021 Christopher Kerr # SPDX-License-Identifier: GPL-3.0-or-later [tox] -envlist = py36,py37,py38,py39,py310,py311 +envlist = py38,py39,py310,py311 [testenv] deps = flake8 From 575e3a5bba7b7ef2b7e7a56f694f295f8aad4962 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Aug 2023 10:20:26 +0100 Subject: [PATCH 3/5] Linting fix --- galvani/BioLogic.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/galvani/BioLogic.py b/galvani/BioLogic.py index 026a4f3..5bec5a3 100644 --- a/galvani/BioLogic.py +++ b/galvani/BioLogic.py @@ -426,11 +426,11 @@ def __init__(self, file_or_path): raise ValueError("Unrecognised version for data module: %d" % data_module['version']) - assert(not any(remaining_headers)) + assert not any(remaining_headers) self.dtype, self.flags_dict = VMPdata_dtype_from_colIDs(column_types) self.data = np.frombuffer(main_data, dtype=self.dtype) - assert(self.data.shape[0] == n_data_points) + assert self.data.shape[0] == n_data_points # No idea what these 'column types' mean or even if they are actually # column types at all From a31a07adb2cb52209bbdac429f128ba98154db04 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Aug 2023 10:22:20 +0100 Subject: [PATCH 4/5] Add copyright info to CI config --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b74ab4a..43ac894 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,3 +1,6 @@ +# SPDX-FileCopyrightText: 2013-2020 Christopher Kerr, "bcolsen" +# SPDX-License-Identifier: GPL-3.0-or-later + name: CI tests on: pull_request: From 28e532c86018aacb3d94d53bfd20aa3e7ba73a95 Mon Sep 17 00:00:00 2001 From: Matthew Evans Date: Fri, 18 Aug 2023 10:26:00 +0100 Subject: [PATCH 5/5] Pull lfs in CI --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43ac894..4fc4e25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,6 +30,7 @@ jobs: - uses: actions/checkout@v3 with: fetch-depth: 0 + lfs: true - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4