From e6519b9151881205ca0561c1b3f66a1ae8e8ca69 Mon Sep 17 00:00:00 2001 From: Martin Larralde Date: Fri, 13 Sep 2024 14:09:24 +0200 Subject: [PATCH] Unpin `numpy` from dependencies and test multiple versions in CI --- .github/workflows/test.yml | 51 ++++++++++++++------------------------ setup.cfg | 2 +- tests/requirements.txt | 3 +-- 3 files changed, 20 insertions(+), 36 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 110305a..99b7b4e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,37 +13,20 @@ jobs: OS: Linux strategy: matrix: - include: - - python-version: "3.7" - python-release: v3.7 - python-impl: CPython - - python-version: "3.8" - python-release: v3.8 - python-impl: CPython - - python-version: "3.9" - python-release: v3.9 - python-impl: CPython - - python-version: "3.10" - python-release: v3.10 - python-impl: CPython - - python-version: "3.11" - python-release: v3.11 - python-impl: CPython - - python-version: "3.12" - python-release: v3.12 - python-impl: CPython - - python-version: pypy-3.7 - python-release: v3.7 - python-impl: PyPy - - python-version: pypy-3.8 - python-release: v3.8 - python-impl: PyPy - - python-version: pypy-3.9 - python-release: v3.9 - python-impl: PyPy - - python-version: pypy-3.10 - python-release: v3.10 - python-impl: PyPy + python-version: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - '3.11' + - '3.12' + - 'pypy-3.7' + - 'pypy-3.8' + - 'pypy-3.9' + - 'pypy-3.10' + numpy-version: + - '1.0' + - '2.0' steps: - name: Checkout code uses: actions/checkout@v4 @@ -55,14 +38,16 @@ jobs: run: python -m pip install -U pip wheel setuptools - name: Install CI requirements run: python -m pip install -r .github/workflows/requirements.txt + - name: Install NumPy ${{ matrix.numpy-version }} + run: python -m pip install -U 'numpy ~=${{ matrix.numpy-version }}' --prefer-binary - name: Install test requirements run: python -m pip install -r tests/requirements.txt --prefer-binary - name: Test with coverage run: python -m coverage run -m unittest discover -vv - name: Upload to Codecov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: - flags: ${{ matrix.python-impl }},${{ matrix.python-release }} + flags: ${{ matrix.python-version }} name: test-python-${{ matrix.python-version }} fail_ci_if_error: true token: ${{ secrets.CODECOV_TOKEN }} diff --git a/setup.cfg b/setup.cfg index e3d18e6..4ce0fa8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -44,7 +44,7 @@ test_suite = tests include_package_data = true setup_requires = setuptools >=46.4 install_requires = - numpy ~=1.0 + numpy importlib-resources >=1.3 ; python_version < '3.9' [options.package_data] diff --git a/tests/requirements.txt b/tests/requirements.txt index 21871b4..e0116bd 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,2 +1 @@ -numpy -biopython \ No newline at end of file +biopython