Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-fastcluster for openSUSE:Factory checked in at 2024-07-22 17:14:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-fastcluster (Old) and /work/SRC/openSUSE:Factory/.python-fastcluster.new.17339 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-fastcluster" Mon Jul 22 17:14:58 2024 rev:12 rq:1188506 version:1.2.6 Changes: -------- --- /work/SRC/openSUSE:Factory/python-fastcluster/python-fastcluster.changes 2022-09-29 18:14:17.811365416 +0200 +++ /work/SRC/openSUSE:Factory/.python-fastcluster.new.17339/python-fastcluster.changes 2024-07-22 17:15:15.734692206 +0200 @@ -1,0 +2,8 @@ +Fri Jul 19 02:32:28 UTC 2024 - Steve Kowalik <steven.kowa...@suse.com> + +- Add patch support-numpy-2.patch: + * Support both numpy 1 and 2 +- Switch to pyproject macros. +- No more greedy globs in %files. + +------------------------------------------------------------------- New: ---- support-numpy-2.patch BETA DEBUG BEGIN: New: - Add patch support-numpy-2.patch: * Support both numpy 1 and 2 BETA DEBUG END: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-fastcluster.spec ++++++ --- /var/tmp/diff_new_pack.gwJoQg/_old 2024-07-22 17:15:16.218711670 +0200 +++ /var/tmp/diff_new_pack.gwJoQg/_new 2024-07-22 17:15:16.222711830 +0200 @@ -1,7 +1,7 @@ # # spec file for package python-fastcluster # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2024 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -16,22 +16,22 @@ # -%define skip_python2 1 -%define skip_python36 1 -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-fastcluster Version: 1.2.6 Release: 0 Summary: Hierarchical clustering routines for Python License: BSD-2-Clause -Group: Development/Languages/Python URL: https://github.com/dmuellner/fastcluster Source: https://files.pythonhosted.org/packages/source/f/fastcluster/fastcluster-%{version}.tar.gz +# PATCH-FIX-UPSTREAM gh#fastcluster/fastcluster#94 +Patch0: support-numpy-2.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module numpy-devel >= 1.9} +BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} BuildRequires: %{python_module scipy} BuildRequires: %{python_module setuptools} +BuildRequires: %{python_module wheel} BuildRequires: fdupes BuildRequires: gcc-c++ BuildRequires: python-rpm-macros @@ -71,10 +71,10 @@ %build export CFLAGS="%{optflags}" -%python_build +%pyproject_wheel %install -%python_install +%pyproject_install %python_expand %fdupes %{buildroot}%{$python_sitearch} %check @@ -84,7 +84,10 @@ %files %{python_files} %license COPYING.txt %doc CITATION.txt NEWS.txt README.txt -%{python_sitearch}/* +%{python_sitearch}/fastcluster.py +%{python_sitearch}/_fastcluster.cpython-*.so +%pycache_only %{python_sitearch}/__pycache__/fastcluster.*.pyc +%{python_sitearch}/fastcluster-%{version}.dist-info %files -n %{name}-doc %doc docs/fastcluster.pdf ++++++ support-numpy-2.patch ++++++ >From 58cffa97fff38ca4dda3166b4ccb1a8eb27a124f Mon Sep 17 00:00:00 2001 From: Steve Kowalik <ste...@wedontsleep.org> Date: Fri, 19 Jul 2024 12:21:11 +1000 Subject: [PATCH] Support Numpy 2 Switch to using np.asarray() where required to support both Numpy 1 and 2. --- fastcluster.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fastcluster.py b/fastcluster.py index f5325a6..8778605 100644 --- a/fastcluster.py +++ b/fastcluster.py @@ -23,7 +23,7 @@ __version_info__ = ('1', '2', '6') __version__ = '.'.join(__version_info__) -from numpy import double, empty, array, ndarray, var, cov, dot, expand_dims, \ +from numpy import double, empty, array, asarray, ndarray, var, cov, dot, expand_dims, \ ceil, sqrt from numpy.linalg import inv try: @@ -227,7 +227,7 @@ def linkage(X, method='single', metric='euclidean', preserve_input=True): The linkage method does not treat NumPy's masked arrays as special and simply ignores the mask.''' - X = array(X, copy=False, subok=True) + X = asarray(X) if X.ndim==1: if method=='single': preserve_input = False @@ -464,10 +464,10 @@ def linkage_vector(X, method='single', metric='euclidean', extraarg=None): dtype = bool if X.dtype==bool else double else: dtype = bool if metric in booleanmetrics else double - X = array(X, dtype=dtype, copy=False, order='C', subok=True) else: assert metric=='euclidean' - X = array(X, dtype=double, copy=(method=='ward'), order='C', subok=True) + dtype = double + X = asarray(X, dtype=dtype, order='C') assert X.ndim==2 N = len(X) Z = empty((N-1,4))