Skip to content

Commit

Permalink
Add CI run that tests the package without numpy installed
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wshanks committed Jul 13, 2024
1 parent 64e7320 commit 5d72ab7
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
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
Expand All @@ -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: >-
Expand Down

0 comments on commit 5d72ab7

Please sign in to comment.