Bug#1093278: paraview needs a stricter python dependency
Colin Watson
cjwatson at debian.org
Sun Jan 19 13:44:23 GMT 2025
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 at debian.org]
More information about the debian-science-maintainers
mailing list