Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
d91d593
Port initial SciPy 1.15 patches
agriyakhetarpal Jun 29, 2025
fb47341
Update patch registry for SciPy 1.15
agriyakhetarpal Jun 29, 2025
a27718d
Bump to SciPy 1.16
agriyakhetarpal Jun 29, 2025
6e8840e
Drop MVNDST patch
agriyakhetarpal Jun 29, 2025
e0d627a
Don't link COBYLA, SLSQP, and MVN with OpenBLAS
agriyakhetarpal Jun 29, 2025
ff7e366
Drop test Fortran modules, reorder f2py-gen patch
agriyakhetarpal Jun 29, 2025
cbe09a8
The `sf_error_state_lib` module no longer exists
agriyakhetarpal Jun 29, 2025
79c45cf
Refresh LARFG function signature patch
agriyakhetarpal Jun 29, 2025
f6f428e
Port ARPACK C-rewrite as a patch
agriyakhetarpal Jun 29, 2025
36ef800
Remove some more f2py generators
agriyakhetarpal Jun 29, 2025
fb82c26
Fix invalid patch for ARPACK that's valid on macOS
agriyakhetarpal Jun 29, 2025
25279a7
Use `numpy.f2py` to call f2py-based custom targets
agriyakhetarpal Jun 29, 2025
dea5c54
Fix alternate returns for linalg array utils
agriyakhetarpal Jun 29, 2025
efe0f6c
More patching for FITPACK
agriyakhetarpal Jun 29, 2025
fb05300
Update signatures for NNLS and SLSQP
agriyakhetarpal Jun 29, 2025
eaea9cf
Update signatures for ARPACK
agriyakhetarpal Jun 29, 2025
03319d1
Update signatures for `_matfuncs_*` modules
agriyakhetarpal Jun 29, 2025
a485397
Update signatures for L-BFGS-B module headers
agriyakhetarpal Jun 29, 2025
e9a929a
Add `pyodide-build` with my branch as a submodule
agriyakhetarpal Jun 29, 2025
bcad9e9
Merge branch 'main' into scipy-1.16
agriyakhetarpal Jun 30, 2025
e9ec1d7
Merge branch 'main' into scipy-1.16
agriyakhetarpal Jun 30, 2025
ac43262
Update pyodide-build submodule
agriyakhetarpal Jun 30, 2025
b96b5d4
Merge branch 'main' into scipy-1.16
agriyakhetarpal Jun 30, 2025
6032858
Merge main
agriyakhetarpal Jul 2, 2025
541ed5b
Use debug xbuildenv from 20250703
agriyakhetarpal Jul 3, 2025
96b2431
Merge branch 'main' into scipy-1.16
ryanking13 Jul 15, 2025
8e265d8
Update to xbuildenvs from 20th August
agriyakhetarpal Aug 23, 2025
6de0fa8
Run tests in `pyodide venv` instead of `node`
agriyakhetarpal Aug 23, 2025
3797abf
Handle `unvendor-tests:` key when testing SciPy
agriyakhetarpal Aug 23, 2025
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
60 changes: 44 additions & 16 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ jobs:
# No changed recipes
if [ "$SCIPY_WILL_BE_TESTED" == "true" ]; then
echo "recipes=tag:core,scipy" >> "$GITHUB_OUTPUT"
sed -i 's/unvendor-tests: true/unvendor-tests: false/' packages/scipy/meta.yaml
echo "Building: tag:core,scipy (no changes + scipy trigger)"
else
echo "recipes=tag:core" >> "$GITHUB_OUTPUT"
Expand All @@ -211,9 +212,11 @@ jobs:
# Check if scipy is already in changed recipes to avoid duplication
if [[ "$CHANGED_RECIPES" == *"scipy"* ]]; then
echo "recipes=$CHANGED_RECIPES,tag:core" >> "$GITHUB_OUTPUT"
sed -i 's/unvendor-tests: true/unvendor-tests: false/' packages/scipy/meta.yaml
echo "Building: $CHANGED_RECIPES,tag:core (scipy already included in changes)"
else
echo "recipes=$CHANGED_RECIPES,tag:core,scipy" >> "$GITHUB_OUTPUT"
sed -i 's/unvendor-tests: true/unvendor-tests: false/' packages/scipy/meta.yaml
echo "Building: $CHANGED_RECIPES,tag:core,scipy (changes + scipy trigger)"
fi
else
Expand Down Expand Up @@ -443,30 +446,55 @@ jobs:
with:
node-version: "24"

