From c408a2da5743ba3a84527298f3937ce49cb17226 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Mon, 31 Jul 2023 19:45:22 +0200 Subject: [PATCH 1/2] Install extras for testing via Tox --- .github/workflows/test.yml | 23 ++++++++--------------- pyproject.toml | 2 +- tox.ini | 25 +++++++------------------ 3 files changed, 16 insertions(+), 34 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index d48e716b..10b78c5b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,25 +31,18 @@ jobs: - pypy-3.7 - pypy-3.8 - pypy-3.9 - extras: - - none - - scipy + - pypy-3.10 steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} - name: Install Python build tools - if: matrix.python-version != 'pypy-3.7' || matrix.platform != 'windows-latest' - run: python -m pip install tox-gh-actions wheel - - name: Workaround for PyPy 3.7 on Windows (tox-conda) - if: matrix.python-version == 'pypy-3.7' && matrix.platform == 'windows-latest' - run: python -m pip install tox-conda tox-gh-actions wheel - - name: Install optional dependencies (extras) on Linux/macOS - if: matrix.extras != 'none' && matrix.platform != 'windows-latest' - run: conda install -c anaconda ${{ matrix.extras }} - - name: Install optional dependencies (extras) on Windows - if: matrix.extras != 'none' && matrix.platform == 'windows-latest' - run: . ${env:CONDA}\scripts\conda.exe install -c anaconda ${{ matrix.extras }} + run: python -m pip install tox wheel - name: Run tests - run: tox + run: tox run -e py + - name: Install Scipy prerequisites for Ubuntu + if: startsWith(matrix.platform, 'ubuntu') + run: sudo apt-get install libopenblas-dev + - name: Run tests with scipy + run: tox run -e py-scipy diff --git a/pyproject.toml b/pyproject.toml index fe57aaf1..9bf24861 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["setuptools>=63"] +requires = ["setuptools>=44"] build-backend = "setuptools.build_meta" [project] diff --git a/tox.ini b/tox.ini index e3828855..848921c2 100644 --- a/tox.ini +++ b/tox.ini @@ -4,26 +4,13 @@ [tox] envlist = ruff - py2{7} - pypy2{7} - py3{5,6,7,8,9,10,11} - pypy3{8,9} + py2{7}{,-scipy} + pypy2{7}{,-scipy} + py3{5,6,7,8,9,10,11}{,-scipy} + pypy3{8,9,10}{,-scipy} package clean - -[gh-actions] -python = - 2.7: py27 - 3.5: py35 - 3.6: py36 - 3.7: py37 - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311 - pypy-2.7: pypy27 - pypy-3.8: pypy38 - pypy-3.9: pypy39 +requires = virtualenv<20.22.0 [testenv] description = Unit tests and test coverage @@ -32,6 +19,8 @@ deps = pypy27: mock coverage[toml] pytest +extras = + scipy: scipy commands = coverage run -m pytest {posargs} coverage xml From aee9d5f81d3f8b1487a6b1b355de2b5c4aec73c3 Mon Sep 17 00:00:00 2001 From: Peter Bittner Date: Tue, 1 Aug 2023 11:15:40 +0200 Subject: [PATCH 2/2] Run tests with SciPy on PyPy for Ubuntu only Exclude running tests for PyPy 3.7 on Windows entirely Prerequisites for building SciPy and NumPy are easy to obtain for (Ubuntu) Linux, but not so much for macOS and Windows. --- .github/workflows/test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 10b78c5b..20c5db96 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,8 @@ jobs: - pypy-3.8 - pypy-3.9 - pypy-3.10 + exclude: + - { platform: windows-latest, python-version: pypy-3.7 } steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 @@ -45,4 +47,5 @@ jobs: if: startsWith(matrix.platform, 'ubuntu') run: sudo apt-get install libopenblas-dev - name: Run tests with scipy + if: startsWith(matrix.platform, 'ubuntu') || startsWith(matrix.python-version, 'pypy') != true run: tox run -e py-scipy