[med-svn] [Git][med-team/nipy][master] 7 commits: gcc-14.patch: new: fix build failure with gcc 14.

Étienne Mollier (@emollier) gitlab at salsa.debian.org
Wed Sep 4 13:51:51 BST 2024



Étienne Mollier pushed to branch master at Debian Med / nipy


Commits:
aa237b6d by Étienne Mollier at 2024-09-04T14:09:12+02:00
gcc-14.patch: new: fix build failure with gcc 14.

Closes: #1075317

- - - - -
c25f362e by Étienne Mollier at 2024-09-04T14:19:37+02:00
sympy-1.13.patch: new: fix test failures with sympy 1.13.

- - - - -
03d748d2 by Étienne Mollier at 2024-09-04T14:20:07+02:00
d/control: declare compliance to standards version 4.7.0.

- - - - -
f6eacee8 by Étienne Mollier at 2024-09-04T14:30:36+02:00
d/rules: remove an extra license file.

- - - - -
9443971b by Étienne Mollier at 2024-09-04T14:47:01+02:00
python3-shebang.patch: forwarded upstream.

- - - - -
2f2d9974 by Étienne Mollier at 2024-09-04T14:47:18+02:00
d/python3-nipy.lintian-overrides: new: flag non-docs in dist-packages.

- - - - -
d26c29a0 by Étienne Mollier at 2024-09-04T14:51:14+02:00
Ready for upload to unstable.

- - - - -


8 changed files:

- debian/changelog
- debian/control
- + debian/patches/gcc-14.patch
- debian/patches/python3-shebang.patch
- debian/patches/series
- + debian/patches/sympy-1.13.patch
- + debian/python3-nipy.lintian-overrides
- debian/rules


Changes:

