Skip to content

Commit ab84560

Browse files
MAINT: bump min NumPy to 1.25.2, min Python to 3.11 (scipy#22012)
For the Linux `distro_multiple_pythons` CI job, also bump the base Ubuntu version so that we use Python 3.11 (non-default) and Python 3.12 (default). This required using the deadsnakes PPA, because the newer Ubuntu doesn't have multiple Python versions in its main package channel. Co-authored-by: Ralf Gommers <[email protected]>
1 parent 07eb0f4 commit ab84560

File tree

12 files changed

+46
-47
lines changed

12 files changed

+46
-47
lines changed

.github/workflows/linux.yml

+26-24
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
uses: ./.github/workflows/commit_message.yml
2727

2828
test_meson:
29-
name: mypy (py3.10) & dev deps (py3.13), fast, dev.py
29+
name: mypy (py3.11) & dev deps (py3.13), fast, dev.py
3030
needs: get_commit_message
3131
# If using act to run CI locally the github object does not exist and
3232
# the usual skipping should not be enforced
@@ -36,7 +36,7 @@ jobs:
3636
runs-on: ubuntu-22.04
3737
strategy:
3838
matrix:
39-
python-version: ['3.10', '3.13-dev'] # this run will use python dev versions when available
39+
python-version: ['3.11', '3.13-dev'] # this run will use python dev versions when available
4040
maintenance-branch:
4141
- ${{ contains(github.ref, 'maintenance/') || contains(github.base_ref, 'maintenance/') }}
4242
exclude:
@@ -63,7 +63,7 @@ jobs:
6363
sudo apt-get install -y libopenblas-dev libatlas-base-dev liblapack-dev gfortran libgmp-dev libmpfr-dev libsuitesparse-dev ccache libmpc-dev
6464
6565
- name: Install Python packages
66-
if: matrix.python-version == '3.10'
66+
if: matrix.python-version == '3.11'
6767
run: |
6868
python -m pip install numpy cython pytest pytest-xdist pytest-timeout pybind11 mpmath gmpy2 pythran ninja meson click rich-click doit pydevtool pooch hypothesis
6969
@@ -95,7 +95,7 @@ jobs:
9595
path: ${{ steps.prep-ccache.outputs.dir }}
9696
# Restores ccache from either a previous build on this branch or on main
9797
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-${{ steps.prep-ccache.outputs.timestamp }}
98-
# This evaluates to `Linux Tests-3.10-ccache-linux-` which is not unique. As the CI matrix is expanded, this will
98+
# This evaluates to `Linux Tests-3.11-ccache-linux-` which is not unique. As the CI matrix is expanded, this will
9999
# need to be updated to be unique so that the cache is not restored from a different job altogether.
100100
restore-keys: |
101101
${{ github.workflow }}-${{ matrix.python-version }}-ccache-linux-
@@ -128,7 +128,7 @@ jobs:
128128
run: ninja -C build -t missingdeps
129129

130130
- name: Mypy
131-
if: matrix.python-version == '3.10'
131+
if: matrix.python-version == '3.11'
132132
run: |
133133
# Packages that are only needed for their annotations
134134
python -m pip install mypy==1.10.0 types-psutil typing_extensions
@@ -148,7 +148,7 @@ jobs:
148148
if: >
149149
needs.get_commit_message.outputs.message == 1
150150
&& (github.repository == 'scipy/scipy' || github.repository == '')
151-
runs-on: ubuntu-22.04
151+
runs-on: ubuntu-24.04
152152
steps:
153153
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
154154
with:
@@ -202,12 +202,12 @@ jobs:
202202
#################################################################################
203203
python_debug:
204204
# also uses the vcs->sdist->wheel route.
205-
name: Python-debug & ATLAS & sdist+wheel, fast, py3.10/npMin, pip+pytest
205+
name: Python-debug & ATLAS & sdist+wheel, fast, py3.12/npMin, pip+pytest
206206
needs: get_commit_message
207207
if: >
208208
needs.get_commit_message.outputs.message == 1
209209
&& (github.repository == 'scipy/scipy' || github.repository == '')
210-
runs-on: ubuntu-22.04 # provides python3.10-dbg
210+
runs-on: ubuntu-24.04 # provides python3.12-dbg
211211
steps:
212212
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
213213
with:
@@ -232,7 +232,7 @@ jobs:
232232
#################################################################################
233233
gcc9:
234234
# Purpose is to examine builds with oldest-supported gcc and test with pydata/sparse.
235-
name: Oldest GCC & pydata/sparse, fast, py3.10/npMin, pip+pytest
235+
name: Oldest GCC & pydata/sparse, fast, py3.11/npMin, pip+pytest
236236
needs: get_commit_message
237237
if: >
238238
needs.get_commit_message.outputs.message == 1
@@ -246,7 +246,7 @@ jobs:
246246
- name: Setup Python
247247
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
248248
with:
249-
python-version: "3.10"
249+
python-version: "3.11"
250250

251251
- name: Setup system dependencies
252252
run: |
@@ -271,7 +271,7 @@ jobs:
271271
- name: Install test dependencies
272272
run: |
273273
# Downgrade numpy to oldest supported version
274-
pip install gmpy2 threadpoolctl mpmath pooch pytest pytest-xdist==2.5.0 pytest-timeout hypothesis sparse "numpy==1.23.5"
274+
pip install gmpy2 threadpoolctl mpmath pooch pytest pytest-xdist==2.5.0 pytest-timeout hypothesis sparse "numpy==1.25.2"
275275
276276
- name: Run tests
277277
run: |
@@ -284,17 +284,17 @@ jobs:
284284
#################################################################################
285285
prerelease_deps_coverage_64bit_blas:
286286
# TODO: re-enable ILP64 build.
287-
name: Prerelease deps & coverage report, full, py3.10/npMin & py3.11/npPre, dev.py
287+
name: Prerelease deps & coverage report, full, py3.11/npMin & py3.11/npPre, dev.py
288288
needs: get_commit_message
289289
if: >
290290
needs.get_commit_message.outputs.message == 1
291291
&& (github.repository == 'scipy/scipy' || github.repository == '')
292292
runs-on: ubuntu-latest
293293
strategy:
294294
matrix:
295-
# Both use numpy 2.x-dev at build time; 3.10 job then downgrades to
295+
# Both use numpy 2.x-dev at build time; 3.11 job then downgrades to
296296
# lowest supported NumPy version in order to test ABI compatibility.
297-
python-version: ['3.10', '3.11']
297+
python-version: ['3.11', '3.12']
298298

299299
steps:
300300
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -354,9 +354,9 @@ jobs:
354354
run: ccache -s
355355

356356
- name: Downgrade NumPy from 2.0-dev to lowest supported
357-
if: matrix.python-version == '3.10'
357+
if: matrix.python-version == '3.11'
358358
run: |
359-
python -m pip install "numpy==1.23.5"
359+
python -m pip install "numpy==1.25.2"
360360
361361
- name: Test SciPy
362362
run: |
@@ -365,7 +365,7 @@ jobs:
365365
366366
#################################################################################
367367
linux_32bit:
368-
name: 32-bit, fast, py3.10/npMin, dev.py
368+
name: 32-bit, fast, py3.11/npMin, dev.py
369369
needs: get_commit_message
370370
if: >
371371
needs.get_commit_message.outputs.message == 1
@@ -385,7 +385,7 @@ jobs:
385385
docker pull quay.io/pypa/manylinux2014_i686
386386
docker run -v $(pwd):/scipy --platform=linux/i386 quay.io/pypa/manylinux2014_i686 /bin/bash -c "cd /scipy && \
387387
uname -a && \
388-
python3.10 -m venv test && \
388+
python3.11 -m venv test && \
389389
source test/bin/activate && \
390390
python -m pip install doit click rich_click pydevtool meson ninja && \
391391
python -m pip install -r requirements/openblas.txt && \
@@ -398,7 +398,7 @@ jobs:
398398
runtime_library_dirs = \$(python -c 'import scipy_openblas32; print(scipy_openblas32.get_lib_dir())')
399399
symbol_prefix = scipy_
400400
EOL
401-
python -m pip install numpy==1.23.5 cython pybind11 pytest pytest-timeout pytest-xdist pytest-env 'Pillow<10.0.0' mpmath pythran pooch meson hypothesis && \
401+
python -m pip install numpy==1.25.2 cython pybind11 pytest pytest-timeout pytest-xdist pytest-env 'Pillow<10.0.0' mpmath pythran pooch meson hypothesis && \
402402
python -c 'import numpy as np; np.show_config()' && \
403403
python dev.py build --with-scipy-openblas && \
404404
python dev.py --no-build test"
@@ -408,12 +408,12 @@ jobs:
408408
# Purpose is to build for a non-default Python interpreter in a Linux distro
409409
# For such a build config, `python`/`python3` executables may not have
410410
# build dependencies like Cython or NumPy installed.
411-
name: non-default Python interpreter, fast, py3.10/npMin, pip+pytest
411+
name: non-default Python interpreter, fast, py3.11/npMin, pip+pytest
412412
needs: get_commit_message
413413
if: >
414414
needs.get_commit_message.outputs.message == 1
415415
&& (github.repository == 'scipy/scipy' || github.repository == '')
416-
runs-on: ubuntu-22.04
416+
runs-on: ubuntu-24.04
417417
steps:
418418
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
419419
with:
@@ -422,8 +422,10 @@ jobs:
422422
- name: Setup system dependencies
423423
run: |
424424
sudo apt-get -y update
425-
# `python3-dev` yields Python 3.10 on Ubuntu 22.04
426-
sudo apt install -y python3-dev python3.11-dev ninja-build pkg-config libatlas-base-dev liblapack-dev
425+
sudo apt install software-properties-common
426+
sudo add-apt-repository ppa:deadsnakes/ppa
427+
sudo apt update -y
428+
sudo apt install -y python3.11-dev ninja-build pkg-config libatlas-base-dev liblapack-dev
427429
428430
- name: Setup Python build deps
429431
run: |
@@ -437,7 +439,7 @@ jobs:
437439
- name: Install test dependencies
438440
run: |
439441
python3.11 -m pip install pytest hypothesis
440-
python3.10 -m pip install meson # ensure compile test work with this
442+
python3.12 -m pip install meson # ensure compile test work with this
441443
442444
- name: Run tests
443445
run: |

.github/workflows/macos.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
with:
6969
path: ${{ steps.prep-ccache.outputs.dir }}
7070
key: ${{ github.workflow }}-${{ matrix.python-version }}-ccache-macos-${{ steps.prep-ccache.outputs.timestamp }}
71-
# This evaluates to `macOS Tests-3.10-ccache-macos-` which is not
71+
# This evaluates to `macOS Tests-3.11-ccache-macos-` which is not
7272
# unique. As the CI matrix is expanded, this will need to be updated to
7373
# be unique so that the cache is not restored from a different job altogether.
7474
restore-keys: |

.github/workflows/musllinux.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
uses: ./.github/workflows/commit_message.yml
2525

2626
musllinux_x86_64:
27-
name: musl Ubuntu-latest, fast, py3.10/npAny, dev.py
27+
name: musl Ubuntu-latest, fast, py3.11/npAny, dev.py
2828
needs: get_commit_message
2929
runs-on: ubuntu-latest
3030
# If using act to run CI locally the github object does not exist and
@@ -57,7 +57,7 @@ jobs:
5757
git -c user.email="[email protected]" merge --no-commit my_ref_name
5858
fi
5959
60-
ln -s /usr/local/bin/python3.10 /usr/local/bin/python
60+
ln -s /usr/local/bin/python3.11 /usr/local/bin/python
6161
git submodule update --init
6262
6363

.github/workflows/wheels.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- [macos-14, macosx, arm64, openblas, "12.3"]
8989
- [macos-14, macosx, arm64, accelerate, "14.0"]
9090
- [windows-2019, win, AMD64, "", ""]
91-
python: [["cp310", "3.10"], ["cp311", "3.11"], ["cp312", "3.12"], ["cp313", "3.13"], ["cp313t", "3.13"]]
91+
python: [["cp311", "3.11"], ["cp312", "3.12"], ["cp313", "3.13"], ["cp313t", "3.13"]]
9292
# python[0] is used to specify the python versions made by cibuildwheel
9393

9494
env:
@@ -243,7 +243,7 @@ jobs:
243243
# Note that this step is *after* specific pythons have been used to
244244
# build and test the wheel
245245
auto-update-conda: true
246-
python-version: "3.10"
246+
python-version: "3.11"
247247
miniforge-version: latest
248248
conda-remove-defaults: "true"
249249

.github/workflows/windows.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ jobs:
6565
6666
#############################################################################
6767
full_dev_py_min_numpy_fail_slow:
68-
name: fail slow, full, py3.10/npMin, dev.py
68+
name: fail slow, full, py3.11/npMin, dev.py
6969
needs: get_commit_message
7070
if: >
7171
needs.get_commit_message.outputs.message == 1
@@ -79,7 +79,7 @@ jobs:
7979
- name: Setup Python
8080
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
8181
with:
82-
python-version: '3.10'
82+
python-version: '3.11'
8383
cache: 'pip'
8484
cache-dependency-path: 'environment.yml'
8585

@@ -90,9 +90,8 @@ jobs:
9090
9191
- name: pip-packages
9292
run: |
93-
# 1.23.5 is currently the oldest numpy usable on cp3.10 according
94-
# to pyproject.toml
95-
python -m pip install numpy==1.23.5 cython pybind11 pythran meson-python meson ninja pytest pytest-xdist pytest-timeout pytest-fail-slow pooch rich_click click doit pydevtool hypothesis
93+
# 1.25.2 is currently our oldest supported NumPy version
94+
python -m pip install numpy==1.25.2 cython pybind11 pythran meson-python meson ninja pytest pytest-xdist pytest-timeout pytest-fail-slow pooch rich_click click doit pydevtool hypothesis
9695
python -m pip install -r requirements/openblas.txt
9796
9897
- name: Build

dev.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ def __init__(self, args=None):
310310
self.installed = self.build.parent / (self.build.stem + "-install")
311311

312312
# relative path for site-package with py version
313-
# i.e. 'lib/python3.10/site-packages'
313+
# i.e. 'lib/python3.11/site-packages'
314314
self.site = self.get_site_packages()
315315

316316
def add_sys_path(self):
@@ -1449,7 +1449,7 @@ class ShowDirs(Python):
14491449
14501450
PYTHONPATH sets the default search path for module files for the
14511451
interpreter. Here, it includes the path to the local SciPy build
1452-
(typically `.../build-install/lib/python3.10/site-packages`).
1452+
(typically `.../build-install/lib/python3.11/site-packages`).
14531453
14541454
Use the global option `-n` to skip the building step, e.g.:
14551455
`python dev.py -n show_PYTHONPATH`
@@ -1544,8 +1544,7 @@ def cpu_count(only_physical_cores=False):
15441544
or the LOKY_MAX_CPU_COUNT environment variable. If the number of physical
15451545
cores is not found, return the number of logical cores.
15461546
1547-
Note that on Windows, the returned number of CPUs cannot exceed 61 (or 60 for
1548-
Python < 3.10), see:
1547+
Note that on Windows, the returned number of CPUs cannot exceed 61, see:
15491548
https://bugs.python.org/issue26903.
15501549
15511550
It is also always larger or equal to 1.

meson.build

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ project(
1717
py3 = import('python').find_installation(pure: false)
1818
py3_dep = py3.dependency()
1919

20-
min_numpy_version = '1.23.5' # keep in sync with pyproject.toml
20+
min_numpy_version = '1.25.2' # keep in sync with pyproject.toml
2121

2222
# Emit a warning for 32-bit Python installs on Windows; users are getting
2323
# unexpected from-source builds there because we no longer provide wheels.

pyproject.toml

+2-3
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,9 @@ maintainers = [
4444
# Note: Python and NumPy upper version bounds should be set correctly in
4545
# release branches, see:
4646
# https://scipy.github.io/devdocs/dev/core-dev/index.html#version-ranges-for-numpy-and-other-dependencies
47-
requires-python = ">=3.10"
47+
requires-python = ">=3.11"
4848
dependencies = [
49-
"numpy>=1.23.5",
49+
"numpy>=1.25.2",
5050
] # keep in sync with `min_numpy_version` in meson.build
5151
readme = "README.rst"
5252
classifiers = [
@@ -57,7 +57,6 @@ classifiers = [
5757
"Programming Language :: C",
5858
"Programming Language :: Python",
5959
"Programming Language :: Python :: 3",
60-
"Programming Language :: Python :: 3.10",
6160
"Programming Language :: Python :: 3.11",
6261
"Programming Language :: Python :: 3.12",
6362
"Programming Language :: Python :: 3.13",

requirements/build.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ Cython>=3.0.8
55
pybind11>=2.13.2
66
pythran>=0.14.0
77
ninja
8-
numpy>=1.23.5
8+
numpy>=1.25.2

requirements/default.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Generated via tools/generate_requirements.py.
22
# Do not edit this file; modify `pyproject.toml` instead and run `python tools/generate_requirements.py`.
3-
numpy>=1.23.5
3+
numpy>=1.25.2

scipy/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363

6464
from scipy._lib import _pep440
6565
# In maintenance branch, change to np_maxversion N+3 if numpy is at N
66-
np_minversion = '1.23.5'
66+
np_minversion = '1.25.2'
6767
np_maxversion = '9.9.99'
6868
if (_pep440.parse(__numpy_version__) < _pep440.Version(np_minversion) or
6969
_pep440.parse(__numpy_version__) >= _pep440.Version(np_maxversion)):

tools/lint.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ force-exclude = true
88

99
line-length = 88
1010

11-
# Assume Python 3.10
12-
target-version = "py310"
11+
# Assume Python 3.11
12+
target-version = "py311"
1313

1414
[lint]
1515
# Enable Pyflakes `E` and `F` and PyUpgrade `UP` codes by default.

0 commit comments

Comments
 (0)