[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#671024: [checks/binaries] missing-dependency-on-numpy-abi: add support for Python 3



Package: lintian
Version: 2.5.6
Severity: wishlist
Tags: patch

With the attached patch lintian will emit missing-dependency-on-numpy-abi also for Python 3.X modules. (Note that dh_numpy3 doesn't exist yet, but I was told it will be added in a week's time.)

--
Jakub Wilk
diff --git a/checks/binaries b/checks/binaries
--- a/checks/binaries
+++ b/checks/binaries
@@ -378,7 +378,8 @@
     }
 
     # Python extension using Numpy C ABI?
-    if ($file =~ m,usr/lib/(?:pyshared/)?python2\.\d+/.*(?<!_d)\.so$,) {
+    if ($file =~ m,usr/lib/(?:pyshared/)?python2\.\d+/.*(?<!_d)\.so$, or
+            ($file =~ m,usr/lib/python3/.+\.cpython-\d+([a-z]+)\.so$, and $1 !~ /d/)) {
         if ($strings =~ m,module compiled against ABI version %x but this version of numpy is %x,) {
             $uses_numpy_c_abi = 1;
         }
@@ -504,10 +505,10 @@
     # relation.  Also, we do not allow versions for -abi as it is a virtual package.
     tag 'missing-dependency-on-numpy-abi'
         unless
-            $depends->matches (qr/^python-numpy-abi\d+$/, VISIT_OR_CLAUSE_FULL) or (
+            $depends->matches (qr/^python3?-numpy-abi\d+$/, VISIT_OR_CLAUSE_FULL) or (
             $depends->matches (qr/^python-numpy \(>[>=][^\|]+$/, VISIT_OR_CLAUSE_FULL) and
             $depends->matches (qr/^python-numpy \(<[<=][^\|]+$/, VISIT_OR_CLAUSE_FULL)) or
-            $pkg eq 'python-numpy';
+            $pkg =~ m,^python3?-numpy$,;
 }
 
 }
diff --git a/checks/binaries.desc b/checks/binaries.desc
--- a/checks/binaries.desc
+++ b/checks/binaries.desc
@@ -220,7 +220,7 @@
  binary interface. Such packages must depend on python-numpy-abi<i>N</i>.
  .
  If the package is using debhelper, this problem is usually due to a
- missing dh_numpy call in <tt>debian/rules</tt>.
+ missing dh_numpy (or dh_numpy3) call in <tt>debian/rules</tt>.
 Ref: /usr/share/doc/python-numpy/README.DebianMaints
 
 Tag: debug-file-should-use-detached-symbols

Reply to: