[From nobody Mon Oct 26 07:37:06 2026
Received: (at submit) by bugs.debian.org; 19 Sep 2026 20:11:04 +0000
X-Spam-Checker-Version: SpamAssassin 4.0.1-bugs.debian.org_2005_01_02
 (2024-03-25) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-116.6 required=4.0 tests=ALL_TRUSTED,BAYES_00,
 BODY_INCLUDES_PACKAGE,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,
 DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,FROMDEVELOPER,HAS_PACKAGE,MONEY,
 SPF_HELO_NONE,SPF_PASS,STOCKLIKE,USER_IN_DKIM_WELCOMELIST
 autolearn=ham autolearn_force=no
 version=4.0.1-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 54; hammy, 150; neutral, 267; spammy,
 0. spammytokens:
 hammytokens:0.000-+--Hx-spam-relays-external:sk:stravin,
 0.000-+--H*RT:sk:stravin, 0.000-+--Hx-spam-relays-external:311,
 0.000-+--H*RT:311, 0.000-+--H*RT:108
Return-path: &lt;maxy@debian.org&gt;
Received: from stravinsky.debian.org ([2001:41b8:202:deb::311:108]:35682)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;maxy@debian.org&gt;) id 1x81Oq-006Aj0-2P
 for submit@bugs.debian.org; Sat, 19 Sep 2026 20:11:04 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debian.org; 
 s=smtpauto.stravinsky;
 h=X-Debian-User:Content-Type:MIME-Version:Message-ID:
 Subject:To:From:Date:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:
 Content-Description:In-Reply-To:References;
 bh=1/NuYu/tIa51SO1pIiRq5fVrq2kS+Z/sgA943PAnO4M=; b=Uf4sf5NrVa3w3pC2GngHGSVt9D
 ig7aYNlpTcegs2E6YkQhqaYOgCsvn7hqngvA8ZoOgzzFHHBOjaLDjZ2LefiTaLDlAHuKNgJEpu7gl
 3dNF9GUKFomZjVVVeG9etniAUtW9uPuzatCRDZigkwxHP/KpWdsMXCbzZYgghxtKkQkrqgr4g8mPz
 tNnZFGq0L+wSgiIvu1O3HxLE90b6GEvM22v5woQbjlGqU2lMz/l6NeKm5w5iobm1HGzWRhTaKGNzq
 dOtkDHnTJ0sbK1utwEXqsI8ESRlIo6oRnn5AFzT8K8zrpn/5yPmBxXWghcX54CpCCFNN3fEpt7Fy4
 wkv8RwVg==;
Received: from authenticated-user by stravinsky.debian.org with esmtpsa
 (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.96) (envelope-from &lt;maxy@debian.org&gt;) id 1x81Oo-000toY-2B
 for submit@bugs.debian.org; Sat, 19 Sep 2026 20:11:03 +0000
Date: Sat, 19 Sep 2026 22:11:01 +0200
From: Maximiliano Curia &lt;maxy@debian.org&gt;
To: submit@bugs.debian.org
Subject: openbabel: builds only against the default Python version
Message-ID: &lt;aq7sVRWXP6xH0aWe@hecuba.gnuservers.com.ar&gt;
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary=&quot;U65jIap5fPWeVf+W&quot;
Content-Disposition: inline
X-Debian-User: maxy
Delivered-To: submit@bugs.debian.org

--U65jIap5fPWeVf+W
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline

Package: src:openbabel
Version: 3.2.0+dfsg-1
User: debian-python@lists.debian.org
Usertags: python3.15
Tags: patch, ftbfs, forky, sid
Severity: important

Hi!

While rebuilding the python related packages against the Python 3.15rc2
version we found that openbabel only builds against the default Python
version.

This is a problem because it doesn't build the module for Python 3.15,
making packages that depend on it also unable to build for Python 3.15
(for example python-emmet-core).

To fix this, I've made a change that makes openbabel build against all
supported Python versions.

I've applied the fix in the sandbox [1] to verify that both openbabel
and the packages that depend on it build successfully. Please consider
applying the patch to support the upcoming 3.15 version.

