From 5d72ab73e5726e475bd2404d606bed9e7d9fc109 Mon Sep 17 00:00:00 2001 From: Will Shanks Date: Sat, 13 Jul 2024 12:35:33 -0400 Subject: [PATCH] Add CI run that tests the package without numpy installed Given that it is common to work with Uncertainties and numpy, it is easy to forget to check that a hard dependency on numpy has been introduced. Here an extra run is added to the CI configuration to run the tests without installing numpy. --- .github/workflows/python-package.yml | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 09fd1821..a7c16040 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -38,6 +38,29 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} slug: lmfit/uncertainties + test_without_numpy: + name: Test without numpy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install .[test] + - name: Test source code and docs + run: + cd tests; + python -m pytest -k "not test_unumpy and not test_ulinalg" + --cov=uncertainties --cov=. --cov-report=xml --cov-report=term + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4.0.1 + with: + token: ${{ secrets.CODECOV_TOKEN }} + slug: lmfit/uncertainties results: # This step aggregates the results from all the tests and allows us to # require only this single job to pass for a PR to be merged rather than @@ -46,7 +69,7 @@ jobs: if: ${{ always() }} runs-on: ubuntu-latest name: Final Results - needs: [build] + needs: [build,test_without_numpy] steps: - run: exit 1 if: >-