Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/distlib/
Date: Wed, 11 May 2022 16:43:53
Message-Id: 1652287415.5e92f005f51b420770b67ff1e934c44257cb7067.mgorny@gentoo
1 commit: 5e92f005f51b420770b67ff1e934c44257cb7067
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed May 11 15:55:02 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Wed May 11 16:43:35 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e92f005
7
8 dev-python/distlib: EAPI 8, reenable tests
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/distlib/distlib-0.3.4-r2.ebuild | 63 ++++++++++++++++++++++++++++++
13 1 file changed, 63 insertions(+)
14
15 diff --git a/dev-python/distlib/distlib-0.3.4-r2.ebuild b/dev-python/distlib/distlib-0.3.4-r2.ebuild
16 new file mode 100644
17 index 000000000000..3055a7e0b6fe
18 --- /dev/null
19 +++ b/dev-python/distlib/distlib-0.3.4-r2.ebuild
20 @@ -0,0 +1,63 @@
21 +# Copyright 2021-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +
26 +DISTUTILS_USE_PEP517=setuptools
27 +PYTHON_COMPAT=( python3_{8..10} pypy3 )
28 +
29 +inherit distutils-r1 vcs-snapshot
30 +
31 +DESCRIPTION="Low-level components of distutils2/packaging"
32 +HOMEPAGE="
33 + https://pypi.org/project/distlib/
34 + https://bitbucket.org/pypa/distlib/
35 +"
36 +# pypi has zip only :-(
37 +SRC_URI="
38 + https://bitbucket.org/pypa/distlib/get/${PV}.tar.bz2 -> ${P}.tar.bz2
39 +"
40 +
41 +LICENSE="PSF-2"
42 +SLOT="0"
43 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
44 +IUSE="test"
45 +RESTRICT="!test? ( test )"
46 +
47 +# pypiserver is called as external executable
48 +# openpyxl installs invalid metadata that breaks distlib
49 +BDEPEND="
50 + test? (
51 + dev-python/pypiserver
52 + !!<dev-python/openpyxl-3.0.3[${PYTHON_USEDEP}]
53 + )
54 +"
55 +
56 +src_prepare() {
57 + # make sure they're not used
58 + rm tests/pypi-server-standalone.py || die
59 +
60 + # use system pypiserver instead of broken bundled one
61 + eapply "${FILESDIR}"/distlib-0.3.2-system-pypiserver.py || die
62 +
63 + # doesn't work with our patched pip
64 + sed -i -e '/PIP_AVAIL/s:True:False:' tests/test_wheel.py || die
65 +
66 + # broken with pypy3
67 + sed -i -e 's:test_custom_shebang:_&:' tests/test_scripts.py || die
68 +
69 + distutils-r1_src_prepare
70 +}
71 +
72 +python_test() {
73 + local -x SKIP_ONLINE=1
74 + local -x PYTHONHASHSEED=0
75 +
76 + # disable system-site-packages -- distlib has no deps, and is very
77 + # fragile to packages actually installed on the system
78 + sed -i -e '/system-site-packages/s:true:false:' \
79 + "${BUILD_DIR}/install${EPREFIX}/usr/bin/pyvenv.cfg" || die
80 +
81 + "${EPYTHON}" tests/test_all.py -v -x ||
82 + die "Tests failed with ${EPYTHON}"
83 +}