[Debian-med-packaging] Bug#1074222: pycorrfit FTBFS with Python 3.12 as default

Bo YU tsu.yubo at gmail.com
Tue Jul 2 09:26:40 BST 2024


Tags: patch

Hi,
On Mon, Jul 01, 2024 at 06:21:02PM +0200, Alexandre Detiste wrote:
>Hi,
>
>maybe adding these in d/control:
>  python3-setuptools-scm;
>and d/rules:
> SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)
>would help ?

hmm, that is not enough, at least for pycorrfit.

Look at the issue again,

```
...
sys.path.insert(0, realpath(dirname(__file__))+"/"+name)
try:
     from _version import version
except:
     version = "unknown"
```
It seems the failed from import so then step into except. So if we
review _version.py then import `imp` failed.

I purpose one patch to as workaround for the issue. Upstream has the
same view as you said, see[0].

Now I do not have more energy to work on upstream at currently stage. So
we can fix the issue temporary, could we commit the patch?

[0]: https://github.com/FCS-analysis/PyCorrFit/issues/208
>
>Alexandre

-- 
Regards,
--
   Bo YU

-------------- next part --------------
diff -Nru pycorrfit-1.1.7+dfsg/debian/changelog pycorrfit-1.1.7+dfsg/debian/changelog
--- pycorrfit-1.1.7+dfsg/debian/changelog	2022-08-05 21:48:45.000000000 +0800
+++ pycorrfit-1.1.7+dfsg/debian/changelog	2024-07-02 15:09:37.000000000 +0800
@@ -1,3 +1,11 @@
+pycorrfit (1.1.7+dfsg-3) unstable; urgency=medium
+
+  * Team upload.
+  * Add use-importlib.patch to fix ftbfs issue. (Closes: #1074222)
+  * Set std-ver to 4.7.0.
+
+ -- Bo YU <tsu.yubo at gmail.com>  Tue, 02 Jul 2024 15:09:37 +0800
+
 pycorrfit (1.1.7+dfsg-2) unstable; urgency=medium
 
   * Standards-Version: 4.6.1 (routine-update)
diff -Nru pycorrfit-1.1.7+dfsg/debian/control pycorrfit-1.1.7+dfsg/debian/control
--- pycorrfit-1.1.7+dfsg/debian/control	2022-08-05 21:48:45.000000000 +0800
+++ pycorrfit-1.1.7+dfsg/debian/control	2024-07-02 15:09:11.000000000 +0800
@@ -27,8 +27,7 @@
                texlive-latex-extra,
                texlive-latex-recommended,
                texlive-science,
-               python3-setuptools-scm,
-Standards-Version: 4.6.1
+Standards-Version: 4.7.0
 Vcs-Browser: https://salsa.debian.org/med-team/pycorrfit
 Vcs-Git: https://salsa.debian.org/med-team/pycorrfit.git
 Homepage: https://fcs-analysis.github.io/PyCorrFit/
diff -Nru pycorrfit-1.1.7+dfsg/debian/patches/fix-version-issue.patch pycorrfit-1.1.7+dfsg/debian/patches/fix-version-issue.patch
--- pycorrfit-1.1.7+dfsg/debian/patches/fix-version-issue.patch	2022-08-05 21:48:45.000000000 +0800
+++ pycorrfit-1.1.7+dfsg/debian/patches/fix-version-issue.patch	1970-01-01 07:30:00.000000000 +0730
@@ -1,11 +0,0 @@
---- a/pycorrfit/_version.py
-+++ b/pycorrfit/_version.py
-@@ -12,7 +12,7 @@
- # Put the entire script into a `True` statement and add the hint
- # `pragma: no cover` to ignore code coverage here.
- if True:  # pragma: no cover
--    import imp
-+    import importlib
-     import os
-     from os.path import abspath, basename, dirname, join
-     import subprocess
diff -Nru pycorrfit-1.1.7+dfsg/debian/patches/series pycorrfit-1.1.7+dfsg/debian/patches/series
--- pycorrfit-1.1.7+dfsg/debian/patches/series	2022-08-05 21:48:45.000000000 +0800
+++ pycorrfit-1.1.7+dfsg/debian/patches/series	2024-07-02 15:07:36.000000000 +0800
@@ -1,2 +1,2 @@
 fix_doc.patch
-fix-version-issue.patch
+use-importlib.patch
diff -Nru pycorrfit-1.1.7+dfsg/debian/patches/use-importlib.patch pycorrfit-1.1.7+dfsg/debian/patches/use-importlib.patch
--- pycorrfit-1.1.7+dfsg/debian/patches/use-importlib.patch	1970-01-01 07:30:00.000000000 +0730
+++ pycorrfit-1.1.7+dfsg/debian/patches/use-importlib.patch	2024-07-02 15:05:26.000000000 +0800
@@ -0,0 +1,18 @@
+Description: fix ftbfs on python3.12
+Author: Bo YU <tsu.yubo at gmail.com>
+Bug: https://bugs.debian.org/1074222
+Forwarded: https://github.com/FCS-analysis/PyCorrFit/issues/208
+Last-Update: 2024-07-02
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/pycorrfit/_version.py
++++ b/pycorrfit/_version.py
+@@ -12,7 +12,7 @@
+ # Put the entire script into a `True` statement and add the hint
+ # `pragma: no cover` to ignore code coverage here.
+ if True:  # pragma: no cover
+-    import imp
++    import importlib
+     import os
+     from os.path import abspath, basename, dirname, join
+     import subprocess
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20240702/4aac9f11/attachment.sig>


More information about the Debian-med-packaging mailing list