commit:     a53c1c08f30b54aa27f3a63b9ee26ad38cf7294e
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Oct  4 13:57:40 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Oct  4 14:09:42 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a53c1c08

dev-python/dulwich: Enable py3.14

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/dulwich/dulwich-0.24.2.ebuild           |  7 +++-
 .../dulwich/files/dulwich-0.24.2-test-path.patch   | 49 ++++++++++++++++++++++
 2 files changed, 55 insertions(+), 1 deletion(-)

diff --git a/dev-python/dulwich/dulwich-0.24.2.ebuild 
b/dev-python/dulwich/dulwich-0.24.2.ebuild
index fb5cccaa6c21..ec8abb78a190 100644
--- a/dev-python/dulwich/dulwich-0.24.2.ebuild
+++ b/dev-python/dulwich/dulwich-0.24.2.ebuild
@@ -6,7 +6,7 @@ EAPI=8
 CARGO_OPTIONAL=1
 DISTUTILS_EXT=1
 DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{11..13} )
+PYTHON_COMPAT=( python3_{11..14} )
 
 CRATES="
        [email protected]
@@ -77,6 +77,11 @@ distutils_enable_sphinx docs
 
 QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/dulwich/_.*.so"
 
+PATCHES=(
+       # https://github.com/jelmer/dulwich/pull/1906
+       "${FILESDIR}/${P}-test-path.patch"
+)
+
 pkg_setup() {
        # avoid rust_pkg_setup which will die when there's no Rust found
        if use native-extensions ; then

diff --git a/dev-python/dulwich/files/dulwich-0.24.2-test-path.patch 
b/dev-python/dulwich/files/dulwich-0.24.2-test-path.patch
new file mode 100644
index 000000000000..63af9b5b2e09
--- /dev/null
+++ b/dev-python/dulwich/files/dulwich-0.24.2-test-path.patch
@@ -0,0 +1,49 @@
+From 1643810cec254c9c7d78614c4ffedb8ac7cc77c6 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <[email protected]>
+Date: Sat, 4 Oct 2025 15:52:07 +0200
+Subject: [PATCH] Fix BlackboxTestCase to respect Python venv path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Fix BlackboxTestCase to include `sysconfig.get_path("scripts")`
+in binary paths, which corresponds to the binary directory used
+in the current virtual environment.  This ensures that the tests use
+the correct dulwich executables rather than the (possibly older) version
+installed to `/usr/bin`.
+
+The test previously attempted to reconstruct the `bin` path relatively
+to the test file.  However, that logic stopped working correctly when
+tests were moved out of the package in
+245331a60d743b7b73ba3a8b15e6f4648273369f.  I suspect that the problem
+may have went unnoticed for a time, since the tests are skipped when
+the binaries can't be found.  While it is technically possible to fix
+the reconstruction logic to use the `dulwich` module path, using
+`sysconfig` ensures we are using the correct path rather than guessing.
+
+Signed-off-by: Michał Górny <[email protected]>
+---
+ tests/__init__.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/tests/__init__.py b/tests/__init__.py
+index fb70aa5b32..d7cbf8a6ea 100644
+--- a/tests/__init__.py
++++ b/tests/__init__.py
+@@ -34,6 +34,7 @@
+ import shutil
+ import subprocess
+ import sys
++import sysconfig
+ import tempfile
+ 
+ # If Python itself provides an exception, use that
+@@ -70,7 +71,7 @@ class BlackboxTestCase(TestCase):
+ 
+     # TODO(jelmer): Include more possible binary paths.
+     bin_directories: ClassVar[list[str]] = [
+-        os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", 
"bin")),
++        sysconfig.get_path("scripts"),
+         "/usr/bin",
+         "/usr/local/bin",
+     ]

Reply via email to