Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CI run that tests the package without numpy installed #252

Merged
merged 2 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 --ignore=test_unumpy.py --ignore=test_ulinalg.py -k "not test_monte_carlo_comparison"
--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
2 changes: 1 addition & 1 deletion tests/test_uncertainties.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
numbers_close,
ufloats_close,
compare_derivatives,
uarrays_close,
)


Expand Down Expand Up @@ -1711,6 +1710,7 @@ def test_custom_pretty_print_and_latex():
# The tests below require NumPy, which is an optional package:
try:
import numpy
from helpers import uarrays_close
except ImportError:
pass
else:
Expand Down
Loading