public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/dulwich/files/, dev-python/dulwich/
@ 2016-04-13  2:14 Ian Delaney
  0 siblings, 0 replies; 4+ messages in thread
From: Ian Delaney @ 2016-04-13  2:14 UTC (permalink / raw
  To: gentoo-commits

commit:     b571300bec3dec1d90d450b9d257bf577feebac8
Author:     Louis Sautier <sautier.louis <AT> gmail <DOT> com>
AuthorDate: Tue Apr 12 14:36:57 2016 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Wed Apr 13 02:14:12 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b571300b

dev-python/dulwich: fix possible hang with gzip

achieved by use of patch 'dulwich-0.12.0-fix-gzip-hang.patch', run in revbumped ebuild
Package-Manager: portage-2.2.28
Closes: https://github.com/gentoo/gentoo/pull/1247

Signed-off-by: Ian Delaney <idella4 <AT> gentoo.org>

 ...wich-0.12.0.ebuild => dulwich-0.12.0-r1.ebuild} |  2 ++
 .../files/dulwich-0.12.0-fix-gzip-hang.patch       | 27 ++++++++++++++++++++++
 2 files changed, 29 insertions(+)

diff --git a/dev-python/dulwich/dulwich-0.12.0.ebuild b/dev-python/dulwich/dulwich-0.12.0-r1.ebuild
similarity index 92%
rename from dev-python/dulwich/dulwich-0.12.0.ebuild
rename to dev-python/dulwich/dulwich-0.12.0-r1.ebuild
index c4426b1..9cbd12a 100644
--- a/dev-python/dulwich/dulwich-0.12.0.ebuild
+++ b/dev-python/dulwich/dulwich-0.12.0-r1.ebuild
@@ -21,6 +21,8 @@ DEPEND="
 	dev-python/setuptools[${PYTHON_USEDEP}]
 	test? ( dev-python/gevent[$(python_gen_usedep python2_7)] )"
 RDEPEND=""
+# https://github.com/jelmer/dulwich/pull/418
+PATCHES=( "${FILESDIR}/${P}-fix-gzip-hang.patch" )
 
 DISTUTILS_IN_SOURCE_BUILD=1
 