Setting the severity to important for now. Once Python 3.15 is released,
it will be added to python3-defaults and this bug will become release
critical.

Happy hacking,

[1]: https://debusine.debian.net/debian/r-python-python3.15/

-- 
&quot;Can you imagine what I would do if I could do all I can?&quot; -- Sun Tzu
Saludos /\/\ /\ &gt;&lt; `/

--U65jIap5fPWeVf+W
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename=openbabel_3.2.0+dfsg-1.1.diff

diff --git a/debian/changelog b/debian/changelog
index 7c6a99d28..374b70963 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+openbabel (3.2.0+dfsg-1.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Build python extensions for all supported python3 versions.
+
+ -- Maximiliano Curia &lt;maxy@debian.org&gt;  Fri, 18 Sep 2026 10:20:00 +0200
+
 openbabel (3.2.0+dfsg-1) unstable; urgency=medium
 
   * Upload to unstable
diff --git a/debian/control b/debian/control
index 9be254797..3b4ae39d1 100644
--- a/debian/control
+++ b/debian/control
@@ -22,7 +22,7 @@ Build-Depends: cmake,
                libxml2-dev,
                pkgconf,
                python3-all,
-               python3-dev,
+               python3-all-dev,
                python3-setuptools,
                rapidjson-dev,
                swig,
diff --git a/debian/rules b/debian/rules
index 664aae696..902d39ba4 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,6 +1,7 @@
 #!/usr/bin/make -f
 
--include /usr/share/python3/python.mk
+include /usr/share/dpkg/architecture.mk
+include /usr/share/dpkg/buildtools.mk
 
 DEB_BUILD_PARALLEL ?= $(shell guess_concurrency --require-mem 16G)
 export PYBUILD_TEST_ARGS=-n $(DEB_BUILD_PARALLEL)
@@ -16,6 +17,7 @@ export LDFLAGS      := $(shell dpkg-buildflags --get LDFLAGS)
 DH_AUTO_CONFIGURE_OPTS := -DCMAKE_BUILD_TYPE=None \
                           -DLIB_SUFFIX=/$(DEB_HOST_MULTIARCH) \
                           -DPYTHON_BINDINGS=ON -DPYTHON_EXECUTABLE=/usr/bin/python3 \
+                          -DPYTHON_INSTDIR=/usr/lib/python3/dist-packages \
                           -DPERL_BINDINGS=ON \
                           -DOBPERL_INSTALLDIRS=vendor \
                           -DRUN_SWIG=ON \
@@ -36,9 +38,26 @@ override_dh_auto_configure:
 override_dh_auto_build:
 	dh_auto_build
 	make -C $(CURDIR)/builddir docs
+	mkdir -p $(CURDIR)/builddir/scripts
+	for pyversion in $(PYVERS); do \
+		pyinclude=$$(python$$pyversion -c &quot;import sysconfig; print(sysconfig.get_path('include'))&quot;); \
+		extsuffix=$$(python$$pyversion -c &quot;import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))&quot;); \
+		$(CXX) $(CXXFLAGS) $(CPPFLAGS) -fPIC -shared \
+			-I$(CURDIR)/include -I$(CURDIR)/builddir/include -I/usr/include/eigen3 -I$$pyinclude \
+			-Wno-deprecated-declarations \
+			$(CURDIR)/scripts/python/openbabel/openbabel-python.cpp \
+			-o $(CURDIR)/builddir/scripts/_openbabel$$extsuffix \
+			$(LDFLAGS) -L$(CURDIR)/builddir/lib/$(DEB_HOST_MULTIARCH) -L$(CURDIR)/builddir/lib -lopenbabel; \
+	done
 
 override_dh_auto_install:
 	dh_auto_install
+	rm -f $(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openbabel/_openbabel.so
+	for pyversion in $(PYVERS); do \
+		extsuffix=$$(python$$pyversion -c &quot;import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))&quot;); \
+		install -m 0644 $(CURDIR)/builddir/scripts/_openbabel$$extsuffix \
+			$(CURDIR)/debian/tmp/usr/lib/python3/dist-packages/openbabel/; \
+	done
 	mkdir --parents $(CURDIR)/debian/tmp/$(PERL_ARCHLIB)
 	mv debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/auto debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/Chemistry \
 		$(CURDIR)/debian/tmp/$(PERL_ARCHLIB)
diff --git a/debian/tests/control b/debian/tests/control
index 9fd0b8bc5..316f90bc0 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,6 +1,7 @@
 Tests: python3
 Depends:
  @,
+ python3-all
 Restrictions:
  allow-stderr,
  rw-build-tree,
diff --git a/debian/tests/python3 b/debian/tests/python3
index 823e85705..b9f2faf53 100644
--- a/debian/tests/python3
+++ b/debian/tests/python3
@@ -6,46 +6,48 @@ sed -i 's/&quot;\.\.&quot;/&quot;\/usr&quot;/' test/testbabel.py
 
 arch=$(dpkg --print-architecture)
 fails=
-for TEST in test/test*.py
-do
-    fail_on_failure=true
-    case $TEST in
-      test/testroundtrip.py)
-        # timesout?
-        echo &quot;Skipping ${TEST} ...&quot;
-        continue;;
-      test/testdistgeom.py)
-	# timesout and exhausts memory
-	echo &quot;Skipping ${TEST} ...&quot;
-	continue;;
-      test/testbindings.py)
-        case &quot;$arch&quot; in
-          amd64)
-            true;;
-          *)
-            fail_on_failure=false;;
-        esac;;
-      test/testsym.py)
-          # on most/all non-amd64 architecture it fails
-          # if it finishes at all, it takes a very long time
-          # on worker13, the test takes 1000 times longer than on other amd64 hosts
-          echo &quot;Skipping ${TEST} ...&quot;
-          continue;;
-      test/testobconv_writers.py)
-        case &quot;$arch&quot; in arm64|i386|ppc64el|s390x)
-          fail_on_failure=false;;
-        esac;;
-    esac
-    echo &quot;Running ${TEST} ...&quot;
-    if python3 ${TEST}; then
-	:
-    else
-       if [ $fail_on_failure = &quot;false&quot; ] ; then
-         echo &quot;Ignoring ${TEST} on $arch ...&quot;
-       else
-         fails=&quot;$fails $TEST&quot;
-       fi
-    fi
+for pyversion in $(py3versions -s); do
+    for TEST in test/test*.py
+    do
+        fail_on_failure=true
+        case $TEST in
+          test/testroundtrip.py)
+            # timesout?
+            echo &quot;Skipping ${TEST} ...&quot;
+            continue;;
+          test/testdistgeom.py)
+	    # timesout and exhausts memory
+	    echo &quot;Skipping ${TEST} ...&quot;
+	    continue;;
+          test/testbindings.py)
+            case &quot;$arch&quot; in
+              amd64)
+                true;;
+              *)
+                fail_on_failure=false;;
+            esac;;
+          test/testsym.py)
+              # on most/all non-amd64 architecture it fails
+              # if it finishes at all, it takes a very long time
+              # on worker13, the test takes 1000 times longer than on other amd64 hosts
+              echo &quot;Skipping ${TEST} ...&quot;
+              continue;;
+          test/testobconv_writers.py)
+            case &quot;$arch&quot; in arm64|i386|ppc64el|s390x)
+              fail_on_failure=false;;
+            esac;;
+        esac
+        echo &quot;Running ${TEST} with ${pyversion} ...&quot;
+        if ${pyversion} ${TEST}; then
+	    :
+        else
+           if [ $fail_on_failure = &quot;false&quot; ] ; then
+             echo &quot;Ignoring ${TEST} on $arch with ${pyversion} ...&quot;
+           else
+             fails=&quot;$fails ${TEST}(${pyversion})&quot;
+           fi
+        fi
+    done
 done
 
 if [ -n &quot;$fails&quot; ]; then

--U65jIap5fPWeVf+W--
]