From 78288e18a6182ec5a6a5b0effc040f5fed215559 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 18:58:01 -0600 Subject: [PATCH 01/12] Update to 1.11.3 --- .gitignore | 1 + ...445b6439f3ce7bffc4cf11c6407c39faedc5.patch | 63 ------------------- scipy.spec | 22 ++++--- sources | 2 +- 4 files changed, 17 insertions(+), 71 deletions(-) delete mode 100644 3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch diff --git a/.gitignore b/.gitignore index 3acee5a..9f943ed 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,4 @@ scipy-0.7.2.tar.gz /scipy-1.10.0.tar.gz /scipy-1.10.1.tar.gz /scipy-1.11.1.tar.gz +/scipy-1.11.3.tar.gz diff --git a/3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch b/3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch deleted file mode 100644 index 87b3c3f..0000000 --- a/3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 3c89445b6439f3ce7bffc4cf11c6407c39faedc5 Mon Sep 17 00:00:00 2001 -From: Matus Valo -Date: Thu, 6 Jul 2023 16:55:25 +0200 -Subject: [PATCH] BLD: copy `cython_optimize.pxd` to build dir (#18810) - -Closes gh-18792 - -[skip cirrus] [skip circle] - ---------- - -Co-authored-by: Ralf Gommers ---- - scipy/optimize/cython_optimize.pxd | 2 +- - scipy/optimize/cython_optimize/meson.build | 1 + - scipy/optimize/meson.build | 8 +++++++- - 3 files changed, 9 insertions(+), 2 deletions(-) - -diff --git a/scipy/optimize/cython_optimize.pxd b/scipy/optimize/cython_optimize.pxd -index d5a0bdd758e0..d35f8da68b34 100644 ---- a/scipy/optimize/cython_optimize.pxd -+++ b/scipy/optimize/cython_optimize.pxd -@@ -7,5 +7,5 @@ - # support. Changing it causes an ABI forward-compatibility break - # (gh-11793), so we currently leave it as is (no further cimport - # statements should be used in this file). --from .cython_optimize._zeros cimport ( -+from scipy.optimize.cython_optimize._zeros cimport ( - brentq, brenth, ridder, bisect, zeros_full_output) -diff --git a/scipy/optimize/cython_optimize/meson.build b/scipy/optimize/cython_optimize/meson.build -index 359ea8418ba3..ee8def39b4d3 100644 ---- a/scipy/optimize/cython_optimize/meson.build -+++ b/scipy/optimize/cython_optimize/meson.build -@@ -17,6 +17,7 @@ cy_opt_gen = generator(cython, - arguments : cython_args, - output : '@BASENAME@.c', - depends : [_cython_tree, -+ cython_optimize_pxd, - _dummy_init_optimize, - _dummy_init_cyoptimize]) - -diff --git a/scipy/optimize/meson.build b/scipy/optimize/meson.build -index 26458b05cd70..4c5ab798316b 100644 ---- a/scipy/optimize/meson.build -+++ b/scipy/optimize/meson.build -@@ -206,10 +206,16 @@ endif - - _dummy_init_optimize = fs.copyfile('__init__.py') - -+# Copying this .pxd file is only needed because of a Cython bug, see -+# discussion on SciPy PR gh-18810. -+cython_optimize_pxd = [ -+ fs.copyfile('cython_optimize.pxd'), -+] -+ - opt_gen = generator(cython, - arguments : cython_args, - output : '@BASENAME@.c', -- depends : [_cython_tree, cython_blas_pxd, _dummy_init_optimize]) -+ depends : [_cython_tree, cython_blas_pxd, cython_optimize_pxd, _dummy_init_optimize]) - - _bglu_dense_c = opt_gen.process('_bglu_dense.pyx') - diff --git a/scipy.spec b/scipy.spec index 5a1fc11..9eadaf1 100644 --- a/scipy.spec +++ b/scipy.spec @@ -24,7 +24,7 @@ Summary: Scientific Tools for Python Name: scipy -Version: 1.11.1 +Version: 1.11.3 Release: 1%{?dist} # BSD -- whole package except: @@ -34,9 +34,6 @@ License: BSD and Boost and Public Domain Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz -# Fix build failure with Cython 3 when scipy is already installed -Patch: https://github.com/scipy/scipy/commit/3c89445b6439f3ce7bffc4cf11c6407c39faedc5.patch - BuildRequires: fftw-devel, suitesparse-devel BuildRequires: %{blaslib}-devel BuildRequires: gcc-gfortran, swig, gcc-c++ @@ -118,10 +115,17 @@ library_dirs = %{_libdir} EOF # Docs won't build unless the .dat files are specified here -sed -i 's/metadata = dict(/metadata = dict(package_data={"": ["*.dat"]},/' setup.py +sed -i 's/metadata = dict(/metadata = dict(package_data={"": ["*.dat"]},/' _setup.py rm $(grep -rl '/\* Generated by Cython') PKG-INFO +# numpy no longer contains a copy of distutils +for f in $(grep -Frl numpy.distutils); do + sed -i.orig 's/numpy\.\(distutils\)/\1/g' $f + touch -r $f.orig $f + rm $f.orig +done + %build export SCIPY_USE_PYTHRAN=0%{?with_pythran} @@ -134,7 +138,7 @@ for PY in %{python3_version}; do FFLAGS="$RPM_OPT_FLAGS -fPIC" \ %endif LDFLAGS="%{__global_ldflags}" \ - %{_bindir}/python$PY setup.py config_fc \ + %{_bindir}/python$PY _setup.py config_fc \ --fcompiler=gnu95 --noarch \ build @@ -228,7 +232,7 @@ pushd %{buildroot}/%{python3_sitearch} %{pytest} --timeout=${TIMEOUT} scipy %{?!rhel:--numprocesses=auto} # Remove test remnants rm -rf gram{A,B} -rm -rf scipy/.pytest_cache +rm -rf .pytest_cache popd %files -n python3-scipy @@ -253,6 +257,10 @@ popd %endif %changelog +* Wed Oct 11 2023 Jerry James - 1.11.3-1 +- New upstream release 1.11.3 + resolves: #2211813 + * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 resolves: #2211813 diff --git a/sources b/sources index c884f84..366df92 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (scipy-1.11.1.tar.gz) = 049c9061ccbf101e6f93e055f905616bc7775fbc51c3af99d8533aedc828c5e55d525ccd98b7299280ed706f3298975f28127de9b66809dfe198b0cc4fef466b +SHA512 (scipy-1.11.3.tar.gz) = 6491c4e479d9f4f02e677396a25ddca947a0dc6c009fc2ec34c658012a6224c0b535f14045bb011fbde9973ea987d184574ed64e6760c31798ec860eb0896fcf From 1999f77f847634738f3d6d30962db9e41ffd2cd0 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 19:24:43 -0600 Subject: [PATCH 02/12] Convert License tag to SPDX --- scipy.spec | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/scipy.spec b/scipy.spec index 9eadaf1..8829a57 100644 --- a/scipy.spec +++ b/scipy.spec @@ -27,10 +27,26 @@ Name: scipy Version: 1.11.3 Release: 1%{?dist} -# BSD -- whole package except: -# Boost -- scipy/special/cephes/scipy_iv.c -# Public Domain -- scipy/odr/__odrpack.c -License: BSD and Boost and Public Domain +# BSD-3-Clause -- whole package except: +# BSD-2-Clause -- scipy/_lib/_pep440.py +# scipy/_lib/decorator.py +# scipy/optimize/lbfgsb_src +# scipy/special/_ellip_harm.pxd +# MIT -- scipy/cluster/_optimal_leaf_ordering.pyx +# scipy/io/_idl.py +# scipy/linalg/_basic.py (in part) +# scipy/optimize/_highs +# scipy/optimize/_lbfgsb_py.py +# scipy/optimize/_tnc.py +# scipy/optimize/_trlib +# scipy/optimize/tnc +# scipy/special/Faddeeva.{cc,hh} +# BSL-1.0 -- scipy/_lib/boost_math +# scipy/special/cephes +# Boehm-GC -- scipy/sparse/linalg/_dsolve/SuperLU +# Qhull -- scipy/spatial/qhull_src +# LicenseRef-Fedora-Public-Domain -- scipy/odr/__odrpack.c +License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 AND Boehm-GC AND Qhull AND LicenseRef-Fedora-Public-Domain Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz @@ -236,7 +252,7 @@ rm -rf .pytest_cache popd %files -n python3-scipy -%doc LICENSE.txt +%license LICENSE.txt %{python3_sitearch}/scipy/ %{python3_sitearch}/*.egg-info %exclude %{python3_sitearch}/scipy/*/tests/ @@ -260,6 +276,7 @@ popd * Wed Oct 11 2023 Jerry James - 1.11.3-1 - New upstream release 1.11.3 resolves: #2211813 +- Convert License tag to SPDX * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From c740f2b0fe36ce3365c7a66ff16facb1225b8b55 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 19:24:58 -0600 Subject: [PATCH 03/12] Add Provides for bundled projects --- scipy.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scipy.spec b/scipy.spec index 8829a57..40911df 100644 --- a/scipy.spec +++ b/scipy.spec @@ -94,6 +94,20 @@ leading scientists and engineers.} Summary: Scientific Tools for Python Requires: python3-numpy, python3-f2py, python3-pooch %{?python_provide:%python_provide python3-scipy} +Provides: bundled(arpack) = 3.3.0 +Provides: bundled(biasedurn) +Provides: bundled(boost-math) +Provides: bundled(coin-or-HiGHS) = 1.2 +Provides: bundled(Faddeeva) +Provides: bundled(id) +Provides: bundled(l-bfgs-b) = 3.0 +Provides: bundled(LAPJVsp) +Provides: bundled(python3-decorator) = 4.0.5 +Provides: bundled(python3-pep440) +Provides: bundled(python3-pypocketfft) = bf2c431c21213b7c5e23c2f542009b0bd3ec1445 +Provides: bundled(qhull) = 2019.1 +Provides: bundled(SuperLU) = 5.2.0 +Provides: bundled(unuran) = 1.8.1 %description -n python3-scipy %_description %if %{with doc} @@ -277,6 +291,7 @@ popd - New upstream release 1.11.3 resolves: #2211813 - Convert License tag to SPDX +- Add Provides for bundled projects * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From 4b4527afc01111886c5fae1289a01dfb0292c91d Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 19:25:16 -0600 Subject: [PATCH 04/12] Disable LTO --- scipy.spec | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scipy.spec b/scipy.spec index 40911df..c0c1ab8 100644 --- a/scipy.spec +++ b/scipy.spec @@ -11,6 +11,9 @@ %bcond_without pythran %endif +# The code is not safe to build with LTO +%global _lto_cflags %{nil} + # Set to pre-release version suffix if building pre-release, else %%{nil} %global rcver %{nil} @@ -292,6 +295,7 @@ popd resolves: #2211813 - Convert License tag to SPDX - Add Provides for bundled projects +- Disable LTO * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From a57187ad13064bee7ac68f31a213ff7e8b3bb596 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 19:25:34 -0600 Subject: [PATCH 05/12] Pythran works on 32-bit architectures again --- scipy.spec | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/scipy.spec b/scipy.spec index c0c1ab8..7dd0392 100644 --- a/scipy.spec +++ b/scipy.spec @@ -4,12 +4,7 @@ # Pythran is an optional build dependency. # When used, it makes some modules faster, # but it is usually not available soon enough for new major Python versions. -%ifarch i686 armv7hl -# It seems pythran is broken on 32-bit arches, disable it -%bcond_with pythran -%else %bcond_without pythran -%endif # The code is not safe to build with LTO %global _lto_cflags %{nil} @@ -296,6 +291,7 @@ popd - Convert License tag to SPDX - Add Provides for bundled projects - Disable LTO +- Pythran works on 32-bit architectures again * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From 64440ae7d292fc8094371e7e29286e3def1250e2 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 19:25:54 -0600 Subject: [PATCH 06/12] Fix detection of open_memstream --- scipy.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scipy.spec b/scipy.spec index 7dd0392..407e74d 100644 --- a/scipy.spec +++ b/scipy.spec @@ -154,6 +154,10 @@ for f in $(grep -Frl numpy.distutils); do rm $f.orig done +# Work around failure to detect open_memstream. In glibc, open_memstream is +# not a real function. It is a weak alias to __open_memstream. +sed -i "s/\('has_openmemstream', \)'0'/\1'1'/" scipy/_lib/meson.build + %build export SCIPY_USE_PYTHRAN=0%{?with_pythran} @@ -292,6 +296,7 @@ popd - Add Provides for bundled projects - Disable LTO - Pythran works on 32-bit architectures again +- Fix detection of open_memstream * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From 0bfceb8704131e0d34c95ab732db093e05db46c8 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 28 Nov 2023 15:44:18 +0100 Subject: [PATCH 07/12] Use pyproject macros instead of the deprecated py3 macros --- scipy.spec | 84 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 37 deletions(-) diff --git a/scipy.spec b/scipy.spec index 407e74d..4406c44 100644 --- a/scipy.spec +++ b/scipy.spec @@ -54,16 +54,15 @@ BuildRequires: gcc-gfortran, swig, gcc-c++ BuildRequires: qhull-devel BuildRequires: pybind11-devel -BuildRequires: python3-pybind11 >= 2.4.0 BuildRequires: python3-numpy, python3-devel, python3-numpy-f2py -BuildRequires: python3-pooch BuildRequires: python3-setuptools -BuildRequires: python3-Cython + BuildRequires: python3-pytest +BuildRequires: python3-pytest-timeout %if ! 0%{?rhel} BuildRequires: python3-pytest-xdist %endif -BuildRequires: python3-pytest-timeout +BuildRequires: python3-pooch %if %{with pythran} BuildRequires: pythran @@ -91,7 +90,6 @@ leading scientists and engineers.} %package -n python3-scipy Summary: Scientific Tools for Python Requires: python3-numpy, python3-f2py, python3-pooch -%{?python_provide:%python_provide python3-scipy} Provides: bundled(arpack) = 3.3.0 Provides: bundled(biasedurn) Provides: bundled(boost-math) @@ -125,21 +123,10 @@ Scipy test files %prep %autosetup -p1 -n %{name}-%{version}%{?rcver} -cat > site.cfg << EOF +cat >> pyproject.toml << EOF -[amd] -library_dirs = %{_libdir} -include_dirs = /usr/include/suitesparse -amd_libs = amd - -[umfpack] -library_dirs = %{_libdir} -include_dirs = /usr/include/suitesparse -umfpack_libs = umfpack - -[openblas] -libraries = %{blaslib}%{blasvar} -library_dirs = %{_libdir} +[tool.meson-python.args] +setup = ['-Dblas=%{blaslib}%{blasvar}', '-Dlapack=%{blaslib}%{blasvar}'] EOF # Docs won't build unless the .dat files are specified here @@ -154,43 +141,67 @@ for f in $(grep -Frl numpy.distutils); do rm $f.orig done +# Do not do benchmarking or coverage testing for RPM builds +sed -i '/^[[:blank:]]*"(asv|pytest-cov)"/d' pyproject.toml + +# No scikit-umfpack in Fedora +sed -i '/^[[:blank:]]*"scikit-umfpack"/d' pyproject.toml + +# No pytest-xdist in RHEL +%if 0%{?rhel} +sed -i '/^[[:blank:]]*"pytest-xdist"/d' pyproject.toml +%endif + +# Remove pythran dependency if not explicitly required +%if %{without pythran} +sed -i '/pythran/d' pyproject.toml +%endif + +# Loosen the lower bound on numpy +sed -i "/numpy.*python_version=='3.12'/s/1\.26\.0/1\.24\.4/" pyproject.toml + +# Loosen the upper bound on meson-python +sed -i '/meson-python/s/0\.15\.0/0\.16\.0/' pyproject.toml + +# Loosen the upper bound on Cython +sed -i '/Cython/s/3\.0/3\.1/' pyproject.toml + +# Loosen the upper bound on pybind11 +sed -i '/pybind11/s/2\.11\.1/2.12.0/' pyproject.toml + # Work around failure to detect open_memstream. In glibc, open_memstream is # not a real function. It is a weak alias to __open_memstream. sed -i "s/\('has_openmemstream', \)'0'/\1'1'/" scipy/_lib/meson.build +%generate_buildrequires +%pyproject_buildrequires -R + %build export SCIPY_USE_PYTHRAN=0%{?with_pythran} +%pyproject_wheel +%if %{with doc} for PY in %{python3_version}; do - # Adding -fallow-argument-mismatch workaround for https://github.com/scipy/scipy/issues/11611 - env CFLAGS="$RPM_OPT_FLAGS -lm" \ - %if 0%{?fedora} >= 32 || 0%{?rhel} >= 9 - FFLAGS="$RPM_OPT_FLAGS -fPIC -fallow-argument-mismatch" \ - %else - FFLAGS="$RPM_OPT_FLAGS -fPIC" \ - %endif - LDFLAGS="%{__global_ldflags}" \ - %{_bindir}/python$PY _setup.py config_fc \ - --fcompiler=gnu95 --noarch \ - build - - %if %{with doc} pushd doc export PYTHONPATH=$(echo ../build/lib.linux-*-$PY/) make html SPHINXBUILD=sphinx-build-$PY rm -rf build/html/.buildinfo mv build build-$PY popd - %endif done +%endif %install export SCIPY_USE_PYTHRAN=0%{?with_pythran} +%pyproject_install +%pyproject_save_files scipy -%py3_install # Some files got ambiguous python shebangs, we fix them after everything else is done %py3_shebang_fix %{buildroot}%{python3_sitearch} +# Fix executable bits +chmod 0755 %{buildroot}%{python3_sitearch}/scipy/sparse/linalg/_isolve/tests/test_gcrotmk.py + %check # check against the reference BLAS/LAPACK export FLEXIBLAS=netlib @@ -267,10 +278,8 @@ rm -rf gram{A,B} rm -rf .pytest_cache popd -%files -n python3-scipy +%files -n python3-scipy -f %{pyproject_files} %license LICENSE.txt -%{python3_sitearch}/scipy/ -%{python3_sitearch}/*.egg-info %exclude %{python3_sitearch}/scipy/*/tests/ %exclude %{python3_sitearch}/scipy/*/*/tests/ %exclude %{python3_sitearch}/scipy/*/*/*/tests/ @@ -297,6 +306,7 @@ popd - Disable LTO - Pythran works on 32-bit architectures again - Fix detection of open_memstream +- Use pyproject macros instead of the deprecated py3 macros * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From 54f9f75c3274501f4f92fb289d7d2d2051d80f1d Mon Sep 17 00:00:00 2001 From: Jerry James Date: Wed, 11 Oct 2023 21:05:53 -0600 Subject: [PATCH 08/12] Reenable some tests that work again --- scipy.spec | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scipy.spec b/scipy.spec index 4406c44..dffeb79 100644 --- a/scipy.spec +++ b/scipy.spec @@ -247,19 +247,20 @@ TIMEOUT=1000 %endif %ifarch x86_64 -# skip also failing test_sygst for now +%if 0%{?rhel} export PYTEST_ADDOPTS="-k '$SKIP_ALL and \ -%{?rhel:not TestPPoly and \ +not TestPPoly and \ not TestLinprogIPSparse and \ -not test_axis_nan_policy_full and} \ -not test_sygst'" +not test_axis_nan_policy_full'" +%else +export PYTEST_ADDOPTS="-k '$SKIP_ALL'" +%endif %endif %ifarch i686 armv7hl # skip also test_cython_api: https://bugzilla.redhat.com/show_bug.cgi?id=2068496 # https://github.com/scipy/scipy/issues/17213 export PYTEST_ADDOPTS="-k '$SKIP_ALL and \ -not test_sygst and \ not test_cython_api and \ not test_examples and \ not test_shifts and \ @@ -307,6 +308,7 @@ popd - Pythran works on 32-bit architectures again - Fix detection of open_memstream - Use pyproject macros instead of the deprecated py3 macros +- Reenable some tests that work again * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From c07c356d12f7657e33ded157e8c5588f39492f90 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Tue, 28 Nov 2023 15:45:43 +0100 Subject: [PATCH 09/12] Remove unused BuildRequires --- scipy.spec | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/scipy.spec b/scipy.spec index dffeb79..ae5b6df 100644 --- a/scipy.spec +++ b/scipy.spec @@ -48,14 +48,11 @@ License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 AND Boehm-GC AND Q Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz -BuildRequires: fftw-devel, suitesparse-devel BuildRequires: %{blaslib}-devel -BuildRequires: gcc-gfortran, swig, gcc-c++ -BuildRequires: qhull-devel +BuildRequires: gcc-gfortran, gcc-c++ BuildRequires: pybind11-devel -BuildRequires: python3-numpy, python3-devel, python3-numpy-f2py -BuildRequires: python3-setuptools +BuildRequires: python3-devel, python3-numpy-f2py BuildRequires: python3-pytest BuildRequires: python3-pytest-timeout @@ -64,10 +61,6 @@ BuildRequires: python3-pytest-xdist %endif BuildRequires: python3-pooch -%if %{with pythran} -BuildRequires: pythran -%endif - %if %{with doc} BuildRequires: python3-sphinx BuildRequires: python3-matplotlib @@ -309,6 +302,7 @@ popd - Fix detection of open_memstream - Use pyproject macros instead of the deprecated py3 macros - Reenable some tests that work again +- Remove unused BuildRequires * Wed Jul 12 2023 psimovec - 1.11.1-1 - New upstream release 1.11.1 From b3bae532eb7f21217f928c6a63825ed1cd97b333 Mon Sep 17 00:00:00 2001 From: "Benjamin A. Beasley" Date: Wed, 1 Nov 2023 10:59:53 -0400 Subject: [PATCH 10/12] Patch error collecting tests with pytest-xdist --- 19443.patch | 28 ++++++++++++++++++++++++++++ scipy.spec | 15 ++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 19443.patch diff --git a/19443.patch b/19443.patch new file mode 100644 index 0000000..af9c880 --- /dev/null +++ b/19443.patch @@ -0,0 +1,28 @@ +From 28413806316049c09bb4b0182f652cce0ba82a50 Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Fri, 27 Oct 2023 16:47:37 -0400 +Subject: [PATCH] TST: Fix #19442 minimally + +Use a sorted version of the set REAL_DTYPES to parameterize +test_b_orthonormalize. +--- + scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py b/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +index c17d37051fca..fd6f166dc62d 100644 +--- a/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py ++++ b/scipy/sparse/linalg/_eigen/lobpcg/tests/test_lobpcg.py +@@ -101,9 +101,9 @@ def test_MikotaPair(): + + @pytest.mark.parametrize("n", [50]) + @pytest.mark.parametrize("m", [1, 2, 10]) +-@pytest.mark.parametrize("Vdtype", REAL_DTYPES) +-@pytest.mark.parametrize("Bdtype", REAL_DTYPES) +-@pytest.mark.parametrize("BVdtype", REAL_DTYPES) ++@pytest.mark.parametrize("Vdtype", sorted(REAL_DTYPES, key=str)) ++@pytest.mark.parametrize("Bdtype", sorted(REAL_DTYPES, key=str)) ++@pytest.mark.parametrize("BVdtype", sorted(REAL_DTYPES, key=str)) + def test_b_orthonormalize(n, m, Vdtype, Bdtype, BVdtype): + """Test B-orthonormalization by Cholesky with callable 'B'. + The function '_b_orthonormalize' is key in LOBPCG but may diff --git a/scipy.spec b/scipy.spec index ae5b6df..1509e8c 100644 --- a/scipy.spec +++ b/scipy.spec @@ -23,7 +23,7 @@ Summary: Scientific Tools for Python Name: scipy Version: 1.11.3 -Release: 1%{?dist} +Release: 2%{?dist} # BSD-3-Clause -- whole package except: # BSD-2-Clause -- scipy/_lib/_pep440.py @@ -48,6 +48,16 @@ License: BSD-3-Clause AND BSD-2-Clause AND MIT AND BSL-1.0 AND Boehm-GC AND Q Url: http://www.scipy.org/scipylib/index.html Source0: https://github.com/scipy/scipy/releases/download/v%{version}/scipy-%{version}.tar.gz +# TST: Fix #19442 minimally +# https://github.com/scipy/scipy/pull/19443 +# +# Fixes: +# +# BUG: Error collecting tests due to inconsistent parameterization order in +# test_b_orthonormalize +# https://github.com/scipy/scipy/issues/19442 +Patch: https://github.com/scipy/scipy/pull/19443.patch + BuildRequires: %{blaslib}-devel BuildRequires: gcc-gfortran, gcc-c++ @@ -292,6 +302,9 @@ popd %endif %changelog +* Wed Nov 01 2023 Benjamin A. Beasley - 1.11.3-2 +- Patch error collecting tests with pytest-xdist + * Wed Oct 11 2023 Jerry James - 1.11.3-1 - New upstream release 1.11.3 resolves: #2211813 From 9c7d8c9833ab1e6664e7f2b9d85d19f8f5718022 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 21 Nov 2023 20:09:32 +0100 Subject: [PATCH 11/12] Fix the --without pythran build Apparently, SCIPY_USE_PYTHRAN=0 only works with setuptools. --- scipy.spec | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scipy.spec b/scipy.spec index 1509e8c..dd49912 100644 --- a/scipy.spec +++ b/scipy.spec @@ -129,7 +129,7 @@ Scipy test files cat >> pyproject.toml << EOF [tool.meson-python.args] -setup = ['-Dblas=%{blaslib}%{blasvar}', '-Dlapack=%{blaslib}%{blasvar}'] +setup = ['-Dblas=%{blaslib}%{blasvar}', '-Dlapack=%{blaslib}%{blasvar}'%{!?with_pythran:, '-Duse-pythran=false'}] EOF # Docs won't build unless the .dat files are specified here @@ -180,7 +180,6 @@ sed -i "s/\('has_openmemstream', \)'0'/\1'1'/" scipy/_lib/meson.build %pyproject_buildrequires -R %build -export SCIPY_USE_PYTHRAN=0%{?with_pythran} %pyproject_wheel %if %{with doc} @@ -195,7 +194,6 @@ done %endif %install -export SCIPY_USE_PYTHRAN=0%{?with_pythran} %pyproject_install %pyproject_save_files scipy From a78d2e4fe6cba8597cb4f029eeebf8e3fee452af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Tue, 21 Nov 2023 20:26:52 +0100 Subject: [PATCH 12/12] Enable build with Python 3.13+ --- scipy.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scipy.spec b/scipy.spec index dd49912..59b43ca 100644 --- a/scipy.spec +++ b/scipy.spec @@ -132,6 +132,11 @@ cat >> pyproject.toml << EOF setup = ['-Dblas=%{blaslib}%{blasvar}', '-Dlapack=%{blaslib}%{blasvar}'%{!?with_pythran:, '-Duse-pythran=false'}] EOF +# Enable build with Python 3.13+ +# Upstream only allows Python pre-releases in git HEAD, not in releases. +# However in Fedora, we actively build packages with Python pre-releases very soon. +sed -i 's/requires-python = ">=3.9,<3.13"/requires-python = ">=3.9"/' pyproject.toml + # Docs won't build unless the .dat files are specified here sed -i 's/metadata = dict(/metadata = dict(package_data={"": ["*.dat"]},/' _setup.py