Skip to content

Commit 72aa29a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into lmoment
2 parents 6bdf9f9 + 91a320b commit 72aa29a

File tree

805 files changed

+45153
-56389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

805 files changed

+45153
-56389
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,5 @@ ecef3490da68a0c53ba543c618bab0c8e15dccee
3636
7b921fd28659b02544bfb46368ddadd1048b37aa
3737
# Style cleanup to always `import numpy as np`
3838
ceafa8e730887b81cf10d483ce375559ebd1de09
39+
# Clean-up for UP031, UP032 lint rules (gh-21029)
40+
d1b5af016e907e037136b7a38e485437165490f2

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#checkli
55
66
Also, please name and describe your PR as you would write a
77
commit message:
8-
http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#writing-the-commit-message
8+
http://scipy.github.io/devdocs/dev/contributor/development_workflow.html#writing-the-commit-message.
9+
However, please only include an issue number in the description, not the title,
10+
and please ensure that any code names containing underscores are enclosed in backticks.
911
1012
Depending on your changes, you can skip CI operations and save time and energy:
1113
http://scipy.github.io/devdocs/dev/contributor/continuous_integration.html#skipping

.github/label-globs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ scipy.constants:
1111
- any-glob-to-any-file:
1212
- scipy/constants/**
1313

14+
scipy.differentiate:
15+
- changed-files:
16+
- any-glob-to-any-file:
17+
- scipy/differentiate/**
18+
1419
scipy.fft:
1520
- changed-files:
1621
- any-glob-to-any-file:
@@ -73,8 +78,11 @@ scipy.signal:
7378

7479
scipy.sparse:
7580
- changed-files:
76-
- any-glob-to-any-file:
81+
- all-globs-to-any-file:
7782
- scipy/sparse/**
83+
# don't match the `csgraph` or `linalg` submodules
84+
- '!scipy/sparse/csgraph/**'
85+
- '!scipy/sparse/linalg/**'
7886

7987
scipy.sparse.csgraph:
8088
- changed-files:

.github/workflows/array_api.yml

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ permissions:
1515
env:
1616
CCACHE_DIR: "${{ github.workspace }}/.ccache"
1717
INSTALLDIR: "build-install"
18+
XP_TESTS: >-
19+
-t scipy.cluster
20+
-t scipy.constants
21+
-t scipy.fft
22+
-t scipy.special.tests.test_support_alternative_backends
23+
-t scipy._lib.tests.test_array_api
24+
-t scipy._lib.tests.test__util
25+
-t scipy.differentiate.tests.test_differentiate
26+
-t scipy.integrate.tests.test_tanhsinh
27+
-t scipy.optimize.tests.test_chandrupatla
28+
-t scipy.stats
29+
-t scipy.ndimage
1830
1931
concurrency:
2032
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
@@ -93,11 +105,5 @@ jobs:
93105
- name: Test SciPy
94106
run: |
95107
export OMP_NUM_THREADS=2
96-
# expand as new modules are added
97-
python dev.py --no-build test -b all -s cluster -- --durations 3 --timeout=60
98-
python dev.py --no-build test -b all -s constants -- --durations 3 --timeout=60
99-
python dev.py --no-build test -b all -s fft -- --durations 3 --timeout=60
100-
python dev.py --no-build test -b all -t scipy.special.tests.test_support_alternative_backends -- --durations 3 --timeout=60
101-
python dev.py --no-build test -b all -t scipy._lib.tests.test_array_api -- --durations 3 --timeout=60
102-
python dev.py --no-build test -b all -t scipy._lib.tests.test__util -- --durations 3 --timeout=60
103-
python dev.py --no-build test -b all -s stats -- --durations 3 --timeout=60
108+
# expand as more modules are supported by adding to `XP_TESTS` above
109+
python dev.py --no-build test -b all $XP_TESTS -- --durations 3 --timeout=60

.github/workflows/free_threaded_wheels.yml

Lines changed: 66 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ jobs:
8282
buildplat:
8383
- [ubuntu-22.04, manylinux, x86_64, "", ""]
8484
- [ubuntu-22.04, musllinux, x86_64, "", ""]
85+
- [macos-12, macosx, x86_64, openblas, "10.9"]
86+
- [macos-13, macosx, x86_64, accelerate, "14.0"]
87+
# OpenBLAS builds with deployment target set to 12 are failing due
88+
# to relocation issues of gfortran dylibs
89+
# - [macos-14, macosx, arm64, openblas, "12.0"]
90+
- [macos-14, macosx, arm64, accelerate, "14.0"]
8591
# TODO: build scipy and set up Windows and MacOS
8692
# cibuildwheel does not yet support Mac for free-threaded python
8793
# windows is supported but numpy doesn't build on the image yet
@@ -103,8 +109,56 @@ jobs:
103109
with:
104110
python-version: "3.x"
105111

112+
- name: Setup macOS
113+
if: startsWith( matrix.buildplat[0], 'macos-' )
114+
run: |
115+
if [[ ${{ matrix.buildplat[3] }} == 'accelerate' ]]; then
116+
echo CIBW_CONFIG_SETTINGS=\"setup-args=-Dblas=accelerate\" >> "$GITHUB_ENV"
117+
# Always use preinstalled gfortran for Accelerate builds
118+
ln -s $(which gfortran-13) gfortran
119+
export PATH=$PWD:$PATH
120+
echo "PATH=$PATH" >> "$GITHUB_ENV"
121+
LIB_PATH=$(dirname $(gfortran --print-file-name libgfortran.dylib))
122+
fi
123+
if [[ ${{ matrix.buildplat[4] }} == '10.9' ]]; then
124+
# Newest version of Xcode that supports macOS 10.9
125+
XCODE_VER='13.4.1'
126+
else
127+
XCODE_VER='15.2'
128+
fi
129+
CIBW="sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app"
130+
echo "CIBW_BEFORE_ALL=$CIBW" >> $GITHUB_ENV
131+
# setting SDKROOT necessary when using the gfortran compiler
132+
# installed in cibw_before_build_macos.sh
133+
sudo xcode-select -s /Applications/Xcode_${XCODE_VER}.app
134+
CIBW="MACOSX_DEPLOYMENT_TARGET=${{ matrix.buildplat[4] }}\
135+
SDKROOT=$(xcrun --sdk macosx --show-sdk-path)\
136+
PKG_CONFIG_PATH=${{ github.workspace }}"
137+
echo "CIBW_ENVIRONMENT_MACOS=$CIBW" >> "$GITHUB_ENV"
138+
139+
echo "REPAIR_PATH=$LIB_PATH" >> "$GITHUB_ENV"
140+
141+
PREFIX=DYLD_LIBRARY_PATH="\$(dirname \$(gfortran --print-file-name libgfortran.dylib))"
142+
# remove libgfortran from location used for linking (if any), to
143+
# check wheel has bundled things correctly and all tests pass without
144+
# needing installed gfortran
145+
POSTFIX=" sudo rm -rf /opt/gfortran-darwin-x86_64-native &&\
146+
sudo rm -rf /usr/local/gfortran/lib"
147+
CIBW="$PREFIX delocate-listdeps -d {wheel} && echo "-----------" &&\
148+
$PREFIX delocate-wheel -v $EXCLUDE --require-archs \
149+
{delocate_archs} -w {dest_dir} {wheel} && echo "-----------" &&\
150+
delocate-listdeps -d {dest_dir}/*.whl && echo "-----------" &&\
151+
$POSTFIX"
152+
153+
# Rename x86 Accelerate wheel to test on macOS 13 runner
154+
if [[ ${{ matrix.buildplat[0] }} == 'macos-13' && ${{ matrix.buildplat[4] }} == '14.0' ]]; then
155+
CIBW+=" && mv {dest_dir}/\$(basename {wheel}) \
156+
{dest_dir}/\$(echo \$(basename {wheel}) | sed 's/14_0/13_0/')"
157+
fi
158+
echo "CIBW_REPAIR_WHEEL_COMMAND_MACOS=$CIBW" >> "$GITHUB_ENV"
159+
106160
- name: Build wheels
107-
uses: pypa/cibuildwheel@ba8be0d98853f5744f24e7f902c8adef7ae2e7f3 # v2.18.1
161+
uses: pypa/cibuildwheel@v2.20.0
108162
env:
109163
CIBW_PRERELEASE_PYTHONS: True
110164
CIBW_FREE_THREADED_SUPPORT: True
@@ -114,25 +168,29 @@ jobs:
114168
# cibw_before_build.sh when a released cython can build numpy
115169
CIBW_BUILD_FRONTEND: "pip; args: --no-build-isolation"
116170

171+
- name: Rename after test (macOS x86 Accelerate only)
172+
# Rename x86 Accelerate wheel back so it targets macOS >= 14
173+
if: matrix.buildplat[0] == 'macos-13' && matrix.buildplat[4] == '14.0'
174+
run: |
175+
mv ./wheelhouse/*.whl $(find ./wheelhouse -type f -name '*.whl' | sed 's/13_0/14_0/')
176+
117177
- uses: actions/upload-artifact@v4
118178
with:
119179
path: ./wheelhouse/*.whl
120180
name: ${{ matrix.python[0] }}-${{ matrix.buildplat[1] }}
121181
${{ matrix.buildplat[2] }} ${{ matrix.buildplat[3] }}
122182
${{ matrix.buildplat[4] }}
123183

124-
- uses: mamba-org/setup-micromamba@422500192359a097648154e8db4e39bdb6c6eed7
184+
- uses: conda-incubator/setup-miniconda@v3
125185
with:
126186
# for installation of anaconda-client, required for upload to
127187
# anaconda.org
188+
# default (and activated) environment name is test
128189
# Note that this step is *after* specific pythons have been used to
129190
# build and test the wheel
130-
# for installation of anaconda-client, for upload to anaconda.org
131-
# environment will be activated after creation, and in future bash steps
132-
init-shell: bash
133-
environment-name: upload-env
134-
create-args: >-
135-
anaconda-client
191+
auto-update-conda: true
192+
python-version: "3.10"
193+
miniconda-version: "latest"
136194

137195
- name: Upload wheels
138196
if: success()

.github/workflows/linux.yml

Lines changed: 10 additions & 13 deletions
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.12), fast, dev.py
29+
name: mypy (py3.10) & 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.12'] # this run will use python dev versions when available
39+
python-version: ['3.10', '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:
@@ -54,6 +54,7 @@ jobs:
5454
python-version: ${{ matrix.python-version }}
5555
cache: 'pip'
5656
cache-dependency-path: 'environment.yml'
57+
allow-prereleases: true
5758

5859
- name: Install Ubuntu dependencies
5960
run: |
@@ -67,7 +68,7 @@ jobs:
6768
python -m pip install numpy cython pytest pytest-xdist pytest-timeout pybind11 mpmath gmpy2 pythran ninja meson click rich-click doit pydevtool pooch hypothesis
6869
6970
- name: Install Python packages from repositories
70-
if: matrix.python-version == '3.12' # this run will use python dev versions when available
71+
if: matrix.python-version == '3.13-dev' # this run will use python dev versions when available
7172
run: |
7273
python -m pip install git+https://github.com/numpy/numpy.git
7374
python -m pip install ninja cython pytest pybind11 pytest-xdist pytest-timeout click rich-click doit pydevtool pooch hypothesis "setuptools<67.3"
@@ -123,6 +124,9 @@ jobs:
123124
python dev.py build --tags=runtime,python-runtime,devel,tests
124125
python tools/check_installation.py ${{ env.INSTALLDIR }}
125126
127+
- name: Check build-internal dependencies
128+
run: ninja -C build -t missingdeps
129+
126130
- name: Mypy
127131
if: matrix.python-version == '3.10'
128132
run: |
@@ -317,10 +321,7 @@ jobs:
317321
- name: Install Python packages
318322
run: |
319323
python -m pip install cython pythran ninja meson-python pybind11 click rich_click pydevtool
320-
# Note: matplotlib not installed here to avoid issues around numpy 2.0
321-
# (it can be put back after matplotlib has made a 2.0-compatible
322-
# release on PyPI.
323-
python -m pip install --pre --upgrade pytest pytest-cov pytest-xdist mpmath gmpy2 threadpoolctl pooch hypothesis
324+
python -m pip install --pre --upgrade pytest pytest-cov pytest-xdist mpmath gmpy2 threadpoolctl pooch hypothesis matplotlib
324325
python -m pip install -r requirements/openblas.txt
325326
# Install numpy last, to ensure we get nightly (avoid possible <2.0 constraints).
326327
python -m pip install --pre --upgrade --timeout=60 -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
@@ -471,13 +472,9 @@ jobs:
471472
- name: Install pre-release pip
472473
run: |
473474
pip install -U --pre pip
474-
# TODO: remove cython nightly install when cython does a release
475-
- name: Install nightly Cython
476-
run: |
477-
pip install git+https://github.com/cython/cython
478-
- name: Install nightly NumPy
475+
- name: Install nightly NumPy and Cython
479476
run: |
480-
pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple numpy
477+
pip install -i https://pypi.anaconda.org/scientific-python-nightly-wheels/simple cython numpy
481478
- name: Install Python dependencies
482479
run: |
483480
pip install git+https://github.com/serge-sans-paille/pythran
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Intel oneAPI tests
2+
3+
on:
4+
push:
5+
branches:
6+
- maintenance/**
7+
pull_request:
8+
branches:
9+
- main
10+
- maintenance/**
11+
12+
permissions:
13+
contents: read # to fetch code (actions/checkout)
14+
15+
# The environment variable LINUX_BASEKIT_URL and LINUX_HPCKIT_URL
16+
# store the URL for downloading Intel oneAPI.
17+
# Reference - https://github.com/oneapi-src/oneapi-ci/blob/b4a96bd1888c130fcb73524d2b77b90f43681cbc/.github/workflows/build_all.yml#L11-L12
18+
env:
19+
LINUX_BASEKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/9a98af19-1c68-46ce-9fdd-e249240c7c42/l_BaseKit_p_2024.2.0.634_offline.sh
20+
LINUX_HPCKIT_URL: https://registrationcenter-download.intel.com/akdlm/IRC_NAS/d4e49548-1492-45c9-b678-8268cb0f1b05/l_HPCKit_p_2024.2.0.635_offline.sh
21+
22+
concurrency:
23+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
24+
cancel-in-progress: true
25+
26+
jobs:
27+
get_commit_message:
28+
name: Get commit message
29+
uses: ./.github/workflows/commit_message.yml
30+
31+
icx_icpx_ifx_mkl:
32+
name: py3.12, dev.py
33+
needs: get_commit_message
34+
# Ensure (a) this doesn't run on forks by default, and
35+
# (b) it does run with Act locally (`github` doesn't exist there)
36+
if: >
37+
needs.get_commit_message.outputs.message == 1
38+
&& (github.repository == 'scipy/scipy' || github.repository == '')
39+
runs-on: ubuntu-24.04
40+
strategy:
41+
matrix:
42+
python-version: ["3.12"]
43+
44+
steps:
45+
- name: Checkout
46+
uses: actions/[email protected]
47+
with:
48+
submodules: recursive
49+
50+
- name: Setup Conda
51+
uses: conda-incubator/setup-miniconda@v3
52+
with:
53+
python-version: ${{ matrix.python-version }}
54+
channels: conda-forge
55+
channel-priority: true
56+
activate-environment: scipy-dev
57+
use-only-tar-bz2: false
58+
miniforge-variant: Mambaforge
59+
miniforge-version: latest
60+
use-mamba: true
61+
62+
- name: Update Conda Environment
63+
run: |
64+
mamba env update -n scipy-dev -f environment.yml
65+
66+
- name: cache install
67+
id: cache-install
68+
uses: actions/cache@v3
69+
with:
70+
path: |
71+
/opt/intel/oneapi/
72+
key: install-${{ env.LINUX_BASEKIT_URL }}-${{ env.LINUX_HPCKIT_URL }}-compiler
73+
- name: Install oneAPI Base kit
74+
if: steps.cache-install.outputs.cache-hit != 'true'
75+
run: |
76+
printenv LINUX_BASEKIT_URL
77+
bash tools/install_intel_oneAPI_linux.sh $LINUX_BASEKIT_URL
78+
- name: Install oneAPI HPC kit
79+
if: steps.cache-install.outputs.cache-hit != 'true'
80+
run: |
81+
printenv LINUX_HPCKIT_URL
82+
bash tools/install_intel_oneAPI_linux.sh $LINUX_HPCKIT_URL
83+
84+
- name: Initialise Intel oneAPI and Build SciPy
85+
shell: bash -l {0}
86+
run: |
87+
. /opt/intel/oneapi/setvars.sh --force
88+
conda activate scipy-dev
89+
conda remove -y compilers
90+
unset FFLAGS
91+
CC=icx CXX=icpx FC=ifx python dev.py build -C-Dblas=mkl-dynamic-lp64-iomp -C-Dlapack=mkl-dynamic-lp64-iomp
92+
93+
- name: Test scipy
94+
shell: bash -l {0}
95+
run: |
96+
. /opt/intel/oneapi/setvars.sh --force
97+
conda activate scipy-dev
98+
python dev.py test

0 commit comments

Comments
 (0)