- name: Prepare SciPy test environment
# - name: Prepare SciPy test environment
# run: |
# # First, install any version of pyodide from npm
# # to get the file structure
# npm install pyodide

# # Copy the Pyodide runtime to the dist folder
# ./tools/copy_pyodide_runtime.sh ./dist

# # Copy the Pyodide files from the dist folder to the
# # node_modules/pyodide folder, so that the SciPy tests
# # can find them
# cp -f dist/* node_modules/pyodide

# # Delete conftest.py from repo root to avoid conflicts
# rm -rf conftest.py

# # Change scipy-conftest.py to conftest.py as pytest
# # doesn't seem to recognise it otherwise
# mv packages/scipy/scipy-conftest.py packages/scipy/conftest.py

# - name: Run SciPy test suite
# run: node scipy-pytest.js --pyargs scipy -m "not slow" -vra
# working-directory: packages/scipy/

- name: Prepare SciPy test suite
run: |
# First, install any version of pyodide from npm
# to get the file structure
npm install pyodide
pyodide venv .venv-pyodide
source .venv-pyodide/bin/activate

# Copy the Pyodide runtime to the dist folder
./tools/copy_pyodide_runtime.sh ./dist
pip install pytest hypothesis pooch lzma
pip install dist/scipy-*.whl

# Copy the Pyodide files from the dist folder to the
# node_modules/pyodide folder, so that the SciPy tests
# can find them
cp -f dist/* node_modules/pyodide
- name: Remove problematic SciPy test files
run: |
find .venv-pyodide -name "test_fortran.py" -delete
find .venv-pyodide -name "test_odeint_jac.py" -delete
find .venv-pyodide/lib/python*/site-packages/scipy -name "pytest.ini" -delete

# Delete conftest.py from repo root to avoid conflicts
- name: Copy test config files
run: |
rm -rf conftest.py

# Change scipy-conftest.py to conftest.py as pytest
# doesn't seem to recognise it otherwise
mv packages/scipy/scipy-conftest.py packages/scipy/conftest.py

- name: Run SciPy test suite
run: node scipy-pytest.js --pyargs scipy -m "not slow" -vra
working-directory: packages/scipy/
run: |
source .venv-pyodide/bin/activate
cd packages/scipy
pytest -vra --pyargs scipy

release:
runs-on: ubuntu-latest
Expand Down
52 changes: 36 additions & 16 deletions packages/scipy/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package:
name: scipy
version: 1.14.1
pinned: true
version: 1.16.0
tag:
- min-scipy-stack
top-level:
Expand All @@ -18,8 +17,8 @@ package:
# subroutine. Try deleting it.

source:
url: https://files.pythonhosted.org/packages/62/11/4d44a1f274e002784e4dbdb81e0ea96d2de2d1045b2132d5af62cc31fd28/scipy-1.14.1.tar.gz
sha256: 5a275584e726026a5699459aa72f828a610821006228e841b94275c4a7c08417
url: https://files.pythonhosted.org/packages/source/s/scipy/scipy-1.16.0.tar.gz
sha256: b5ef54021e832869c8cfb03bc3bf20366cbcd426e02a58e8a58d7584dfbb8f62

