Skip to content

Commit

Permalink
Merge pull request #605 from bittner/fix/install-scipy-via-tox
Browse files Browse the repository at this point in the history
Install extras for testing via Tox, test with SciPy+PyPy only on Ubuntu
  • Loading branch information
j-towns authored Aug 2, 2023
2 parents 2f8e00d + aee9d5f commit e18f656
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 34 deletions.
26 changes: 11 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,21 @@ jobs:
- pypy-3.7
- pypy-3.8
- pypy-3.9
extras:
- none
- scipy
- pypy-3.10
exclude:
- { platform: windows-latest, python-version: pypy-3.7 }
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
if: startsWith(matrix.platform, 'ubuntu') || startsWith(matrix.python-version, 'pypy') != true
run: tox run -e py-scipy
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=63"]
requires = ["setuptools>=44"]
build-backend = "setuptools.build_meta"

[project]
Expand Down
25 changes: 7 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -32,6 +19,8 @@ deps =
pypy27: mock
coverage[toml]
pytest
extras =
scipy: scipy
commands =
coverage run -m pytest {posargs}
coverage xml
Expand Down

0 comments on commit e18f656

Please sign in to comment.