From c7646f9f9a8a9cf523254e10431549e09e213053 Mon Sep 17 00:00:00 2001 From: Gregor Lichtner Date: Wed, 2 Oct 2024 20:38:38 +0200 Subject: [PATCH] test: add numpy<2 and >=2 tests --- .github/workflows/run-tests.yml | 12 ++++++++---- tox.ini | 23 +++++++++-------------- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 811702a..f740038 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -6,31 +6,35 @@ on: - main pull_request: - jobs: test: - name: test ${{ matrix.python-version }} - ${{ matrix.os }} + name: test ${{ matrix.python-version }} - ${{ matrix.numpy-version }} - ${{ matrix.os }} runs-on: ${{ matrix.os }} strategy: fail-fast: false matrix: os: [macos-latest, windows-latest, ubuntu-latest] python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + numpy-version: ["1.26", "2.1"] exclude: - os: macos-latest python-version: "3.7" - 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 diff --git a/tox.ini b/tox.ini index bbe1343..d6060e4 100644 --- a/tox.ini +++ b/tox.ini @@ -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:}