patches:
- patches/0001-Fix-dstevr-in-special-lapack_defs.h.patch
Expand All @@ -28,18 +27,14 @@ source:
- patches/0004-make-int-return-values.patch
- patches/0005-Fix-fitpack.patch
- patches/0006-Fix-gees-calls.patch
- patches/0007-MAINT-linalg-Remove-id_dist-Fortran-files.patch
- patches/0008-Mark-mvndst-functions-recursive.patch
- patches/0009-Make-sreorth-recursive.patch
- patches/0010-Link-openblas-with-modules-that-require-f2c.patch
- patches/0011-Remove-fpchec-inline-if-then-endif-constructs.patch # remove with SciPy v1.15.0
- patches/0012-Remove-chla_transtype.patch
- patches/0013-Set-wrapper-return-type-to-int.patch
- patches/0014-Skip-svd_gesdd-test.patch # remove with SciPy v1.15.0
- patches/0015-Remove-f2py-generators.patch
- patches/0016-Make-sf_error_state_lib-a-static-library.patch
- patches/0017-Remove-test-modules-that-fail-to-build.patch
- patches/0018-Fix-lapack-larfg-function-signature.patch
- patches/0007-Make-sreorth-recursive.patch
- patches/0008-Link-openblas-with-modules-that-require-f2c.patch
- patches/0009-Remove-chla_transtype.patch
- patches/0010-Set-wrapper-return-type-to-int.patch
- patches/0011-Remove-test-modules-that-fail-to-build.patch
- patches/0012-Fix-lapack-larfg-function-signature.patch
- patches/0013-ENH-MAINT-sparse.linalg-rewrite-ARPACK-in-C-22748.patch
- patches/0014-Remove-f2py-generators.patch

build:
# NumPy 2.1 disabled visibility for symbols outside of extension modules
Expand Down Expand Up @@ -98,7 +93,12 @@ build:
sed -i 's/extern void/extern int/g' scipy/optimize/__minpack.h
sed -i 's/void/int/g' scipy/linalg/cython_blas_signatures.txt
sed -i 's/void/int/g' scipy/linalg/cython_lapack_signatures.txt
sed -i 's/^void/int/g' scipy/linalg/_common_array_utils.h

sed -i 's/^void/int/g' scipy/interpolate/src/_fitpackmodule.c
sed -i 's/^void/int/g' scipy/interpolate/src/__fitpack.h
sed -i 's/^void/int/g' scipy/interpolate/src/__fitpack.cc
sed -i 's/void BLAS_FUNC/int BLAS_FUNC/g' scipy/interpolate/src/__fitpack.h