=====================================
debian/changelog
=====================================
@@ -1,3 +1,14 @@
+nipy (0.6.0-2) unstable; urgency=medium
+
+  * gcc-14.patch: new: fix build failure with gcc 14. (Closes: #1075317)
+  * sympy-1.13.patch: new: fix test failures with sympy 1.13.
+  * d/control: declare compliance to standards version 4.7.0.
+  * d/rules: remove an extra license file.
+  * python3-shebang.patch: forwarded upstream.
+  * d/python3-nipy.lintian-overrides: new: flag non-docs in dist-packages.
+
+ -- Étienne Mollier <emollier at debian.org>  Wed, 04 Sep 2024 14:48:01 +0200
+
 nipy (0.6.0-1) unstable; urgency=medium
 
   [ Andreas Tille ]


=====================================
debian/control
=====================================
@@ -27,7 +27,7 @@ Build-Depends: debhelper-compat (= 13),
                graphviz,
                dvipng,
                help2man
-Standards-Version: 4.6.2
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/nipy
 Vcs-Git: https://salsa.debian.org/med-team/nipy.git
 Homepage: https://nipy.org/nipy/


=====================================
debian/patches/gcc-14.patch
=====================================
@@ -0,0 +1,43 @@
+Description: fix build failure with gcc 14
+ Nipy fails to build from source with the following error:
+ .
+    ../lib/fff_python_wrapper/fffpy.c:17:3: error: returning ‘void *’ from a function with return type ‘IMP_OUT’ {aka ‘int’} makes integer from pointer without a cast [-Wint-conversion]
+       17 |   import_array();
+          |   ^~~~~~~~~~~~
+ . 
+ This looks to be related to the logic revolving around setting the type
+ of IMP_OUT to not know about the recent import_array return type in
+ contemporary Numpy versions.  Since Python 2 is obsolete, this patch
+ removes the Python major selector entirely to replace by a hard wiring
+ of the IMP_OUT type, so this may not be 100% suitable to everyone, but
+ introduction of the void* return type to import_array in Numpy is not
+ clear.
+
+Author: Étienne Mollier <emollier at debian.org>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075317
+Forwarded: https://github.com/nipy/nipy/pull/568
+Last-Update: 2024-09-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- nipy.orig/lib/fff_python_wrapper/fffpy.h
++++ nipy/lib/fff_python_wrapper/fffpy.h
+@@ -32,14 +32,12 @@
+    dso. (import_array() asks the pointer value to the python process)
+ */
+ /*
+- * deal with differences in macro return result between Python 2 and 3
+- * http://mail.scipy.org/pipermail/numpy-discussion/2010-December/054350.html
++ * IMP_OUT used to be a placeholder for selectin fffpy_import_array
++ * output type depending on the Python version, 2 or 3.  Contemporary
++ * numpy versions (>=2) dictate the return type of import_array, which
++ * is currently a void* (return NULL).
+  */
+-#if PY_MAJOR_VERSION >= 3
+-typedef int IMP_OUT;
+-#else
+-typedef void IMP_OUT;
+-#endif
++typedef void* IMP_OUT;
+ 
+ extern IMP_OUT fffpy_import_array(void);
+ 


=====================================
debian/patches/python3-shebang.patch
=====================================
@@ -1,6 +1,6 @@
 Description: ensure scripts are run with python3.
 Author: Étienne Mollier <emollier at debian.org>
-Forwarded: no
+Forwarded: https://github.com/nipy/nipy/pull/570
 Last-Update: 2023-12-30
 ---
 This patch header follows DEP-3: http://dep.debian.net/deps/dep3/


=====================================
debian/patches/series
=====================================
@@ -1,2 +1,4 @@
 local-mathjax.patch
 python3-shebang.patch
+gcc-14.patch
+sympy-1.13.patch


=====================================
debian/patches/sympy-1.13.patch
=====================================
@@ -0,0 +1,83 @@
+Description: fix test failures with sympy 1.13
+ Since version 1.13, SymPy makes a hard distinction between integers and
+ floats.  This causes a couple of tests to fail, with the most relevant
+ part of the error showing:
+ .
+         self = AffineTransform(
+            function_domain=CoordinateSystem(coord_names=('x', 'y', 'z'), name='', coord_dtype=object),
+            fun...ne=array([[3, 0, 0, 0],
+                          [0, 4, 0, 0],
+                          [0, 0, 5, 0],
+                          [0, 0, 0, 1]])
+         )
+         function_domain = CoordinateSystem(coord_names=('x', 'y', 'z'), name='', coord_dtype=object)
+         function_range = CoordinateSystem(coord_names=('i', 'j', 'k'), name='', coord_dtype=object)
+         affine = array([[1.00000000000000, 0, 0, 0],
+                [0, 0, 1.00000000000000, 0],
+                [0, 1.00000000000000, 0, 0],
+                [0, 0, 0, 1.00000000000000]], dtype=object)
+         
+             def __init__(self, function_domain, function_range, affine):
+                 """ Initialize AffineTransform
+         […]
+                 if not np.all(affine[-1] == bottom_row):
+         >           raise ValueError('the homogeneous transform should have bottom=' + \
+                                      f'row {repr(bottom_row)}')
+         E           ValueError: the homogeneous transform should have bottom=row array([0, 0, 0, 1])
+ .
+ This change implements a number of adjustments to fix the
+ AffineTransform constructor, and normalize the expected test output
+ where needed.
+
+Author: Étienne Mollier <emollier at debian.org>
+Forwarded: https://github.com/nipy/nipy/pull/569
+Last-Update: 2024-09-04
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- nipy.orig/nipy/core/reference/coordinate_map.py
++++ nipy/nipy/core/reference/coordinate_map.py
+@@ -558,10 +558,11 @@
+                              'affine matrix shape')
+         # Test that it is actually an affine mapping in homogeneous
+         # form
+-        bottom_row = np.array([0]*self.ndims[0] + [1])
++        bottom_row = np.array([0]*self.ndims[0] + [1.], dtype=dtype)
+         if not np.all(affine[-1] == bottom_row):
+             raise ValueError('the homogeneous transform should have bottom=' + \
+-                             f'row {repr(bottom_row)}')
++                             f'row {repr(bottom_row)}' + ' but it has bottom=' \
++                             + f'row {repr(affine[-1])}')
+         self.affine = affine
+ 
+     ###################################################################
+--- nipy.orig/nipy/core/reference/tests/test_coordinate_map.py
++++ nipy/nipy/core/reference/tests/test_coordinate_map.py
+@@ -956,8 +956,8 @@
+     # Check that we can make functional inverses of AffineTransforms, and
+     # CoordinateMap versions of AffineTransforms
+     arr_p1 = np.eye(4)[:, [0, 2, 1, 3]]
+-    in_list = [0, 1, 2]
+-    out_list = [0, 2, 1]
++    in_list = [0, 1., 2.]
++    out_list = [0, 2., 1.]
+     for dt in _SYMPY_SAFE_DTYPES:
+         in_cs = CoordinateSystem('ijk', coord_dtype=dt)
+         out_cs = CoordinateSystem('xyz', coord_dtype=dt)
+@@ -975,7 +975,7 @@
+         except:
+             1/0
+         res = r_cmap(out_coord)
+-        assert_array_equal(res, coord)
++        assert_array_equal(res, np.asarray(coord, dtype=exp_i_dt))
+         assert res.dtype == exp_i_dt
+         # Default behavior is preserve_type=False
+         r_cmap = cmap.inverse(preserve_dtype=False)
+@@ -991,7 +991,7 @@
+         cm_cmap = _as_coordinate_map(cmap)
+         assert_array_equal(cm_cmap(coord), out_list)
+         rcm_cmap = cm_cmap.inverse()
+-        assert_array_equal(rcm_cmap(coord), out_list)
++        assert_array_equal(rcm_cmap(coord), np.asarray(out_list, dtype=dt))
+         res = rcm_cmap(out_coord)
+         assert_array_equal(res, coord)
+         assert res.dtype == dt


=====================================
debian/python3-nipy.lintian-overrides
=====================================
@@ -0,0 +1,3 @@
+# These files are mostly needed test items.
+package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/nipy/*/tests/*]
+package-contains-documentation-outside-usr-share-doc [usr/lib/python3/dist-packages/nipy/algorithms/statistics/models/TODO.txt]


=====================================
debian/rules
=====================================
@@ -13,6 +13,9 @@ export NIPY_EXTERNAL_LAPACK=1
 # stop matplotlib from thinking it should display plots
 export MPLBACKEND=Agg
 
+DESTDIR = $(CURDIR)/debian/python3-$(PYBUILD_NAME)
+DISTDIR = $(DESTDIR)/usr/lib/python3/dist-packages
+
 # Mega rule
 %:
 	dh $@ --buildsystem=pybuild --with=sphinxdoc
@@ -20,7 +23,7 @@ export MPLBACKEND=Agg
 manpages:
 	@echo "I: generating manpages"
 	set -e; mkdir -p $(CURDIR)/build/manpages && \
-	cd $(CURDIR)/debian/python3-nipy/usr/bin/ && for f in *; do \
+	cd $(DESTDIR)/usr/bin/ && for f in *; do \
 		descr=$$(grep -h -e "^ *'''" -e 'DESCRIP =' $$f | sed -e "s,.*' *\([^'][^']*\)'.*,\1,g" | head -n 1); \
         PYTHONPATH=../ \
 		help2man -n "$$descr" --no-discard-stderr --no-info --version-string "$(DEB_VERSION_UPSTREAM)" "python3 ./$$f" \
@@ -41,7 +44,7 @@ endif
 
 override_dh_install:
 	: # I: Move libraries into the python3-nipy-lib packages
-	( cd debian/python3-nipy/ && \
+	( cd $(DESTDIR) && \
 	  find . -iname *.so | \
 	    while read so; do \
 	      d=../python3-nipy-lib/$$(dirname $$so); \
@@ -55,6 +58,7 @@ override_dh_install:
 
 override_dh_python3:
 	dh_python3 --shebang=/usr/bin/python3
+	rm -vf $(DISTDIR)/nipy/algorithms/statistics/models/LICENSE.txt
 
 ## immediately usable documentation and exemplar scripts/data
 override_dh_compress:



View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/b46c22559284488a388d02da32dd723d5d3fa090...d26c29a064bc08c8e9e38b21c55531ea747c7293

-- 
View it on GitLab: https://salsa.debian.org/med-team/nipy/-/compare/b46c22559284488a388d02da32dd723d5d3fa090...d26c29a064bc08c8e9e38b21c55531ea747c7293
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240904/b12096cb/attachment-0001.htm>


More information about the debian-med-commit mailing list