From 0ac654ec5e92730756bf1d5c583b0529f45ebbf1 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Thu, 22 Feb 2024 01:10:03 +0530 Subject: [PATCH 1/2] CI, BLD: Run tests on Linux editable installations This commit performs the following changes: 1. Adds a concurrency key to reduce duplicate runs 2. Moves common environment variables outside of individual jobs and into the workflow context for Linux and macOS 3. Adds an extra option to run an editable installation of PyWavelets under the `--no-build-isolation` flag with all of the build-time dependencies installed beforehand, ignoring previous installations as necessary. The `pytest --pyargs pywt` invocation is used to run the test suite against the editable installation which is similar to the rest of the checks. --- .github/workflows/tests.yml | 45 ++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9fa4c29a..f84d0417 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Linux and macOS tests +name: Tests on: push: @@ -9,18 +9,26 @@ on: - main - v1.** +concurrency: + # avoid duplicate runs on both pushes and PRs + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +env: + # Coloured output for GitHub Actions + FORCE_COLOR: 3 + # Some common environment variables for both GNU/Linux and macOS jobs + MPLBACKEND: Agg + CYTHON_TRACE: 1 + CYTHONSPEC: cython + NUMPY_MIN: numpy==1.23.0 + CYTHON_MIN: cython==3.0.4 + SCIPY_MIN: scipy==1.9.0 + jobs: test_pywavelets_linux: name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }} runs-on: ubuntu-latest - env: - MPLBACKEND: Agg - CYTHON_TRACE: 1 - CYTHONSPEC: cython - NUMPY_MIN: numpy==1.23.0 - CYTHON_MIN: cython==3.0.4 - SCIPY_MIN: scipy==1.9.0 - strategy: # Ensure that a wheel builder finishes even if another fails fail-fast: false @@ -49,7 +57,9 @@ jobs: python-version: "3.12" PIP_FLAGS: "--pre" OPTIONS_NAME: "pre-releases" - + - platform_id: manylinux_x86_64 + python-version: "3.12" + OPTIONS_NAME: "editable-install" steps: - name: Checkout PyWavelets uses: actions/checkout@v4 @@ -68,6 +78,7 @@ jobs: USE_SDIST: ${{ matrix.USE_SDIST }} USE_SCIPY: ${{ matrix.USE_SCIPY }} REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }} + OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }} run: | uname -a df -h @@ -100,10 +111,16 @@ jobs: pip install . -v fi + if [ "${OPTIONS_NAME}" == "editable-install" ]; then + pip install meson-python>=0.16.0 matplotlib pytest ninja + pip install -e . --no-build-isolation + fi + - name: Run tests env: USE_SDIST: ${{ matrix.USE_SDIST }} REFGUIDE_CHECK: ${{ matrix.REFGUIDE_CHECK }} + OPTIONS_NAME: ${{ matrix.OPTIONS_NAME }} run: | set -o pipefail # Move out of source directory to avoid finding local pywt @@ -125,14 +142,6 @@ jobs: test_pywavelets_macos: name: macos-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }} runs-on: macos-latest - env: - MPLBACKEND: Agg - CYTHON_TRACE: 1 - CYTHONSPEC: cython - NUMPY_MIN: numpy==1.23.0 - CYTHON_MIN: cython==3.0.4 - SCIPY_MIN: scipy==1.9.0 - strategy: # Ensure that a wheel builder finishes even if another fails fail-fast: false From ae5de420fc945daedf3fa7b8f06720eee2d346d5 Mon Sep 17 00:00:00 2001 From: Agriya Khetarpal <74401230+agriyakhetarpal@users.noreply.github.com> Date: Wed, 17 Apr 2024 19:24:03 +0530 Subject: [PATCH 2/2] BLD: Bump lower bound for `meson-python` Since the mechanism for editable installations was improved in https://github.com/mesonbuild/meson-python/pull/569 and subsequently released in meson-python v0.16.0, this bumps the minimum version for it for use during compilation. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 046ae7fc..f799ae1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ [build-system] build-backend = "mesonpy" requires = [ - "meson-python>=0.15.0", + "meson-python>=0.16.0", "Cython>=3.0.4", # numpy requirement for wheel builds for distribution on PyPI - building