sed -i 's/extern void/extern int/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
sed -i 's/PUBLIC void/PUBLIC int/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
Expand All @@ -107,16 +107,36 @@ build:
sed -i 's/void \(.\)print/int \1/g' scipy/sparse/linalg/_dsolve/SuperLU/SRC/*.{c,h}
sed -i 's/TYPE_GENERIC_FUNC(\(.*\), void)/TYPE_GENERIC_FUNC(\1, int)/g' scipy/sparse/linalg/_dsolve/_superluobject.h

sed -i 's/^void/int/g' scipy/optimize/__nnls.h
sed -i 's/^void/int/g' scipy/optimize/__nnls.c
sed -i 's/^void/int/g' scipy/optimize/__slsqp.h
sed -i 's/^void/int/g' scipy/optimize/__slsqp.c
sed -i 's/^static void/static int/g' scipy/optimize/__slsqp.c

sed -i 's/^void/int/g' scipy/optimize/_trlib/trlib_private.h
sed -i 's/^void/int/g' scipy/optimize/_trlib/trlib/trlib_private.h
sed -i 's/^void/int/g' scipy/_build_utils/src/wrap_dummy_g77_abi.c
sed -i 's/, int)/)/g' scipy/optimize/_trlib/trlib_private.h
sed -i 's/, 1)/)/g' scipy/optimize/_trlib/trlib_private.h

sed -i 's/^void/int/g' scipy/linalg/_matfuncs_expm.h
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_expm.c
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_sqrtm.h
sed -i 's/^void/int/g' scipy/linalg/_matfuncs_sqrtm.c

sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_double_complex.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_double.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_single_complex.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_n_single.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_s_double.h
sed -i 's/^void/int/g' scipy/sparse/linalg/_eigen/arpack/ARPACK/_arpack_s_single.h

sed -i 's/^void/int/g' scipy/spatial/qhull_misc.h
sed -i 's/, size_t)/)/g' scipy/spatial/qhull_misc.h
sed -i 's/,1)/)/g' scipy/spatial/qhull_misc.h

sed -i 's/^void/int/g' scipy/optimize/__lbfgsb.h

# Input error causes "duplicate symbol" linker errors. Empty out the file.
echo "" > scipy/sparse/linalg/_dsolve/SuperLU/SRC/input_error.c

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 45a31145679c83f2719b6420f234d484b9459697 Mon Sep 17 00:00:00 2001
From: Hood Chatham <[email protected]>
Date: Fri, 18 Mar 2022 16:25:39 -0700
Subject: [PATCH 1/18] Fix dstevr in special/lapack_defs.h
Subject: [PATCH 1/14] Fix dstevr in special/lapack_defs.h

---
scipy/special/lapack_defs.h | 5 ++---
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0002-int-to-string.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From d53ade3f03ba3557fd50fb38990d605f4ae7f8f1 Mon Sep 17 00:00:00 2001
From: Hood Chatham <[email protected]>
Date: Sat, 25 Dec 2021 18:04:18 -0800
Subject: [PATCH 2/18] int to string
Subject: [PATCH 2/14] int to string

f2c does not handle implicit casts of function arguments correctly. The msg
argument of `xerrwv` is defined to be an `int *`, and then implicitly cast
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0003-gemm_-no-const.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From e528227dd37c8b0512381992c222789a114e3169 Mon Sep 17 00:00:00 2001
From: Hood Chatham <[email protected]>
Date: Sat, 18 Dec 2021 11:41:15 -0800
Subject: [PATCH 3/18] gemm_ no const
Subject: [PATCH 3/14] gemm_ no const

cgemm, dgemm, sgemm, and zgemm are declared with `const` in slu_cdefs.h, but
other places don't have the cosnt causing compile errors.
Expand Down
15 changes: 7 additions & 8 deletions packages/scipy/patches/0004-make-int-return-values.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From a86a2304fd925f815bbb0e0753e46a7b863e2de2 Mon Sep 17 00:00:00 2001
From: Joe Marshall <[email protected]>
Date: Wed, 6 Apr 2022 21:25:13 -0700
Subject: [PATCH 4/18] make int return values
Subject: [PATCH 4/14] make int return values

The return values of f2c functions are insignificant in most cases, so often it
is treated as returning void, when it really should return int (values are
Expand Down Expand Up @@ -240,21 +240,20 @@ index 67e83bcc77..e5757d5c4d 100644

/* Macro definitions */
diff --git a/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h b/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
index 83be8c971f..047a07ce9c 100644
index 1e53fbca5..b35313ccb 100644
--- a/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
+++ b/scipy/sparse/linalg/_dsolve/SuperLU/SRC/slu_scomplex.h
@@ -27,8 +27,9 @@ at the top-level directory.

@@ -28,7 +28,9 @@ at the top-level directory.
#ifndef SCOMPLEX_INCLUDE
#define SCOMPLEX_INCLUDE
-
-typedef struct { float r, i; } singlecomplex;
+#include"scipy_slu_config.h"
+#include "scipy_slu_config.h"
+// defined in CLAPACK
+//typedef struct { float r, i; } singlecomplex;


/* Macro definitions */
#if defined(SUPERLU_TYPEDEF_COMPLEX) || DOXYGEN
//! \brief backward compatibility with older versions of SuperLU
diff --git a/scipy/sparse/linalg/_dsolve/_superlu_utils.c b/scipy/sparse/linalg/_dsolve/_superlu_utils.c
index 49b928a431..0822687719 100644
--- a/scipy/sparse/linalg/_dsolve/_superlu_utils.c
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0005-Fix-fitpack.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From c784d3a1ee38da88943364de4ea847a3b9cd155f Mon Sep 17 00:00:00 2001
From: Hood Chatham <[email protected]>
Date: Tue, 30 Aug 2022 11:51:53 -0700
Subject: [PATCH 5/18] Fix fitpack
Subject: [PATCH 5/14] Fix fitpack

---
scipy/interpolate/fitpack/dblint.f | 9 ++++-----
Expand Down
2 changes: 1 addition & 1 deletion packages/scipy/patches/0006-Fix-gees-calls.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 8addc1da35bc63df651946ef14c723797a431e0c Mon Sep 17 00:00:00 2001
From: Hood Chatham <[email protected]>
Date: Mon, 26 Jun 2023 20:12:25 -0700
Subject: [PATCH 6/18] Fix gees calls
Subject: [PATCH 6/14] Fix gees calls

---
scipy/linalg/flapack_gen.pyf.src | 8 ++++----
Expand Down
Loading
Loading