Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #16684

Bug#1093278: paraview needs a stricter python dependency

From Colin Watson <cjwatson@debian.org>
Newsgroups linux.debian.bugs.dist, linux.debian.maint.python
Subject Bug#1093278: paraview needs a stricter python dependency
Date 2025-01-19 14:50 +0100
Message-ID <K6DQB-abVO-1@gated-at.bofh.it> (permalink)
References <K5RVD-9Bg8-9@gated-at.bofh.it> <K5Z6N-9Hqv-1@gated-at.bofh.it> <K5RVD-9Bg8-9@gated-at.bofh.it> <K5Z6N-9Hqv-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Cross-posted to 2 groups.

Show all headers | View raw


On Fri, Jan 17, 2025 at 07:09:57PM +0100, Drew Parsons wrote:
> I'd be interested too to know if there's an existing mechanism for
> this situation. paraview can't be the only package with python
> extensions that can only be built for the default python.
> 
> I'd say we'd want
>   Depends: python3.13
> rather than
>   Depends: python3 (>= 3.13~), python3 (<< 3.14)
>   
> That way it will continue working even after the default python has
> moved on, so long as the one it was built against remains.

You can achieve that with:

diff --git a/debian/rules b/debian/rules
index 8c83e2741..e97efcc3b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -129,7 +129,7 @@ my_test_python%:
 	dh_auto_test -Bbuild.python$(pyver)
 
 override_dh_python3:
-	dh_python3 --no-ext-rename # Hack: Do not rename libraries from e.g. vtkClientServerPython.so to vtkClientServerPython.cpython-38-x86_64-linux-gnu.so!
+	dh_python3 -V $(PY3DEF) --no-ext-rename # Hack: Do not rename libraries from e.g. vtkClientServerPython.so to vtkClientServerPython.cpython-38-x86_64-linux-gnu.so!
 
 override_dh_auto_test: $(foreach pyver,$(PY3VERS), my_test_python$(pyver))
 

However, the problem is that the current autopkgtest has "#!
/usr/bin/python3", so you'd have to fix that too; I'm not sure exactly
how that would look.  Presumably users expect it to work with the
default Python as well.

I tend to think that the dependencies suggested by Adrian would be a
better fit here.  You can achieve that with something like this
(slightly hacky, but it's the simplest approach I can think of):

diff --git a/debian/rules b/debian/rules
index 8c83e2741..e97efcc3b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -15,6 +15,7 @@ PY3DEF=$(shell py3versions -dv)
 # many libvtk*.so files link to the specific python version
 # so we can only support the default python
 PY3VERS=$(PY3DEF)
+PY3RANGE=$(shell echo $(PY3DEF) | awk 'BEGIN { FS="." }; { print $$1 "." $$2 "-" $$1 "." $$2 + 1 }')
 
 # The Qt Svg component library is not detected automatically
 # but is needed for labels and icons in the paraview GUI.
@@ -129,7 +130,7 @@ my_test_python%:
 	dh_auto_test -Bbuild.python$(pyver)
 
 override_dh_python3:
-	dh_python3 --no-ext-rename # Hack: Do not rename libraries from e.g. vtkClientServerPython.so to vtkClientServerPython.cpython-38-x86_64-linux-gnu.so!
+	dh_python3 -V $(PY3RANGE) --no-ext-rename # Hack: Do not rename libraries from e.g. vtkClientServerPython.so to vtkClientServerPython.cpython-38-x86_64-linux-gnu.so!
 
 override_dh_auto_test: $(foreach pyver,$(PY3VERS), my_test_python$(pyver))
 

HTH,

-- 
Colin Watson (he/him)                              [cjwatson@debian.org]

Back to linux.debian.maint.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Bug#1093278: paraview needs a stricter python dependency Adrian Bunk <bunk@debian.org> - 2025-01-17 11:40 +0100
  Bug#1093278: paraview needs a stricter python dependency Colin Watson <cjwatson@debian.org> - 2025-01-19 14:50 +0100
  Bug#1093278: paraview needs a stricter python dependency Adrian Bunk <bunk@debian.org> - 2025-01-22 23:00 +0100

csiph-web