Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 3/4] install-qa-check.d: Future-proof entry point values for DUS
Date: Sun, 18 Apr 2021 12:36:17
Message-Id: 20210418123454.35060-4-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 0/4] install-qa-check.d/60distutils-use-setuptools future-proof and fixes by "Michał Górny"
1 Accept both 'rdepend' and 'bdepend' as DISTUTILS_USE_SETUPTOOLS values
2 for packages installing entry points. Starting with Python 3.8, these
3 packages do not require any runtime dependency. However, we do not want
4 to proactively bother people with updating everything and instead
5 provide the option to start performing opt-in updates.
6
7 Note that technically PyPy3 (that implements Python 3.7 at the moment)
8 continues requiring additional dependencies for entry point support.
9 However, we do not support PyPy3 target in stable and generally do not
10 consider it important enough to maintain extra complexity for.
11
12 Signed-off-by: Michał Górny <mgorny@g.o>
13 ---
14 .../60distutils-use-setuptools | 20 +++++++++++++------
15 1 file changed, 14 insertions(+), 6 deletions(-)
16
17 diff --git a/metadata/install-qa-check.d/60distutils-use-setuptools b/metadata/install-qa-check.d/60distutils-use-setuptools
18 index 61209302ef3e..69164608fcaa 100644
19 --- a/metadata/install-qa-check.d/60distutils-use-setuptools
20 +++ b/metadata/install-qa-check.d/60distutils-use-setuptools
21 @@ -57,18 +57,26 @@ distutils_use_setuptools_check() {
22 [[ ${#expected[@]} -eq 0 ]] && expected=( no )
23 # *+rdepend=rdepend
24 has rdepend "${expected[@]}" && expected=( rdepend )
25 - # for the time being, entry points imply rdepend
26 - has entry-point "${expected[@]}" && expected=( rdepend )
27 - # at this point, expected should have exactly one value
28 - [[ ${#expected[@]} -eq 1 ]] || die "integrity error"
29
30 - if [[ ${DISTUTILS_USE_SETUPTOOLS} != ${expected} ]]; then
31 + if has entry-point "${expected[@]}"; then
32 + if [[ ${DISTUTILS_STRICT_ENTRY_POINTS} ]]; then
33 + # option for devs to future-proof their packages
34 + # please don't let ago enable it
35 + expected=( bdepend )
36 + else
37 + # accept either rdepend or bdepend for the time being
38 + # but suggest bdepend as the future-proof option
39 + expected=( bdepend rdepend )
40 + fi
41 + fi
42 +
43 + if ! has ${DISTUTILS_USE_SETUPTOOLS} "${expected[@]}"; then
44 local def=
45 [[ ${DISTUTILS_USE_SETUPTOOLS} == bdepend ]] && def=' (or unset)'
46
47 eqawarn "DISTUTILS_USE_SETUPTOOLS value is probably incorrect"
48 eqawarn " have: DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}${def}"
49 - eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected}"
50 + eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected[0]}"
51 fi
52 fi
53 }
54 --
55 2.31.1