diff --git a/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch b/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch
new file mode 100644
index 0000000..3feed01
--- /dev/null
+++ b/dev-python/dulwich/files/dulwich-0.12.0-fix-gzip-hang.patch
@@ -0,0 +1,27 @@
+From 6ba8bba4f41ca9a2a4f7568ad45cabd41d7c9964 Mon Sep 17 00:00:00 2001
+From: Jonas Haag <jonas@lophus.org>
+Date: Tue, 12 Apr 2016 15:40:38 +0200
+Subject: [PATCH] Fix hang on Gzip decompression
+
+'LimitedInputFilter' should be applied before the Gzip middleware as
+'CONTENT_LENGTH' refers to the size of the *compressed* body.  If
+applied in wrong order, this may cause 'copyfileobj()' to try to read
+more data from the socket than is available, resulting in a call to
+'recv()' that hangs forever.
+---
+ dulwich/web.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dulwich/web.py b/dulwich/web.py
+index a4fa941..d8863fe 100644
+--- a/dulwich/web.py
++++ b/dulwich/web.py
+@@ -415,7 +415,7 @@ def make_wsgi_chain(*args, **kwargs):
+     correctly wrapped with needed middleware.
+     """
+     app = HTTPGitApplication(*args, **kwargs)
+-    wrapped_app = GunzipFilter(LimitedInputFilter(app))
++    wrapped_app = LimitedInputFilter(GunzipFilter(app))
+     return wrapped_app
+ 
+ 


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/dulwich/files/, dev-python/dulwich/
@ 2025-06-23  3:25 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2025-06-23  3:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e1f60853b50ed3e88c16380a4ac6895e78a5050b
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 23 02:30:10 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Jun 23 02:30:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1f60853

dev-python/dulwich: Bump to 0.23.0

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

 dev-python/dulwich/Manifest                        |   8 ++
 dev-python/dulwich/dulwich-0.23.0.ebuild           | 119 +++++++++++++++++++++
 .../dulwich/files/dulwich-0.23.0-assert.patch      |  31 ++++++
 3 files changed, 158 insertions(+)

diff --git a/dev-python/dulwich/Manifest b/dev-python/dulwich/Manifest
index d860395fa4a4..a1fc3c74e526 100644
--- a/dev-python/dulwich/Manifest
+++ b/dev-python/dulwich/Manifest
@@ -1,21 +1,29 @@
 DIST autocfg-1.4.0.crate 17712 BLAKE2B 7f7300439899be03d001dd32b7e797bc4b9a58103081b6f7353c4b5897813cedf870b3fb1fa25d320a75326b334b44d8287e8603de34fc560d0b567143915cc6 SHA512 3b5e7c30bc73e105e4bfcab584c24fc4016db41fac9c356c6649fd841051704bbe8848e09546eb50d7c1f18ea8ce1cb72fbc268a620d5c609b3472114b5be73c
 DIST cfg-if-1.0.0.crate 7934 BLAKE2B e99a5589c11d79d77a4537b34ce0a45d37b981c123b79b807cea836c89fc3926d693458893baca2882448d3d44e3f64e06141f6d916b748daa10b8cc1ae16d1b SHA512 0fb16a8882fd30e86b62c5143b1cb18ab564e84e75bd1f28fd12f24ffdc4a42e0d2e012a99abb606c12efe3c11061ff5bf8e24ab053e550ae083f7d90f6576ff
 DIST dulwich-0.22.8.tar.gz 466542 BLAKE2B 2cec02b49e2ceb6a681e950454a2e84486a3ccc854c107fc0a051bbed99d77211760b3bf188bee065ac728b449e767f69148678412bcad49534d0d39b468c897 SHA512 bc38e79c9287357afc64324b0c52ff5b1db39138bf4f29062bb3a8b351f7000782c1c50f5284f6a6e4e2ff39cb3b811f7ee7ce4d2fd2302dd7d89c07faa19754
+DIST dulwich-0.23.0.tar.gz 575116 BLAKE2B 35d5945f32a2e8b53fe350820082cbe1c55241df7393384a3388d73a8589607926eaac3ed27133113227ae2b480dbed55c99ec8df04dbfcea3692e53a62bc0ec SHA512 d24ea390ee6aba420aaa34e60bd53bca864c1e5ca5a44f9ccb1154e5fd2de3cd1e1a90cd50ee0331b726cb4f1c9267e849058a00de4ed16ade0f6a5054b7c081
 DIST heck-0.5.0.crate 11517 BLAKE2B 5365ec43b2239a76b33a174f1a4292ece4147f9d382a68c6c60db78fdc8bad0afb1d51a65bcb25e96675372faa4ea37c318265030b0546ba51942f7c929e1835 SHA512 f044fc9c3d22466629fd8f772ec0555350fd611c0cfadca51d99a3d2f10e155f77c1091916c8a95a6b9b499f366c2e99a5fbf45b010f988bfb9b2501bf9f6a76
 DIST indoc-2.0.5.crate 14396 BLAKE2B fe838c6a855d6ff7396675a3fe9b2e0b06a93cfd4013b0b843d24d2fb81f6566528bfd1753c649646f06cb7e59262bd6ec3ed79d4e6f01d740cf0682355f2e5a SHA512 095fb56a3d87946c42a63065a8b276c2d4b9b835800014b400bb987593bf56701bad9f55d947f090740fdb7641a4f3c87fe8bfa5724709e95254d1e8e2e3616f
 DIST libc-0.2.170.crate 760076 BLAKE2B 5deb440e04b0614cf5ec5a379d66b0f05f6f3eec1268742eb9052081408ec5da5f5185e63de59f3751506541321c618fd623d7b46b1892d360b86b6e250a4c4c SHA512 b716f1a76b208c5b84692fa3084c14dbfdb4a92b86c0e01215de04dc34c6e581e5f1c4561994c65a828838d5fa232efe93c3935faf5f83c8af127a5996f1f9d3
 DIST memchr-2.7.4.crate 96670 BLAKE2B da38114beca670467c3e1fbf4e415af6f22d52e3223715d52e181babb89b872b46511563985bcc16d7ff4e82f812c6e83ad904b0fe2501b14445119dfa8240e6 SHA512 8d0e8b9c30208897d4b1b920f1bdcccd0c2b75d92a06abe4a1b2407938768abb6487d63de56c6a80419798fe69517210643dfaf11f5f5540185f0eccf220adb2
+DIST memchr-2.7.5.crate 97603 BLAKE2B ee41ef722d90265064db3ffe22d52eff8f7627ac1ae9b0bad6ca9fa06c1027dca8d67e594e03b03c944dbf85930d2dbf030c5aaed369020ca1a1ba00f153d91a SHA512 2606ee16a7dc02db95dac17cebd2cac9deb2e23d7ea62972cdb19145c06eaf75631347a49c4e6ceeff89fb6e90e992f9bca0a9c955eb5130f89ba2bd865936e1
 DIST memoffset-0.9.1.crate 9032 BLAKE2B 0aab55fe084134bb599c52d77c96400db40949b1013e7037747ada4fcec8dc4a124b6f3755f04b36e057eb2fb4a6bd6f07d6eebcf166f8a71405ef434d802fbf SHA512 3a236c0f481e36973b9f805e454c2efe4dd375e6b4ee406b57145136c70d5fbf4e1183d563ebf3b5fbde7363bbf5f08f0d88e507aae5bda4cc75664ecd0e33aa
 DIST once_cell-1.20.3.crate 33456 BLAKE2B b16081751a1b6649d0235fe9cef3fd0a9023d4f6980521933e4a411282458050ca27c1a8aa01d5237d424fa279219b5713da21d8900eccc3100d19c37d24b7a2 SHA512 3ede903f232d6ced73aa74c6b2e2ec306012517eac684db253913df4656515d087d1aff9f437a58fdeecb77cedf8a5960d6772d72bf1f1f19f1ce3fe54bc72dd
 DIST portable-atomic-1.11.0.crate 181258 BLAKE2B 627bd7c306f6c4d7991abd9f995b7e0ce110a7ace738690c287a43ce3b979691214e525876f8ace0c2f0d10d781fba95c7d3bf29aea28e09b05b06f4764db03f SHA512 71774f8308963c5399095c6b755befdf9ff3d28f9529b4bae1fe0f2aba733339a267aa6f0ff854e59fa5044a9b0c2c86bad3bc4fcaa951724c839b0d6a22041e
 DIST proc-macro2-1.0.93.crate 52388 BLAKE2B dae4493215b88f68cc485bc0ae80f0a48ebad68e0260839b1c367832d1ab778197bf040647b3fe36cfe9d5f7a496e05cd71b5914f531eb129c2d458d5f0be896 SHA512 1ae650e390e4f1b18d05f42d2ffcd025cabf72568a326cd85496c722600108b0aa0ab0161b39fcc931b8b302427f678650e703f4db57aa1a60f1751db881dc6c
 DIST pyo3-0.23.5.crate 1088533 BLAKE2B 2efae0a42c1d33e25c5871e3f61a3cea9890d278a20e2777307752b544ab3a634059bba896a1df0df4eadd0ae3c2e63b6d637aecd6699b31fac4107e3a43a387 SHA512 efd3a86dd70c199304463c0ae18dbdf4d9176d1af13b664bdd05a1e218cffda3f29f06d868d0d852d51c3e85b7e07c39617206b3feddc913b3b622f3fcf59d5f
+DIST pyo3-0.25.1.crate 1121993 BLAKE2B 79a982131fc4c4f9292e97bc8d938d236ee9cefb99bb90646a84703660ad506aee8ae1f1e626d985aa62c695722510f2697544581fa5c3a01f193be2bc2779fe SHA512 9c842c89d274dba0c8a3085a8524736245d65f07e5c05bc13fc89167cfdeb1a4ff2b4a9da9467eee918e45d01777473f39bda11efe0052859969d4fdeac1adc6
 DIST pyo3-build-config-0.23.5.crate 33885 BLAKE2B 14e3897186abb772bcde147a9ebf2a70f5cbd634cb0240e1dbba71079acd2f9cd61fd263a5d32bc583e188ec84b6db8b93f018ab954ac9da66f423183ad5c176 SHA512 72aac032e3026554761eb81dc9c57591abc4d0c329c46918da13a8cc93c0532eba2fe3d971699a50890c66d8853b93a67840b0e8f1c15747d184b873dec2894a
+DIST pyo3-build-config-0.25.1.crate 34126 BLAKE2B ca905f1f74e26f38ab63a4f5754055c9dff01f9396f81ece09b7ce067181b657e6746db3b373f7177805f6564d0df0db064b5fcab8160d5edc357e64dd32d0fc SHA512 d6fe4a46111188203a839c8c73b9835f98cd6bc5982868cbcc9f502c5a09b35c3e61117b50ef8372470051b5bc4959731907748ffca89f42f300a3081b7b0467
 DIST pyo3-ffi-0.23.5.crate 74867 BLAKE2B 5c80f7ac77ee516a891c1cb367e27fa396e55a7504dc8f92312219a90860baba3861ca2e83a1410839b99b6b3beb4c068703b841e18ea1854f70d04fef7404bd SHA512 37c25b21acc3718eab842c04489b0c16c04d33a30fe7f3f58cd80943048203375d8788ce84153ba3720df695fc95bf9f7bccacfa02b0e669a5ddbfc44d65f86c
+DIST pyo3-ffi-0.25.1.crate 78058 BLAKE2B 351fe00c99008a34a003e50cd4f6d25e6dae5a446928358cd5146ac9924254614724a015ae77d8aade7bcb497cf5e5b5018021ff5d89a8efa6412f5ccb48744e SHA512 35ab63888f49df13fab8b96b87f6c705186173923fd5898abe8730675156426f020ee517019926ba5e06cdb4fc5f91a75f648ce9eba892e9eaf3ee17864a8ec7
 DIST pyo3-macros-0.23.5.crate 8856 BLAKE2B 56e7dea9cc630e21f9e8aa43319db27f3d287baad4035bf8d921b2c8e737142e5a89decf6a04bcc095f97e035cfe4a5edd7091bba79dd68bc110b7420c29477b SHA512 bf9c12b02597cf6f119e92fe827016f393d13cfa21376811ab9bf8f49cbfd6447afe9dcbef564ad2b5b72db5338520c37c77429db8ee1ccb74de3944fc9fce7f
+DIST pyo3-macros-0.25.1.crate 8886 BLAKE2B aad9c975c90ff93429be24287d76edd945578b546a927f54d82b6d4bf184f1f8d426ac112307205346e85999a1e89b097f68310de647f27474790bff01c3517a SHA512 08387f3d1ddb0cc253eed376e6e8ebe5722b31664ec742f16c0454b52f1fbcadbe7720ae9e2d3870fe0ca2690916cf6e3e032f5a3e65d767322c068432f6d470
 DIST pyo3-macros-backend-0.23.5.crate 70938 BLAKE2B 20d5b00edf806ff19de3e3a03d10a23a29b16d544faf2bb5781032e51c3e07cd7f1a979e00b9f1abca36bc7cf1546b702ee83f85d021d74ac819b8b13bf8d140 SHA512 5e9a971d98a7b70424bf93b1f7fb326564010562dd376789be2fa6b13b89c3d34f760eb61ed49f0b013bbdfff2658d874d24a8a0b65d8f82d10d8f34b8ef5b53
+DIST pyo3-macros-backend-0.25.1.crate 76006 BLAKE2B 02225f8591585a6cbea7d6e53503bfbac395253cb0f45c588a2eb38908bf241034412832f2fcf4e9301318b5b9b82a888755d970f544f402a4f0cf9e4a6eefe9 SHA512 4c9006424630ab9bcd5dcdd45fe927a95a40a61757f0950396eb9f0c3f1794772092a19773c102220489cc621ad65d81dbbe459a1be472f6cd3211c50ef33cc2
 DIST quote-1.0.38.crate 31252 BLAKE2B a3836efbe5c21dec70c684002b47b8fc7cef643c82ee903b537a48bc0707a28106c4b33d98e60ff81e04c7520f7404b1dc4d49446e8d91dded517e476c36e1c2 SHA512 530c47c5e6372b508bf5b2b88a138408a7afa5ef52c47280ed20eccf39f8e97dfc1e0a18c1bd5472efcdc49a7a1e69566333a0a1b4c0b4f0e11e6a7a85bfe8af
 DIST syn-2.0.98.crate 297807 BLAKE2B b17e2bb4f151fba26debb722bda8e8677dcc4f57f0e88bec214f8b06e9b15c48731ca3f63d1453a44f34845c9895b3519008ce6cfb69746486324d7a8e0e0c20 SHA512 792dc70249d55face151b5481b0ebabbd3d290de78cff8b5dad8bee08e5a932ee22e54ca5fc5980e0b218197d19822c3672e02eb92ca74c8ac1328081d4d2cbf
 DIST target-lexicon-0.12.16.crate 26488 BLAKE2B e7950e4a302059a1bfc9bc15618a3c1b971a17cffae117a6e8f5f63a0d82fd2bd02680301d15338612d5426d349dd24cfee30ee787a15a7d3187f2a6825e69ce SHA512 092639957c4a0391560b6442b31c47159c04d12e971010f730a6ec9cb5389e4be903ef3d7daa06db95e64dc78b6970731fb647179ebaad2b12e9ed5e9b24da27
+DIST target-lexicon-0.13.2.crate 27923 BLAKE2B 0761f0ffdc23b9c9df86b384d59611c7b8b5e29ff068f03367ad2fe84cfb6d11e1af149b9338236978e9566fedc51387db9f239d2a602db41045ac3db907faec SHA512 d25e3cc3d679cb6b6f24c03e0c24db9d6ca31b8ed42ac9531bd7637557fbba225a6c8ac4f68a8eaf3569195814d599e668a968afbc73b940a77cbc27552cc90a
 DIST unicode-ident-1.0.17.crate 47704 BLAKE2B cafb0d9dbeabd44d45c73dfec9855d9cc8e41482ff75b7b1f4fc4423e2eeb2a5a04f7e3ce0f721fda6acf1e02f2bae77c6bb346b48bc26ab1972255b080c190d SHA512 1eaf422163126796f3181f8a3cee319ce0492e75c0c293def441872b39eba8282a95e058d0fd5dd39a8d6f3304d4ae13420a0eed901f71c157d5da99e08e1437
 DIST unindent-0.2.3.crate 7306 BLAKE2B a57407b117e99c230750c7d4a2a0899586c8271e4ba88ecb409c976905c014f42885372c234a75fbfbedf71dbed779f95f735975d150adacdcb61152a49db4c2 SHA512 2f1eb420ea3653b00d3e5fa0c2c105da8fd8a37cb3e699373c168604b799fccd5f0faf0cddce4212d119c2afb0c86b41efc3a50752b83ff7beda2bd84d360505

diff --git a/dev-python/dulwich/dulwich-0.23.0.ebuild b/dev-python/dulwich/dulwich-0.23.0.ebuild
new file mode 100644
index 000000000000..4093e6e387e2
--- /dev/null
+++ b/dev-python/dulwich/dulwich-0.23.0.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CARGO_OPTIONAL=1
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{11..13} )
+
+CRATES="
+	autocfg@1.4.0
+	heck@0.5.0
+	indoc@2.0.5
+	libc@0.2.170
+	memchr@2.7.5
+	memoffset@0.9.1
+	once_cell@1.20.3
+	portable-atomic@1.11.0
+	proc-macro2@1.0.93
+	pyo3-build-config@0.25.1
+	pyo3-ffi@0.25.1
+	pyo3-macros-backend@0.25.1
+	pyo3-macros@0.25.1
+	pyo3@0.25.1
+	quote@1.0.38
+	syn@2.0.98
+	target-lexicon@0.13.2
+	unicode-ident@1.0.17
+	unindent@0.2.3
+"
+
+inherit cargo distutils-r1 pypi
+
+DESCRIPTION="Pure-Python implementation of the Git file formats and protocols"
+HOMEPAGE="
+	https://github.com/jelmer/dulwich/
+	https://pypi.org/project/dulwich/
+"
+SRC_URI+="
+	native-extensions? (
+		${CARGO_CRATE_URIS}
+	)
+"
+
+LICENSE="GPL-2+ Apache-2.0"
+LICENSE+=" native-extensions? ("
+# Dependent crate licenses
+LICENSE+=" Apache-2.0-with-LLVM-exceptions MIT Unicode-3.0"
+LICENSE+=" )"
+
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+IUSE="doc examples +native-extensions test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	>=dev-python/urllib3-1.25[${PYTHON_USEDEP}]
+"
+BDEPEND="
+	native-extensions? (
+		${RUST_DEPEND}
+		dev-python/setuptools-rust[${PYTHON_USEDEP}]
+	)
+	test? (
+		${RDEPEND}
+		app-crypt/gpgme[python,${PYTHON_USEDEP}]
+		dev-python/fastimport[${PYTHON_USEDEP}]
+	)
+"
+
+distutils_enable_sphinx docs
+
+QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/dulwich/_.*.so"
+
+PATCHES=(
+	# https://github.com/jelmer/dulwich/pull/1607
+	"${FILESDIR}/${P}-assert.patch"
+)
+
+pkg_setup() {
+	# avoid rust_pkg_setup which will die when there's no Rust found
+	if use native-extensions ; then
+		rust_pkg_setup  # implicitly inherited through cargo
+	fi
+}
+
+src_unpack() {
+	cargo_src_unpack
+}
+
+python_compile() {
+	unset PURE
+	# TODO: enable Rust extensions
+	if ! use native-extensions; then
+		local -x PURE=1
+	fi
+
+	distutils-r1_python_compile
+}
+
+python_test() {
+	# remove interference from the tests that do stuff like user.name
+	unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
+	unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
+	unset EMAIL
+	# Do not use make check which rebuilds the extension and uses -Werror,
+	# causing unexpected failures.
+	"${EPYTHON}" -m unittest -v tests.test_suite ||
+		die "tests failed with ${EPYTHON}"
+}
+
+python_install_all() {
+	if use examples; then
+		docompress -x "/usr/share/doc/${PF}/examples"
+		dodoc -r examples
+	fi
+	distutils-r1_python_install_all
+}

diff --git a/dev-python/dulwich/files/dulwich-0.23.0-assert.patch b/dev-python/dulwich/files/dulwich-0.23.0-assert.patch
new file mode 100644
index 000000000000..f513ce2ebb55
--- /dev/null
+++ b/dev-python/dulwich/files/dulwich-0.23.0-assert.patch
@@ -0,0 +1,31 @@
+From 1d38f872e0aee83713b94b96a7c810719243ac38 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
+Date: Sun, 22 Jun 2025 23:15:16 +0100
+Subject: [PATCH] fix: Convert assertion to ApplyDeltaError in apply_delta
+ function
+
+apply_delta was raising AssertionError instead of ApplyDeltaError in the
+pure Python implementation when the Rust extension was not available.
+
+Fixes #1606
+---
+ NEWS            | 6 ++++++
+ dulwich/pack.py | 5 ++++-
+ 2 files changed, 10 insertions(+), 1 deletion(-)
+
+diff --git a/dulwich/pack.py b/dulwich/pack.py
+index a12830a59..2f1c35e07 100644
+--- a/dulwich/pack.py
++++ b/dulwich/pack.py
+@@ -2516,7 +2516,10 @@ def get_delta_header_size(delta, index):
+ 
+     src_size, index = get_delta_header_size(delta, index)
+     dest_size, index = get_delta_header_size(delta, index)
+-    assert src_size == len(src_buf), f"{src_size} vs {len(src_buf)}"
++    if src_size != len(src_buf):
++        raise ApplyDeltaError(
++            f"Unexpected source buffer size: {src_size} vs {len(src_buf)}"
++        )
+     while index < delta_length:
+         cmd = ord(delta[index : index + 1])
+         index += 1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/dulwich/files/, dev-python/dulwich/
@ 2025-07-27 11:53 Andreas Sturmlechner
  0 siblings, 0 replies; 4+ messages in thread
From: Andreas Sturmlechner @ 2025-07-27 11:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8320949182da2919d6b6c4ed8db5cdba7972d812
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 25 14:29:31 2025 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Jul 27 11:52:38 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=83209491

dev-python/dulwich: drop 0.23.0, 0.23.1, 0.23.2

Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 dev-python/dulwich/Manifest                        |   2 -
 dev-python/dulwich/dulwich-0.23.0.ebuild           | 119 ---------------------
 dev-python/dulwich/dulwich-0.23.1.ebuild           | 114 --------------------
 dev-python/dulwich/dulwich-0.23.2.ebuild           | 114 --------------------
 .../dulwich/files/dulwich-0.23.0-assert.patch      |  31 ------
 5 files changed, 380 deletions(-)

diff --git a/dev-python/dulwich/Manifest b/dev-python/dulwich/Manifest
index e57cd7449b3c..6ee2f2955667 100644
--- a/dev-python/dulwich/Manifest
+++ b/dev-python/dulwich/Manifest
@@ -2,8 +2,6 @@ DIST autocfg-1.4.0.crate 17712 BLAKE2B 7f7300439899be03d001dd32b7e797bc4b9a58103
 DIST autocfg-1.5.0.crate 18729 BLAKE2B 27580e39b366c6fca02c9db09997b6415c409f12068f1249184268bf96fd85ba659e25ec730f99e10caf452f96c486f3d7442bf09c4552b5f39519b21d6f88cc SHA512 f279856f234d39d369623576acf9546a1ca24d7fe449f36d4fb93ea75a7efaf2c4015b9616a69bbbed358c5e5882e16b045352f046aa4c049b3d13b1e8257b08
 DIST cfg-if-1.0.0.crate 7934 BLAKE2B e99a5589c11d79d77a4537b34ce0a45d37b981c123b79b807cea836c89fc3926d693458893baca2882448d3d44e3f64e06141f6d916b748daa10b8cc1ae16d1b SHA512 0fb16a8882fd30e86b62c5143b1cb18ab564e84e75bd1f28fd12f24ffdc4a42e0d2e012a99abb606c12efe3c11061ff5bf8e24ab053e550ae083f7d90f6576ff
 DIST dulwich-0.22.8.tar.gz 466542 BLAKE2B 2cec02b49e2ceb6a681e950454a2e84486a3ccc854c107fc0a051bbed99d77211760b3bf188bee065ac728b449e767f69148678412bcad49534d0d39b468c897 SHA512 bc38e79c9287357afc64324b0c52ff5b1db39138bf4f29062bb3a8b351f7000782c1c50f5284f6a6e4e2ff39cb3b811f7ee7ce4d2fd2302dd7d89c07faa19754
-DIST dulwich-0.23.0.tar.gz 575116 BLAKE2B 35d5945f32a2e8b53fe350820082cbe1c55241df7393384a3388d73a8589607926eaac3ed27133113227ae2b480dbed55c99ec8df04dbfcea3692e53a62bc0ec SHA512 d24ea390ee6aba420aaa34e60bd53bca864c1e5ca5a44f9ccb1154e5fd2de3cd1e1a90cd50ee0331b726cb4f1c9267e849058a00de4ed16ade0f6a5054b7c081
-DIST dulwich-0.23.1.tar.gz 649787 BLAKE2B ee2e6ca0b0338d34999a3c96528f944a487f418e09ec50e9712fed5beca1a0ad8efe475e6dcad23fb76065d3ec21948cb3f0f2d92a195a20054928025f98a471 SHA512 dfb5f7a101ee27476ac59d01ec8c269c70ce7141455e8b994b7d0c71edab881f088e7bdf2fcaea2f7e3b7516923d808acef75edde7bebcc7e112a0004ca2f2ea
 DIST dulwich-0.23.2.tar.gz 704361 BLAKE2B 2ba377c86a96069efa93f0e227297ba679bf04b346fe799f7b36a54bb38b51b9178c407d373a5f3e4adc4188d268ac3705a16ef98e84758cc3b8c2eaff1f5ecd SHA512 b3da400f7b89b0afd1ad14623a2a8765f2c36131f2b401ed2267637d961a65e9be32c6bb56c555d7c649d8d828088a83b433a66669b48e2a295b782fffcf9c22
 DIST heck-0.5.0.crate 11517 BLAKE2B 5365ec43b2239a76b33a174f1a4292ece4147f9d382a68c6c60db78fdc8bad0afb1d51a65bcb25e96675372faa4ea37c318265030b0546ba51942f7c929e1835 SHA512 f044fc9c3d22466629fd8f772ec0555350fd611c0cfadca51d99a3d2f10e155f77c1091916c8a95a6b9b499f366c2e99a5fbf45b010f988bfb9b2501bf9f6a76
 DIST indoc-2.0.5.crate 14396 BLAKE2B fe838c6a855d6ff7396675a3fe9b2e0b06a93cfd4013b0b843d24d2fb81f6566528bfd1753c649646f06cb7e59262bd6ec3ed79d4e6f01d740cf0682355f2e5a SHA512 095fb56a3d87946c42a63065a8b276c2d4b9b835800014b400bb987593bf56701bad9f55d947f090740fdb7641a4f3c87fe8bfa5724709e95254d1e8e2e3616f

diff --git a/dev-python/dulwich/dulwich-0.23.0.ebuild b/dev-python/dulwich/dulwich-0.23.0.ebuild
deleted file mode 100644
index 4093e6e387e2..000000000000
--- a/dev-python/dulwich/dulwich-0.23.0.ebuild
+++ /dev/null
@@ -1,119 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-CARGO_OPTIONAL=1
-DISTUTILS_EXT=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{11..13} )
-
-CRATES="
-	autocfg@1.4.0
-	heck@0.5.0
-	indoc@2.0.5
-	libc@0.2.170
-	memchr@2.7.5
-	memoffset@0.9.1
-	once_cell@1.20.3
-	portable-atomic@1.11.0
-	proc-macro2@1.0.93
-	pyo3-build-config@0.25.1
-	pyo3-ffi@0.25.1
-	pyo3-macros-backend@0.25.1
-	pyo3-macros@0.25.1
-	pyo3@0.25.1
-	quote@1.0.38
-	syn@2.0.98
-	target-lexicon@0.13.2
-	unicode-ident@1.0.17
-	unindent@0.2.3
-"
-
-inherit cargo distutils-r1 pypi
-
-DESCRIPTION="Pure-Python implementation of the Git file formats and protocols"
-HOMEPAGE="
-	https://github.com/jelmer/dulwich/
-	https://pypi.org/project/dulwich/
-"
-SRC_URI+="
-	native-extensions? (
-		${CARGO_CRATE_URIS}
-	)
-"
-
-LICENSE="GPL-2+ Apache-2.0"
-LICENSE+=" native-extensions? ("
-# Dependent crate licenses
-LICENSE+=" Apache-2.0-with-LLVM-exceptions MIT Unicode-3.0"
-LICENSE+=" )"
-
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="doc examples +native-extensions test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	>=dev-python/urllib3-1.25[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	native-extensions? (
-		${RUST_DEPEND}
-		dev-python/setuptools-rust[${PYTHON_USEDEP}]
-	)
-	test? (
-		${RDEPEND}
-		app-crypt/gpgme[python,${PYTHON_USEDEP}]
-		dev-python/fastimport[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs
-
-QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/dulwich/_.*.so"
-
-PATCHES=(
-	# https://github.com/jelmer/dulwich/pull/1607
-	"${FILESDIR}/${P}-assert.patch"
-)
-
-pkg_setup() {
-	# avoid rust_pkg_setup which will die when there's no Rust found
-	if use native-extensions ; then
-		rust_pkg_setup  # implicitly inherited through cargo
-	fi
-}
-
-src_unpack() {
-	cargo_src_unpack
-}
-
-python_compile() {
-	unset PURE
-	# TODO: enable Rust extensions
-	if ! use native-extensions; then
-		local -x PURE=1
-	fi
-
-	distutils-r1_python_compile
-}
-
-python_test() {
-	# remove interference from the tests that do stuff like user.name
-	unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
-	unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
-	unset EMAIL
-	# Do not use make check which rebuilds the extension and uses -Werror,
-	# causing unexpected failures.
-	"${EPYTHON}" -m unittest -v tests.test_suite ||
-		die "tests failed with ${EPYTHON}"
-}
-
-python_install_all() {
-	if use examples; then
-		docompress -x "/usr/share/doc/${PF}/examples"
-		dodoc -r examples
-	fi
-	distutils-r1_python_install_all
-}

diff --git a/dev-python/dulwich/dulwich-0.23.1.ebuild b/dev-python/dulwich/dulwich-0.23.1.ebuild
deleted file mode 100644
index 40a2ff0de923..000000000000
--- a/dev-python/dulwich/dulwich-0.23.1.ebuild
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-CARGO_OPTIONAL=1
-DISTUTILS_EXT=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{11..13} )
-
-CRATES="
-	autocfg@1.5.0
-	heck@0.5.0
-	indoc@2.0.6
-	libc@0.2.174
-	memchr@2.7.5
-	memoffset@0.9.1
-	once_cell@1.21.3
-	portable-atomic@1.11.1
-	proc-macro2@1.0.95
-	pyo3-build-config@0.25.1
-	pyo3-ffi@0.25.1
-	pyo3-macros-backend@0.25.1
-	pyo3-macros@0.25.1
-	pyo3@0.25.1
-	quote@1.0.40
-	syn@2.0.104
-	target-lexicon@0.13.2
-	unicode-ident@1.0.18
-	unindent@0.2.4
-"
-
-inherit cargo distutils-r1 pypi
-
-DESCRIPTION="Pure-Python implementation of the Git file formats and protocols"
-HOMEPAGE="
-	https://github.com/jelmer/dulwich/
-	https://pypi.org/project/dulwich/
-"
-SRC_URI+="
-	native-extensions? (
-		${CARGO_CRATE_URIS}
-	)
-"
-
-LICENSE="GPL-2+ Apache-2.0"
-LICENSE+=" native-extensions? ("
-# Dependent crate licenses
-LICENSE+=" Apache-2.0-with-LLVM-exceptions MIT Unicode-3.0"
-LICENSE+=" )"
-
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="doc examples +native-extensions test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	>=dev-python/urllib3-1.25[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	native-extensions? (
-		${RUST_DEPEND}
-		dev-python/setuptools-rust[${PYTHON_USEDEP}]
-	)
-	test? (
-		${RDEPEND}
-		app-crypt/gpgme[python,${PYTHON_USEDEP}]
-		dev-python/fastimport[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs
-
-QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/dulwich/_.*.so"
-
-pkg_setup() {
-	# avoid rust_pkg_setup which will die when there's no Rust found
-	if use native-extensions ; then
-		rust_pkg_setup  # implicitly inherited through cargo
-	fi
-}
-
-src_unpack() {
-	cargo_src_unpack
-}
-
-python_compile() {
-	unset PURE
-	# TODO: enable Rust extensions
-	if ! use native-extensions; then
-		local -x PURE=1
-	fi
-
-	distutils-r1_python_compile
-}
-
-python_test() {
-	# remove interference from the tests that do stuff like user.name
-	unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
-	unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
-	unset EMAIL
-	# Do not use make check which rebuilds the extension and uses -Werror,
-	# causing unexpected failures.
-	"${EPYTHON}" -m unittest -v tests.test_suite ||
-		die "tests failed with ${EPYTHON}"
-}
-
-python_install_all() {
-	if use examples; then
-		docompress -x "/usr/share/doc/${PF}/examples"
-		dodoc -r examples
-	fi
-	distutils-r1_python_install_all
-}

diff --git a/dev-python/dulwich/dulwich-0.23.2.ebuild b/dev-python/dulwich/dulwich-0.23.2.ebuild
deleted file mode 100644
index 40a2ff0de923..000000000000
--- a/dev-python/dulwich/dulwich-0.23.2.ebuild
+++ /dev/null
@@ -1,114 +0,0 @@
-# Copyright 1999-2025 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-CARGO_OPTIONAL=1
-DISTUTILS_EXT=1
-DISTUTILS_USE_PEP517=setuptools
-PYTHON_COMPAT=( python3_{11..13} )
-
-CRATES="
-	autocfg@1.5.0
-	heck@0.5.0
-	indoc@2.0.6
-	libc@0.2.174
-	memchr@2.7.5
-	memoffset@0.9.1
-	once_cell@1.21.3
-	portable-atomic@1.11.1
-	proc-macro2@1.0.95
-	pyo3-build-config@0.25.1
-	pyo3-ffi@0.25.1
-	pyo3-macros-backend@0.25.1
-	pyo3-macros@0.25.1
-	pyo3@0.25.1
-	quote@1.0.40
-	syn@2.0.104
-	target-lexicon@0.13.2
-	unicode-ident@1.0.18
-	unindent@0.2.4
-"
-
-inherit cargo distutils-r1 pypi
-
-DESCRIPTION="Pure-Python implementation of the Git file formats and protocols"
-HOMEPAGE="
-	https://github.com/jelmer/dulwich/
-	https://pypi.org/project/dulwich/
-"
-SRC_URI+="
-	native-extensions? (
-		${CARGO_CRATE_URIS}
-	)
-"
-
-LICENSE="GPL-2+ Apache-2.0"
-LICENSE+=" native-extensions? ("
-# Dependent crate licenses
-LICENSE+=" Apache-2.0-with-LLVM-exceptions MIT Unicode-3.0"
-LICENSE+=" )"
-
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~loong ~ppc ~ppc64 ~riscv ~s390 ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
-IUSE="doc examples +native-extensions test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
-	>=dev-python/urllib3-1.25[${PYTHON_USEDEP}]
-"
-BDEPEND="
-	native-extensions? (
-		${RUST_DEPEND}
-		dev-python/setuptools-rust[${PYTHON_USEDEP}]
-	)
-	test? (
-		${RDEPEND}
-		app-crypt/gpgme[python,${PYTHON_USEDEP}]
-		dev-python/fastimport[${PYTHON_USEDEP}]
-	)
-"
-
-distutils_enable_sphinx docs
-
-QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/dulwich/_.*.so"
-
-pkg_setup() {
-	# avoid rust_pkg_setup which will die when there's no Rust found
-	if use native-extensions ; then
-		rust_pkg_setup  # implicitly inherited through cargo
-	fi
-}
-
-src_unpack() {
-	cargo_src_unpack
-}
-
-python_compile() {
-	unset PURE
-	# TODO: enable Rust extensions
-	if ! use native-extensions; then
-		local -x PURE=1
-	fi
-
-	distutils-r1_python_compile
-}
-
-python_test() {
-	# remove interference from the tests that do stuff like user.name
-	unset GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_AUTHOR_DATE
-	unset GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
-	unset EMAIL
-	# Do not use make check which rebuilds the extension and uses -Werror,
-	# causing unexpected failures.
-	"${EPYTHON}" -m unittest -v tests.test_suite ||
-		die "tests failed with ${EPYTHON}"
-}
-
-python_install_all() {
-	if use examples; then
-		docompress -x "/usr/share/doc/${PF}/examples"
-		dodoc -r examples
-	fi
-	distutils-r1_python_install_all
-}

diff --git a/dev-python/dulwich/files/dulwich-0.23.0-assert.patch b/dev-python/dulwich/files/dulwich-0.23.0-assert.patch
deleted file mode 100644
index f513ce2ebb55..000000000000
--- a/dev-python/dulwich/files/dulwich-0.23.0-assert.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 1d38f872e0aee83713b94b96a7c810719243ac38 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Jelmer=20Vernoo=C4=B3?= <jelmer@jelmer.uk>
-Date: Sun, 22 Jun 2025 23:15:16 +0100
-Subject: [PATCH] fix: Convert assertion to ApplyDeltaError in apply_delta
- function
-
-apply_delta was raising AssertionError instead of ApplyDeltaError in the
-pure Python implementation when the Rust extension was not available.
-
-Fixes #1606
----
- NEWS            | 6 ++++++
- dulwich/pack.py | 5 ++++-
- 2 files changed, 10 insertions(+), 1 deletion(-)
-
-diff --git a/dulwich/pack.py b/dulwich/pack.py
-index a12830a59..2f1c35e07 100644
---- a/dulwich/pack.py
-+++ b/dulwich/pack.py
-@@ -2516,7 +2516,10 @@ def get_delta_header_size(delta, index):
- 
-     src_size, index = get_delta_header_size(delta, index)
-     dest_size, index = get_delta_header_size(delta, index)
--    assert src_size == len(src_buf), f"{src_size} vs {len(src_buf)}"
-+    if src_size != len(src_buf):
-+        raise ApplyDeltaError(
-+            f"Unexpected source buffer size: {src_size} vs {len(src_buf)}"
-+        )
-     while index < delta_length:
-         cmd = ord(delta[index : index + 1])
-         index += 1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/dulwich/files/, dev-python/dulwich/
@ 2025-10-04 14:09 Michał Górny
  0 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2025-10-04 14:09 UTC (permalink / raw
  To: gentoo-commits

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="
 	autocfg@1.5.0
@@ -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?= <mgorny@gentoo.org>
+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 <mgorny@gentoo.org>
+---
+ 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",
+     ]


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-04 14:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-23  3:25 [gentoo-commits] repo/gentoo:master commit in: dev-python/dulwich/files/, dev-python/dulwich/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2025-10-04 14:09 Michał Górny
2025-07-27 11:53 Andreas Sturmlechner
2016-04-13  2:14 Ian Delaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox