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 1/4] install-qa-check.d: Make DUS check distinguish entry points
Date: Sun, 18 Apr 2021 12:35:27
Message-Id: 20210418123454.35060-2-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 Make DISTUTILS_USE_SETUPTOOLS check explicitly distinguish rdepend due
2 to entry points from explicit rdepend. This currently does not change
3 the result but it will change in the future.
4
5 Signed-off-by: Michał Górny <mgorny@g.o>
6 ---
7 .../60distutils-use-setuptools | 16 ++++++++--------
8 1 file changed, 8 insertions(+), 8 deletions(-)
9
10 diff --git a/metadata/install-qa-check.d/60distutils-use-setuptools b/metadata/install-qa-check.d/60distutils-use-setuptools
11 index 3b9523fcdaba..8970a6ab9989 100644
12 --- a/metadata/install-qa-check.d/60distutils-use-setuptools
13 +++ b/metadata/install-qa-check.d/60distutils-use-setuptools
14 @@ -1,4 +1,4 @@
15 -# Copyright 2020 Gentoo Authors
16 +# Copyright 2020-2021 Gentoo Authors
17 # Distributed under the terms of the GNU General Public License v2
18
19 # QA check: verify correctness of DISTUTILS_USE_SETUPTOOLS
20 @@ -24,17 +24,16 @@ distutils_use_setuptools_check() {
21 if [[ -f ${egg} ]]; then
22 # if .egg-info is a file, it's plain distutils
23 new_expected=no
24 - elif grep -q -s -F '[console_scripts]' \
25 - "${egg}"/entry_points.txt
26 - then
27 - # entry_points == we need rdepend
28 - new_expected=rdepend
29 elif [[ -f ${egg}/requires.txt ]] &&
30 grep -q -s '^setuptools' \
31 <(sed -e '/^\[/,$d' "${egg}"/requires.txt)
32 then
33 # explicit *unconditional* rdepend in package metadata
34 new_expected=rdepend
35 + elif grep -q -s -F '[console_scripts]' \
36 + "${egg}"/entry_points.txt
37 + then
38 + new_expected=entry-point
39 else
40 new_expected=bdepend
41 fi
42 @@ -46,7 +45,6 @@ distutils_use_setuptools_check() {
43 fi
44 done
45
46 - # at this point, expected can contain: no bdepend rdepend
47 if [[ ${#expected[@]} -gt 1 ]] && has no "${expected[@]}"; then
48 # 'no' and '[rb]depend' are mutually exclusive
49 eerror "The package seems to have used distutils and setuptools simultaneously."
50 @@ -54,8 +52,10 @@ distutils_use_setuptools_check() {
51 eerror "https://dev.gentoo.org/~mgorny/python-guide/distutils.html#conditional-distutils-setuptools-use-in-packages"
52 eerror "Please report a bug about this and CC python@"
53 elif [[ ${#expected[@]} -gt 0 ]]; then
54 - # bdepend+rdepend=rdepend
55 + # *+rdepend=rdepend
56 has rdepend "${expected[@]}" && expected=( rdepend )
57 + # for the time being, entry points imply rdepend
58 + has entry-point "${expected[@]}" && expected=( rdepend )
59 # at this point, expected should have exactly one value
60 [[ ${#expected[@]} -eq 1 ]] || die "integrity error"
61
62 --
63 2.31.1