Skip to content

Commit

Permalink
test: add numpy<2 and >=2 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
glichtner committed Oct 2, 2024
1 parent b8227cc commit fe35de4
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 22 deletions.
39 changes: 31 additions & 8 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,54 @@ on:
- main
pull_request:


jobs:
test:
name: test ${{ matrix.python-version }} - ${{ matrix.os }}
name: test py==${{ matrix.python-version }} - numpy==${{ matrix.numpy-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
fail-fast: true
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
exclude:
- os: macos-latest
python-version: "3.7"
python-version: ["3.9", "3.10", "3.11", "3.12"]
numpy-version: ["1.21", "2.0"]
include:

- python-version: "3.7"
os: windows-latest
numpy-version: "1.21"

- python-version: "3.7"
os: ubuntu-latest
numpy-version: "1.21"

- python-version: "3.8"
os: windows-latest
numpy-version: "1.21"

- python-version: "3.8"
os: macos-latest
numpy-version: "1.21"

- python-version: "3.8"
os: ubuntu-latest
numpy-version: "1.21"


steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install tox and dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Test with tox
- name: Run tests with numpy ${{ matrix.numpy-version }}
env:
NUMPY_VERSION: ${{ matrix.numpy-version }} # Pass numpy version to tox
run: |
tox -e py
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpy
tqdm
setuptools
23 changes: 9 additions & 14 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
[tox]
requires =
numpy
tqdm
envlist = py

[testenv]
deps=
-rrequirements.txt
tifffile
pytest
setuptools
numpy

commands=
pip install -e .
python setup.py install
pytest {posargs:}
deps =
pytest
tifffile
numpy=={env:NUMPY_VERSION}
-rrequirements.txt
commands =
pip install -e .
pytest {posargs:}

0 comments on commit fe35de4

Please sign in to comment.