[packages/python3-scipy] - updated to 1.8.1 - added pythran,numpydoc-update patches to fix docs build
qboosh
qboosh at pld-linux.org
Sun Jan 8 07:44:51 CET 2023
commit 02a4f9a894e770ca33cea2c64531c98d86e6eac8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sun Jan 8 07:45:38 2023 +0100
- updated to 1.8.1
- added pythran,numpydoc-update patches to fix docs build
python3-scipy.spec | 96 ++++++++++++++++++++++++++++-----------------
scipy-numpydoc-update.patch | 48 +++++++++++++++++++++++
scipy-pythran.patch | 83 +++++++++++++++++++++++++++++++++++++++
3 files changed, 190 insertions(+), 37 deletions(-)
---
diff --git a/python3-scipy.spec b/python3-scipy.spec
index 6866b59..24ab212 100644
--- a/python3-scipy.spec
+++ b/python3-scipy.spec
@@ -9,40 +9,48 @@
Summary: A library of scientific tools
Summary(pl.UTF-8): Biblioteka narzędzi naukowych
Name: python3-%{module}
-Version: 1.7.3
-Release: 2
+Version: 1.8.1
+Release: 1
License: BSD
Group: Development/Languages/Python
#Source0Download: https://github.com/scipy/scipy/releases/
Source0: https://github.com/scipy/scipy/releases/download/v%{version}/%{module}-%{version}.tar.xz
-# Source0-md5: 9e6a6ae20e68e99031229c430f966672
+# Source0-md5: 15c3e57656dbd1626ae33971f2e80ab1
Patch0: numpy-deprecation-warnings.patch
Patch1: %{name}-cython3.patch
+# https://github.com/scipy/scipy/pull/16646
+Patch2: scipy-pythran.patch
+Patch3: scipy-numpydoc-update.patch
URL: https://www.scipy.org/
BuildRequires: blas-devel >= 3.6.0
BuildRequires: f2py3 >= 1:1.14.5
BuildRequires: gcc-fortran
BuildRequires: lapack-devel >= 3.6.0
-BuildRequires: python3 >= 1:3.7
-BuildRequires: python3-devel >= 1:3.7
-BuildRequires: python3-numpy >= 1:1.16.5
-BuildRequires: python3-numpy-devel >= 1:1.16.5
-BuildRequires: python3-numpy-devel < 1:1.23
+BuildRequires: libstdc++-devel >= 6:5
+BuildRequires: python3 >= 1:3.8
+BuildRequires: python3-devel >= 1:3.8
+BuildRequires: python3-numpy >= 1:1.17.3
+BuildRequires: python3-numpy-devel >= 1:1.17.3
+BuildRequires: python3-numpy-devel < 1:1.25
BuildRequires: python3-pybind11 >= 2.4.3
-BuildRequires: python3-pythran >= 0.9.11
+BuildRequires: python3-pythran >= 0.10.0
BuildRequires: python3-setuptools
+BuildRequires: rpm-build >= 4.6
BuildRequires: rpmbuild(macros) >= 1.752
BuildRequires: tar >= 1:1.22
BuildRequires: xz
%if %{with doc}
BuildRequires: pydoc3
-# matplotlib.sphinxext.plot_directive.__version__ >= 2
-BuildRequires: python3-matplotlib >= 1.1.0
+BuildRequires: python3-matplotlib >= 2
+# local version is used
+#BuildRequires: python3-numpydoc
+BuildRequires: python3-pydata_sphinx_theme >= 0.6.1
+BuildRequires: python3-sphinx_panels
BuildRequires: sphinx-pdg-3 >= 2.0
%endif
Requires: lapack >= 3.6.0
-Requires: python3-modules >= 1:3.7
-Requires: python3-numpy >= 1:1.16.5
+Requires: python3-modules >= 1:3.8
+Requires: python3-numpy >= 1:1.17.3
Suggests: python3-pillow
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -73,6 +81,8 @@ Dokumentacja API modułu SciPy.
%setup -q -n scipy-%{version}
%patch0 -p1
%patch1 -p1
+%patch2 -p1
+%patch3 -p1
%build
# numpy.distutils uses LDFLAGS as its own flags replacement,
@@ -87,6 +97,9 @@ export LAPACK=%{_libdir}
%py3_build
%if %{with doc}
+cp -pr scipy/io/tests build-3/lib.*/scipy/io
+cp -p scipy/misc/*.dat build-3/lib.*/scipy/misc
+cp -p scipy/stats/_sobol_direction_numbers.npz build-3/lib.*/scipy/stats
LANG=C \
PYTHONPATH=$(readlink -f build-3/lib.*) \
%{__make} -C doc html-build \
@@ -106,7 +119,7 @@ export LAPACK=%{_libdir}
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/fft/_pocketfft/LICENSE.md
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/linalg/src/{id_dist/doc/doc.tex,lapack_deprecations/LICENSE}
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/optimize/lbfgsb_src/README
-%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/sparse/linalg/{dsolve/SuperLU/License.txt,eigen/arpack/ARPACK/COPYING}
+%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/sparse/linalg/{_dsolve/SuperLU/License.txt,_eigen/arpack/ARPACK/COPYING}
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/spatial/qhull_src/COPYING.txt
%{__rm} $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/_lib/_test_deprecation_*.so
%{__rm} -r $RPM_BUILD_ROOT%{py3_sitedir}/%{module}/*/tests
@@ -171,6 +184,9 @@ rm -rf $RPM_BUILD_ROOT
%{py3_sitedir}/%{module}/io/*.py
%{py3_sitedir}/%{module}/io/__pycache__
%attr(755,root,root) %{py3_sitedir}/%{module}/io/*.so
+%dir %{py3_sitedir}/%{module}/io/_harwell_boeing
+%{py3_sitedir}/%{module}/io/_harwell_boeing/*.py
+%{py3_sitedir}/%{module}/io/_harwell_boeing/__pycache__
%dir %{py3_sitedir}/%{module}/io/arff
%{py3_sitedir}/%{module}/io/arff/*.py
%{py3_sitedir}/%{module}/io/arff/__pycache__
@@ -178,13 +194,11 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{py3_sitedir}/%{module}/io/matlab/*.so
%{py3_sitedir}/%{module}/io/matlab/*.py
%{py3_sitedir}/%{module}/io/matlab/__pycache__
-%dir %{py3_sitedir}/%{module}/io/harwell_boeing
-%{py3_sitedir}/%{module}/io/harwell_boeing/*.py
-%{py3_sitedir}/%{module}/io/harwell_boeing/__pycache__
%dir %{py3_sitedir}/%{module}/linalg
%{py3_sitedir}/%{module}/linalg/*.pxd
%attr(755,root,root) %{py3_sitedir}/%{module}/linalg/*.so
%{py3_sitedir}/%{module}/linalg/*.py
+%{py3_sitedir}/%{module}/linalg/*.pyi
%{py3_sitedir}/%{module}/linalg/__pycache__
%dir %{py3_sitedir}/%{module}/misc
%{py3_sitedir}/%{module}/misc/ascent.dat
@@ -248,24 +262,26 @@ rm -rf $RPM_BUILD_ROOT
%{py3_sitedir}/%{module}/sparse/csgraph/*.py
%{py3_sitedir}/%{module}/sparse/csgraph/__pycache__
%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/csgraph/*.so
-%dir %{py3_sitedir}/%{module}/sparse/linalg/dsolve
-%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/dsolve/*.so
-%{py3_sitedir}/%{module}/sparse/linalg/dsolve/*.py
-%{py3_sitedir}/%{module}/sparse/linalg/dsolve/__pycache__
-%dir %{py3_sitedir}/%{module}/sparse/linalg/eigen
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/*.py
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/__pycache__
-%dir %{py3_sitedir}/%{module}/sparse/linalg/eigen/arpack
-%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/eigen/arpack/*.so
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/arpack/*.py
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/arpack/__pycache__
-%dir %{py3_sitedir}/%{module}/sparse/linalg/eigen/lobpcg
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/lobpcg/*.py
-%{py3_sitedir}/%{module}/sparse/linalg/eigen/lobpcg/__pycache__
-%dir %{py3_sitedir}/%{module}/sparse/linalg/isolve
-%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/isolve/*.so
-%{py3_sitedir}/%{module}/sparse/linalg/isolve/*.py
-%{py3_sitedir}/%{module}/sparse/linalg/isolve/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_dsolve
+%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/_dsolve/*.so
+%{py3_sitedir}/%{module}/sparse/linalg/_dsolve/*.py
+%{py3_sitedir}/%{module}/sparse/linalg/_dsolve/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_eigen
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/*.py
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_eigen/arpack
+%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/_eigen/arpack/*.so
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/arpack/*.py
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/arpack/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_eigen/lobpcg
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/lobpcg/*.py
+%{py3_sitedir}/%{module}/sparse/linalg/_eigen/lobpcg/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_isolve
+%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/_isolve/*.so
+%{py3_sitedir}/%{module}/sparse/linalg/_isolve/*.py
+%{py3_sitedir}/%{module}/sparse/linalg/_isolve/__pycache__
+%dir %{py3_sitedir}/%{module}/sparse/linalg/_propack
+%attr(755,root,root) %{py3_sitedir}/%{module}/sparse/linalg/_propack/*.so
%dir %{py3_sitedir}/%{module}/spatial
%attr(755,root,root) %{py3_sitedir}/%{module}/spatial/*.so
%{py3_sitedir}/%{module}/spatial/*.py
@@ -296,10 +312,16 @@ rm -rf $RPM_BUILD_ROOT
%attr(755,root,root) %{py3_sitedir}/%{module}/stats/_boost/*.so
%{py3_sitedir}/%{module}/stats/_boost/*.py
%{py3_sitedir}/%{module}/stats/_boost/__pycache__
-%{py3_sitedir}/%{module}-%{version}-py*.egg-info
+%dir %{py3_sitedir}/%{module}/stats/_unuran
+%attr(755,root,root) %{py3_sitedir}/%{module}/stats/_unuran/*.so
+%{py3_sitedir}/%{module}/stats/_unuran/*.pxd
+%{py3_sitedir}/%{module}/stats/_unuran/*.py
+%{py3_sitedir}/%{module}/stats/_unuran/*.pyi
+%{py3_sitedir}/%{module}/stats/_unuran/__pycache__
+%{py3_sitedir}/SciPy-%{version}-py*.egg-info
%if %{with doc}
%files apidocs
%defattr(644,root,root,755)
-%doc doc/build/html/{_images,_static,generated,tutorial,*.html,*.js}
+%doc doc/build/html/{_images,_panels_static,_static,building,dev,reference,tutorial,*.html,*.js}
%endif
diff --git a/scipy-numpydoc-update.patch b/scipy-numpydoc-update.patch
new file mode 100644
index 0000000..f4c49b8
--- /dev/null
+++ b/scipy-numpydoc-update.patch
@@ -0,0 +1,48 @@
+--- scipy-1.8.1/doc/sphinxext/numpydoc/numpydoc.py.orig 2022-05-16 14:36:30.816477500 +0200
++++ scipy-1.8.1/doc/sphinxext/numpydoc/numpydoc.py 2023-01-07 16:22:34.589245962 +0100
+@@ -82,10 +82,10 @@ def _is_cite_in_numpydoc_docstring(citat
+ if section_node is None:
+ return False
+
+- sibling_sections = itertools.chain(section_node.traverse(is_docstring_section,
+- include_self=True,
+- descend=False,
+- siblings=True))
++ sibling_sections = itertools.chain(section_node.findall(is_docstring_section,
++ include_self=True,
++ descend=False,
++ siblings=True))
+ for sibling_section in sibling_sections:
+ if not sibling_section.children:
+ continue
+@@ -102,7 +102,7 @@ def _is_cite_in_numpydoc_docstring(citat
+
+ def relabel_references(app, doc):
+ # Change 'hash-ref' to 'ref' in label text
+- for citation_node in doc.traverse(citation):
++ for citation_node in doc.findall(citation):
+ if not _is_cite_in_numpydoc_docstring(citation_node):
+ continue
+ label_node = citation_node[0]
+@@ -120,7 +120,7 @@ def relabel_references(app, doc):
+ return (isinstance(node, pending_xref) and
+ node[0].astext() == '[%s]' % ref_text)
+
+- for xref_node in ref.parent.traverse(matching_pending_xref):
++ for xref_node in ref.parent.findall(matching_pending_xref):
+ xref_node.replace(xref_node[0], Text('[%s]' % new_text))
+ ref.replace(ref_text, new_text.copy())
+
+@@ -128,10 +128,10 @@ def relabel_references(app, doc):
+ def clean_backrefs(app, doc, docname):
+ # only::latex directive has resulted in citation backrefs without reference
+ known_ref_ids = set()
+- for ref in doc.traverse(reference, descend=True):
++ for ref in doc.findall(reference, descend=True):
+ for id_ in ref['ids']:
+ known_ref_ids.add(id_)
+- for citation_node in doc.traverse(citation, descend=True):
++ for citation_node in doc.findall(citation, descend=True):
+ # remove backrefs to non-existent refs
+ citation_node['backrefs'] = [id_ for id_ in citation_node['backrefs']
+ if id_ in known_ref_ids]
diff --git a/scipy-pythran.patch b/scipy-pythran.patch
new file mode 100644
index 0000000..1796692
--- /dev/null
+++ b/scipy-pythran.patch
@@ -0,0 +1,83 @@
+From 4cd073e0306a025a76dc74899736c43b33c03f67 Mon Sep 17 00:00:00 2001
+From: serge-sans-paille <serge.guelton at telecom-bretagne.eu>
+Date: Mon, 29 Aug 2022 08:15:49 +0200
+Subject: [PATCH] MAINT: have `get_index_dtype` follow its docs and return
+ int32 or int64
+
+---
+ scipy/optimize/_group_columns.py | 8 ++++----
+ scipy/signal/_max_len_seq.py | 5 +++--
+ scipy/signal/_max_len_seq_inner.py | 4 ++--
+ scipy/sparse/_sputils.py | 3 ++-
+ 4 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/scipy/optimize/_group_columns.py b/scipy/optimize/_group_columns.py
+index 8b4fcee34e7..99751d28e4e 100644
+--- a/scipy/optimize/_group_columns.py
++++ b/scipy/optimize/_group_columns.py
+@@ -52,10 +52,10 @@ def group_dense(m, n, A):
+ return groups
+
+
+-#pythran export group_sparse(int, int, intc[], intc[])
+-#pythran export group_sparse(int, int, int[], int[])
+-#pythran export group_sparse(int, int, intc[::], intc[::])
+-#pythran export group_sparse(int, int, int[::], int[::])
++#pythran export group_sparse(int, int, int32[], int32[])
++#pythran export group_sparse(int, int, int64[], int64[])
++#pythran export group_sparse(int, int, int32[::], int32[::])
++#pythran export group_sparse(int, int, int64[::], int64[::])
+ def group_sparse(m, n, indices, indptr):
+ groups = -np.ones(n, dtype=np.intp)
+ current_group = 0
+diff --git a/scipy/signal/_max_len_seq.py b/scipy/signal/_max_len_seq.py
+index 04a2e78828a..afe97dd4f4b 100644
+--- a/scipy/signal/_max_len_seq.py
++++ b/scipy/signal/_max_len_seq.py
+@@ -101,14 +101,15 @@ def max_len_seq(nbits, state=None, length=None, taps=None):
+ >>> plt.show()
+
+ """
++ taps_dtype = np.int32 if np.intp().itemsize == 4 else np.int64
+ if taps is None:
+ if nbits not in _mls_taps:
+ known_taps = np.array(list(_mls_taps.keys()))
+ raise ValueError('nbits must be between %s and %s if taps is None'
+ % (known_taps.min(), known_taps.max()))
+- taps = np.array(_mls_taps[nbits], np.intp)
++ taps = np.array(_mls_taps[nbits], taps_dtype)
+ else:
+- taps = np.unique(np.array(taps, np.intp))[::-1]
++ taps = np.unique(np.array(taps, taps_dtype))[::-1]
+ if np.any(taps < 0) or np.any(taps > nbits) or taps.size < 1:
+ raise ValueError('taps must be non-empty with values between '
+ 'zero and nbits (inclusive)')
+diff --git a/scipy/signal/_max_len_seq_inner.py b/scipy/signal/_max_len_seq_inner.py
+index 88d6ef3d755..8de08937a9c 100644
+--- a/scipy/signal/_max_len_seq_inner.py
++++ b/scipy/signal/_max_len_seq_inner.py
+@@ -3,8 +3,8 @@
+
+ import numpy as np
+
+-#pythran export _max_len_seq_inner(intp[], int8[], int, int, int8[])
+-#pythran export _max_len_seq_inner(int[], int8[], int, int, int8[])
++#pythran export _max_len_seq_inner(int32[], int8[], int, int, int8[])
++#pythran export _max_len_seq_inner(int64[], int8[], int, int, int8[])
+
+ # Fast inner loop of max_len_seq.
+ def _max_len_seq_inner(taps, state, nbits, length, seq):
+diff --git a/scipy/sparse/_sputils.py b/scipy/sparse/_sputils.py
+index 64e7efc6c9d..f492b926131 100644
+--- a/scipy/sparse/_sputils.py
++++ b/scipy/sparse/_sputils.py
+@@ -153,7 +153,8 @@ def get_index_dtype(arrays=(), maxval=No
+ int32min = np.iinfo(np.int32).min
+ int32max = np.iinfo(np.int32).max
+
+- dtype = np.intc
++ # not using intc directly due to misinteractions with pythran
++ dtype = np.int32 if np.intc().itemsize == 4 else np.int64
+ if maxval is not None:
+ if maxval > int32max:
+ dtype = np.int64
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python3-scipy.git/commitdiff/02a4f9a894e770ca33cea2c64531c98d86e6eac8
More information about the pld-cvs-commit
mailing list