Skip to content

Commit

Permalink
Install extras dependency via Tox
Browse files Browse the repository at this point in the history
  • Loading branch information
bittner committed Aug 1, 2023
1 parent 2f8e00d commit 17f860d
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
27 changes: 12 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,25 +31,22 @@ 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: matrix.platform == 'ubuntu-latest'
run: sudo apt-get install libopenblas-dev
- name: Install Scipy prerequisites for macOS
if: matrix.platform == 'macos-latest'
run: brew install openblas
- name: Run tests with scipy
if: matrix.platform != 'windows-latest' || matrix.python-version != 'pypy'
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 17f860d

Please sign in to comment.