Skip to content

Commit

Permalink
Merge pull request scipy#19849 from rgommers/fix-prerelease-job
Browse files Browse the repository at this point in the history
CI: fix prerelease job to use numpy 2.0, and add a second job to test ABI compat
  • Loading branch information
tylerjereddy authored Jan 10, 2024
2 parents 48e3215 + d919646 commit 906e6cd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/linux_meson.yml
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,9 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
# Both use numpy 2.0-dev at build time; 3.9 job then downgrades to
# lowest supported NumPy version in order to test ABI compatibility.
python-version: ['3.9', '3.11']

steps:
- uses: actions/checkout@v3
Expand All @@ -306,11 +308,15 @@ jobs:
- name: Install Python packages
run: |
python -m pip install cython pythran ninja meson-python pybind11 click rich_click pydevtool
python -m pip install --pre --upgrade --timeout=60 -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
python -m pip install --pre --upgrade pytest pytest-cov pytest-xdist mpmath gmpy2 threadpoolctl pooch matplotlib hypothesis
# Note: matplotlib not installed here to avoid issues around numpy 2.0
# (it can be put back after matplotlib has made a 2.0-compatible
# release on PyPI.
python -m pip install --pre --upgrade pytest pytest-cov pytest-xdist mpmath gmpy2 threadpoolctl pooch hypothesis
# TODO: once the scipy_ symbol prefix issue is fixed, install
# scipy-openblas32 from the pre-releases bucket again (see gh-19640)
python -m pip install "scipy-openblas32<=0.3.23.293.2"
# Install numpy last, to ensure we get 2.0.0-dev (avoid possible <2.0 constraints).
python -m pip install --pre --upgrade --timeout=60 -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
- name: Prepare compiler cache
id: prep-ccache
Expand Down Expand Up @@ -339,10 +345,15 @@ jobs:
shell: bash -l {0}
run: ccache -s

- name: Downgrade NumPy from 2.0-dev to lowest supported
if: matrix.python-version == '3.9'
run: |
python -m pip install "numpy==1.22.4"
- name: Test SciPy
run: |
export OPENBLAS_NUM_THREADS=1
python dev.py test -j2 --mode full -- --cov --cov-report term-missing
python dev.py --no-build test -j2 --mode full -- --cov --cov-report term-missing
#################################################################################
linux_32bit:
Expand Down
2 changes: 1 addition & 1 deletion scipy/signal/tests/test_filter_design.py
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@ def test_invalid_input(self):
assert "gstop should be larger than 0.0" in str(exc_info.value)

def test_runtime_warnings(self):
msg = "Order is zero.*|divide by zero encountered in divide"
msg = "Order is zero.*|divide by zero encountered"
with pytest.warns(RuntimeWarning, match=msg):
buttord(0.0, 1.0, 3, 60)

Expand Down

0 comments on commit 906e6cd

Please sign in to comment.