From bb0ed47ad7e4cb89f3da156b7dc797537193baac Mon Sep 17 00:00:00 2001 From: Matt Einhorn Date: Wed, 5 Jun 2024 21:49:49 -0400 Subject: [PATCH] Run cov without numba jit and support GH actions pooch cache. --- .github/workflows/test_and_deploy.yml | 42 +++++++++++++++++++++++++++ pyproject.toml | 1 + 2 files changed, 43 insertions(+) diff --git a/.github/workflows/test_and_deploy.yml b/.github/workflows/test_and_deploy.yml index a6af755..e0301d7 100644 --- a/.github/workflows/test_and_deploy.yml +++ b/.github/workflows/test_and_deploy.yml @@ -26,6 +26,9 @@ jobs: needs: [linting, manifest] name: ${{ matrix.os }} py${{ matrix.python-version }} runs-on: ${{ matrix.os }} + env: + # used on unix by pooch for cache dir + XDG_CACHE_HOME: "~/.pooch_cache" strategy: matrix: # Run all supported Python versions on linux @@ -41,6 +44,13 @@ jobs: python-version: "3.11" steps: + - name: Cache pooch data + uses: actions/cache@v4 + with: + path: "~/.pooch_cache" + # hash on conftest in case url changes + key: ${{ runner.os }}-${{ matrix.python-version }}-${{ hashFiles('**/conftest.py') }} + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -55,6 +65,38 @@ jobs: python-version: ${{ matrix.python-version }} secret-codecov-token: ${{ secrets.CODECOV_TOKEN }} + test_numba_disabled: + needs: [ linting, manifest ] + name: Run tests with numba disabled + runs-on: ubuntu-latest + env: + NUMBA_DISABLE_JIT: "1" + # used on unix by pooch for cache dir + XDG_CACHE_HOME: "~/.pooch_cache" + + steps: + - name: Cache pooch data + uses: actions/cache@v4 + with: + path: "~/.pooch_cache" + # hash on conftest in case url changes + key: ${{ runner.os }}-3.11-${{ hashFiles('**/conftest.py') }} + + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.11" + # these libraries enable testing on Qt on linux + - uses: pyvista/setup-headless-display-action@v2 + with: + qt: true + # Run test suite with numba disabled + - uses: neuroinformatics-unit/actions/test@v2 + with: + python-version: "3.11" + secret-codecov-token: ${{ secrets.CODECOV_TOKEN }} + codecov-flags: "numba" + build_sdist_wheels: name: Build source distribution needs: [test] diff --git a/pyproject.toml b/pyproject.toml index e7a83cd..bd89129 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ dev = [ "setuptools_scm", "superqt", "tox", + "pooch", ]