dev-python/distlib: Sync with Gentoo

It's from Gentoo commit 6029c3cf729c495296e6a8b074d2951bdfd6b4aa.
This commit is contained in:
Flatcar Buildbot 2025-08-04 07:13:35 +00:00 committed by Krzesimir Nowak
parent 0c094777f4
commit 96c2ad523a
4 changed files with 1 additions and 87 deletions

View File

@ -1,2 +1 @@
DIST distlib-0.3.9.gh.tar.gz 1244538 BLAKE2B 08f5257f5a1125c1c76a23b9a78ded6a08f26d2f1491be9b104ab1e02a9737ae49f3750a607d3c7c744397879aeb3cd1a94a355743c95c702eec8a3cfebd70cb SHA512 d89b3ae450a02f634db10baef8d2ff445afa99cd69377f40ef07d591b4bbb2e24fff43c92eeeb93628eaee292fa1e8324eb1a842cf9401feb1f309dbb6f20a25
DIST distlib-0.4.0.gh.tar.gz 1245571 BLAKE2B c36fe726918bc04849465a55a2708b8686d2ba0b05baa7ff0595e03b7ff95a1afc45b037dbeab9bd14ec7a26ec49807ea5a7c458d8f8da16038c92f32291c62e SHA512 ff61f9ab4e38061d5fee3168c8b26c741a21403d793476477e0733b28b2ba5b1fb31ae6ddb5275efe7ad6936b7e79a5e7ec1b160c86bfbfe6b4ecff10e0193d2

View File

@ -1,59 +0,0 @@
# Copyright 2021-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{11..14} python3_{13,14}t pypy3_11 )
inherit distutils-r1
DESCRIPTION="Low-level components of distutils2/packaging"
HOMEPAGE="
https://pypi.org/project/distlib/
https://github.com/pypa/distlib/
"
SRC_URI="
https://github.com/pypa/distlib/archive/${PV}.tar.gz -> ${P}.gh.tar.gz
"
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"
# pypiserver is called as external executable
BDEPEND="
test? (
dev-python/pypiserver
dev-python/test[${PYTHON_USEDEP}]
)
"
src_prepare() {
local PATCHES=(
# use system pypiserver instead of bundled one
"${FILESDIR}"/distlib-0.3.9-system-pypiserver.py
# https://github.com/pypa/distlib/pull/244
"${FILESDIR}/${P}-freethreading.patch"
)
# make sure it's not used
rm tests/pypi-server-standalone.py || die
distutils-r1_src_prepare
}
python_test() {
local -x SKIP_ONLINE=1
local -x PYTHONHASHSEED=0
# disable system-site-packages -- distlib has no deps, and is very
# fragile to packages actually installed on the system
sed -i -e '/system-site-packages/s:true:false:' \
"${BUILD_DIR}/install${EPREFIX}/usr/pyvenv.cfg" || die
"${EPYTHON}" tests/test_all.py -v -x ||
die "Tests failed with ${EPYTHON}"
}

View File

@ -19,7 +19,7 @@ SRC_URI="
LICENSE="PSF-2"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-macos"
IUSE="test"
RESTRICT="!test? ( test )"

View File

@ -1,26 +0,0 @@
From 99248e3681036af5132bf5338ec939148da13478 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Fri, 18 Apr 2025 16:33:35 +0200
Subject: [PATCH] Update `test_wheel.WheelTestCase.test_abi` for freethreading
Update `test_wheel.WheelTestCase.test_abi` to account for the `t` suffix
added in freethreaded CPython builds.
Fixes #243
---
tests/test_wheel.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/tests/test_wheel.py b/tests/test_wheel.py
index da5bd58..c14bba3 100644
--- a/tests/test_wheel.py
+++ b/tests/test_wheel.py
@@ -719,6 +719,8 @@ def test_abi(self):
us = sysconfig.get_config_var('Py_UNICODE_SIZE')
if us == 4 or (us is None and sys.maxunicode == 0x10FFFF):
parts.append('u')
+ if bool(sysconfig.get_config_var("Py_GIL_DISABLED")):
+ parts.append('t')
if vi < (3, 5):
abi = ABI
else: