[med-svn] [Git][med-team/python-csb][master] 6 commits: Fix FTBFS against numpy 2.0 / Python 3.15 (Closes: #1149340)
Andreas Tille (@tille)
gitlab at salsa.debian.org
Fri Oct 23 17:46:07 BST 2026
Andreas Tille pushed to branch master at Debian Med / python-csb
Commits:
d87bd048 by Andreas Tille at 2026-10-23T18:39:40+02:00
Fix FTBFS against numpy 2.0 / Python 3.15 (Closes: #1149340)
- replace numpy.asfarray (removed in numpy 2.0) with numpy.asarray
- replace binary numpy.fromstring with numpy.frombuffer
- fix failing test-suite assertions (replica exchange samplers,
enum comparison, pickling recursion limit)
- - - - -
e5263d59 by Andreas Tille at 2026-10-23T18:40:31+02:00
Standards-Version: 4.7.4 (routine-update)
- - - - -
74368621 by Andreas Tille at 2026-10-23T18:40:41+02:00
Changes made by cme
- - - - -
558f5f2c by Andreas Tille at 2026-10-23T18:40:43+02:00
Drop 'Rules-Requires-Root: no' from d/control (routine-update)
- - - - -
feddf98d by Andreas Tille at 2026-10-23T17:40:44+01:00
Reformat the Last-Update date as ISO YYYY-MM-DD.
Changes-By: lintian-brush
Fixes: lintian: source: invalid-dep3-format-patch-wrong-last-update [debian/patches/exclude_online_tests.patch]
Fixes: lintian: source: invalid-dep3-format-patch-wrong-last-update [debian/patches/fix_setup.patch]
Fixes: lintian: source: invalid-dep3-format-patch-wrong-last-update [debian/patches/python3-syntax.patch]
See-also: https://lintian.debian.org/tags/invalid-dep3-format-patch-wrong-last-update.html
- - - - -
04b62147 by Andreas Tille at 2026-10-23T18:40:48+02:00
debputy lint --auto-fix (routine-update)
- - - - -
8 changed files:
- debian/changelog
- debian/control
- debian/patches/exclude_online_tests.patch
- + debian/patches/fix-1149340.patch
- debian/patches/fix_setup.patch
- debian/patches/python3-syntax.patch
- debian/patches/series
- debian/watch
Changes:
=====================================
debian/changelog
=====================================
@@ -2,9 +2,20 @@ python-csb (1.2.5+dfsg-11) UNRELEASED; urgency=medium
* Fix Python3.12 string syntax
Closes: #1085900
+ * Fix FTBFS against numpy 2.0 / Python 3.15 (Closes: #1149340)
+ - replace numpy.asfarray (removed in numpy 2.0) with numpy.asarray
+ - replace binary numpy.fromstring with numpy.frombuffer
+ - fix failing test-suite assertions (replica exchange samplers,
+ enum comparison, pickling recursion limit)
* Standards-Version: 4.7.0 (routine-update)
* Build-Depends: s/dh-python/dh-sequence-python3/ (routine-update)
* d/watch: version=5
+ * Standards-Version: 4.7.4 (routine-update)
+ * Reflow Uploaders field (cme)
+ * Remove Priority field (cme)
+ * Drop 'Rules-Requires-Root: no' from d/control (routine-update)
+ * Reformat the Last-Update date as ISO YYYY-MM-DD.
+ * debputy lint --auto-fix (routine-update)
-- Andreas Tille <tille at debian.org> Wed, 11 Dec 2024 13:22:23 +0100
=====================================
debian/control
=====================================
@@ -1,30 +1,31 @@
Source: python-csb
+Standards-Version: 4.7.4
Maintainer: Debian Med Packaging Team <debian-med-packaging at lists.alioth.debian.org>
-Uploaders: Tomas Di Domenico <tdido at tdido.com.ar>,
- Andreas Tille <tille at debian.org>
+Uploaders:
+ Tomas Di Domenico <tdido at tdido.com.ar>,
+ Andreas Tille <tille at debian.org>,
Section: science
Testsuite: autopkgtest-pkg-python
-Priority: optional
-Build-Depends: debhelper-compat (= 13),
- dh-sequence-python3,
- python3-all,
- python3-numpy,
- python3-scipy,
- python3-matplotlib,
- python3-setuptools
-Standards-Version: 4.7.0
+Build-Depends:
+ debhelper-compat (= 14),
+ dh-sequence-python3,
+ python3-all,
+ python3-matplotlib,
+ python3-numpy,
+ python3-scipy,
+ python3-setuptools,
Vcs-Browser: https://salsa.debian.org/med-team/python-csb
Vcs-Git: https://salsa.debian.org/med-team/python-csb.git
Homepage: https://github.com/csb-toolbox/CSB
-Rules-Requires-Root: no
Package: python3-csb
Architecture: all
Section: python
-Depends: ${misc:Depends},
- ${python3:Depends},
- python3-numpy,
- python3-scipy
+Depends:
+ python3-numpy,
+ python3-scipy,
+ ${misc:Depends},
+ ${python3:Depends},
Description: Python framework for structural bioinformatics (Python3 version)
Computational Structural Biology Toolbox (CSB) is a Python class
library for reading, storing and analyzing biomolecular structures
@@ -37,9 +38,10 @@ Description: Python framework for structural bioinformatics (Python3 version)
Package: csb
Architecture: all
-Depends: ${misc:Depends},
- ${python3:Depends},
- python3-csb
+Depends:
+ python3-csb,
+ ${misc:Depends},
+ ${python3:Depends},
Description: Computational Structural Biology Toolbox (CSB)
Computational Structural Biology Toolbox (CSB) is a Python class
library for reading, storing and analyzing biomolecular structures
=====================================
debian/patches/exclude_online_tests.patch
=====================================
@@ -1,5 +1,5 @@
Author: Andreas Tille <tille at debian.org>
-Last-Update: Sat, 26 Dec 2015 08:01:36 +0100
+Last-Update: 2015-12-26
Bug-Debian: https://bugs.debian.org/738962
Description: Exclude tests requiring online access
=====================================
debian/patches/fix-1149340.patch
=====================================
@@ -0,0 +1,74 @@
+Description: Restore python 3.15 / numpy 2.0 compatibility (FTBFS)
+ np.asfarray() and the binary mode of numpy.fromstring() were removed in
+ numpy 2.0. Replace them and fix the test-suite assertions that break under
+ python 3.15 / numpy 2.0.
+Author: Andreas Tille <tille at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1149340
+Forwarded: not-needed
+Last-Update: 2026-10-23
+Assisted-By: scaleway/deepseek-v4-flash-0731
+
+--- a/csb/bio/io/mrc.py
++++ b/csb/bio/io/mrc.py
+@@ -245,7 +245,7 @@ class DensityMapReader(object):
+ map_data = stream.read(4 * count)
+
+ if byte_order == ByteOrder.NATIVE:
+- array = numpy.fromstring(map_data, numpy.float32, count)
++ array = numpy.frombuffer(map_data, numpy.float32, count)
+ else:
+ array = numpy.zeros((count,), numpy.float32)
+ index = 0
+--- a/csb/numeric/__init__.py
++++ b/csb/numeric/__init__.py
+@@ -152,7 +152,7 @@ def rotation_matrix(axis, angle):
+
+ @rtype: (3,3) numpy.array
+ """
+- axis = numpy.asfarray(axis) / norm(axis)
++ axis = numpy.asarray(axis, dtype=numpy.float64) / norm(axis)
+ assert axis.shape == (3,)
+
+ c = math.cos(angle)
+--- a/csb/test/cases/core/__init__.py
++++ b/csb/test/cases/core/__init__.py
+@@ -70,7 +70,7 @@ class TestEnum(test.Case):
+ def testComparison(self):
+ self.assertEqual(self.enum.A, 0)
+ self.assertEqual(self.enum.C, 66)
+- self.assertFalse(self.enum.C == 66)
++ self.assertIsNot(self.enum.C, 66)
+ self.assertFalse(isinstance(self.enum.A, int))
+
+ def testStr(self):
+--- a/csb/test/cases/io/__init__.py
++++ b/csb/test/cases/io/__init__.py
+@@ -525,9 +525,16 @@ class TestDumpLoad(test.Case):
+ self._test(load_func, dump_func)
+
+ def testRecusionLimit(self):
++ # deeply nested object that exceeds the pickling recursion limit
++ deep = []
++ inner = deep
++ for _i in range(10000):
++ inner.append([])
++ inner = inner[-1]
++
+ with self.assertRaises(RuntimeError):
+ with csb.io.TempFile(mode='b') as temp:
+- csb.io.dump(self.big_graph, temp.name)
++ csb.io.dump(deep, temp.name)
+
+ def _test(self, load_func, dump_func):
+ for ob in self.objs:
+--- a/csb/test/cases/statistics/samplers/__init__.py
++++ b/csb/test/cases/statistics/samplers/__init__.py
+@@ -863,7 +863,7 @@ class TestReplicaHistory(test.Case):
+ ok = []
+ for i in range(len(samples[0])):
+ trajs2 = rh.calculate_projected_trajectories(i)
+- ok.append(True in [np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
++ ok.append(True in [len(t1) == len(t2) and np.all(np.array(t1) == np.array(t2)) for t1 in trajs1
+ for t2 in trajs2])
+
+ return np.all(ok)
=====================================
debian/patches/fix_setup.patch
=====================================
@@ -1,5 +1,5 @@
Author: Ghislain Vaillant <ghisvail at gmail.com>
-Last-Update: Mon, 13 Nov 2017 09:17:24 +0000
+Last-Update: 2017-11-13
Description: Fix reading UTF-8 encoded files
--- a/setup.py
=====================================
debian/patches/python3-syntax.patch
=====================================
@@ -1,7 +1,7 @@
Description: Fix Python3 syntax
Bug-Debian: https://bugs.debian.org/1040283
Author: Andreas Tille <tille at debian.org>
-Last-Update: Tue, 04 Jul 2023 20:47:54 +0200
+Last-Update: 2023-07-04
--- a/csb/build.py
+++ b/csb/build.py
=====================================
debian/patches/series
=====================================
@@ -5,3 +5,4 @@ avoid-multiple-namespace.patch
python3-syntax.patch
python-3.12.patch
pyhon3.12-syntax.patch
+fix-1149340.patch
=====================================
debian/watch
=====================================
@@ -2,5 +2,5 @@ Version: 5
Template: Github
Dist: https://github.com/csb-toolbox/CSB
-Dversionmangle: auto
-Repacksuffix: +dfsg
+Dversion-Mangle: auto
+Repack-Suffix: +dfsg
View it on GitLab: https://salsa.debian.org/med-team/python-csb/-/compare/16608227d46f4ef6ef7c5b3c4715018520d0cefe...04b62147fa47d1b20304aa5631a5df9aaaed27da
--
View it on GitLab: https://salsa.debian.org/med-team/python-csb/-/compare/16608227d46f4ef6ef7c5b3c4715018520d0cefe...04b62147fa47d1b20304aa5631a5df9aaaed27da
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20261023/0a4056cf/attachment-0001.htm>
More information about the debian-med-commit
mailing list