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: metadata/install-qa-check.d/
Date: Sun, 16 Jan 2022 09:40:57
Message-Id: 1642326049.f344326fa3c3653d85acf12bf053bfd98f354c56.mgorny@gentoo
1 commit: f344326fa3c3653d85acf12bf053bfd98f354c56
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 16 09:39:03 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 16 09:40:49 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f344326f
7
8 install-qa-check.d: Remove 60distutils-use-setuptools
9
10 Remove the DISTUTILS_USE_SETUPTOOLS correctness check that is misfiring
11 once again (with setuptools-60+). All the special cases it was supposed
12 to detect are no longer relevant, and the upcoming PEP 517 mode
13 deprecates DUS entirely.
14
15 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
16
17 .../install-qa-check.d/60distutils-use-setuptools | 97 ----------------------
18 1 file changed, 97 deletions(-)
19
20 diff --git a/metadata/install-qa-check.d/60distutils-use-setuptools b/metadata/install-qa-check.d/60distutils-use-setuptools
21 deleted file mode 100644
22 index a7905c3f0b2f..000000000000
23 --- a/metadata/install-qa-check.d/60distutils-use-setuptools
24 +++ /dev/null
25 @@ -1,97 +0,0 @@
26 -# Copyright 2020-2021 Gentoo Authors
27 -# Distributed under the terms of the GNU General Public License v2
28 -
29 -# QA check: verify correctness of DISTUTILS_USE_SETUPTOOLS
30 -# Maintainer: Python project <python@g.o>
31 -
32 -distutils_use_setuptools_check() {
33 - # applicable only to ebuilds inheriting distutils-r1
34 - [[ ${_DISTUTILS_R1} ]] || return
35 - # 'manual' means no checking
36 - [[ ${DISTUTILS_USE_SETUPTOOLS} == manual ]] && return
37 - # pyproject.toml is verified by using it
38 - [[ ${DISTUTILS_USE_SETUPTOOLS} == pyproject.toml ]] && return
39 -
40 - # setuptools dep is not set if distutils is optional
41 - if [[ ${DISTUTILS_OPTIONAL} ]]; then
42 - if [[ ${DISTUTILS_USE_SETUPTOOLS} != bdepend ]]; then
43 - eerror "QA Notice: DISTUTILS_USE_SETUPTOOLS is not used when DISTUTILS_OPTIONAL"
44 - eerror "is enabled."
45 - fi
46 - return
47 - fi
48 -
49 - local expected=()
50 - for impl in "${_PYTHON_SUPPORTED_IMPLS[@]}"; do
51 - local EPYTHON PYTHON
52 - _python_export "${impl}" EPYTHON PYTHON
53 - [[ -x ${PYTHON} ]] || continue
54 - local sitedir=${D}$(python_get_sitedir)
55 - if [[ -d ${sitedir} ]]; then
56 - local egg new_expected
57 - while read -d $'\0' -r egg; do
58 - if [[ -f ${egg} ]]; then
59 - # if .egg-info is a file, it's plain distutils
60 - new_expected=no
61 - elif [[ -f ${egg}/requires.txt ]] &&
62 - grep -q -s '^setuptools' \
63 - <(sed -e '/^\[/,$d' "${egg}"/requires.txt)
64 - then
65 - # explicit *unconditional* rdepend in package metadata
66 - new_expected=rdepend
67 - elif grep -q -s '\[\(console\|gui\)_scripts\]' \
68 - "${egg}"/entry_points.txt
69 - then
70 - new_expected=entry-point
71 - else
72 - new_expected=bdepend
73 - fi
74 -
75 - if ! has "${new_expected}" "${expected[@]}"; then
76 - expected+=( "${new_expected[@]}" )
77 - fi
78 - done < <(find "${sitedir}" -name '*.egg-info' -print0)
79 - fi
80 - done
81 -
82 - if [[ ${#expected[@]} -gt 1 ]] && has no "${expected[@]}"; then
83 - # 'no' and '[rb]depend' are mutually exclusive
84 - eerror "QA Notice: The package seems to have used distutils and setuptools"
85 - eerror "simultaneously"
86 - eerror ""
87 - eerror "This could mean the package has bad conditions:"
88 - eerror "https://dev.gentoo.org/~mgorny/python-guide/distutils.html#conditional-distutils-setuptools-use-in-packages"
89 - eerror "Please report a bug about this and CC python@"
90 - else
91 - # if we did not find anything, also assume 'no' is desired,
92 - # we do not want the setuptools dep
93 - [[ ${#expected[@]} -eq 0 ]] && expected=( no )
94 - # *+rdepend=rdepend
95 - has rdepend "${expected[@]}" && expected=( rdepend )
96 - # NB: note that expected is overwritten above, so this implies !rdepend
97 - # if the package is using entry points, modern versions of setuptools
98 - # use built-in importlib.metadata module, so no rdep needed anymore
99 - # NB2: this is incorrect for pypy3.7 but we ignore this for the time
100 - # being
101 - has entry-point "${expected[@]}" && expected=( bdepend )
102 -
103 - if ! has ${DISTUTILS_USE_SETUPTOOLS} "${expected[@]}"; then
104 - local def=
105 - [[ ${DISTUTILS_USE_SETUPTOOLS} == bdepend ]] && def=' (or unset)'
106 -
107 - eqawarn "QA Notice: DISTUTILS_USE_SETUPTOOLS value is probably incorrect"
108 - eqawarn " have: DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}${def}"
109 - if [[ ${expected[0]} == bdepend ]]; then
110 - eqawarn " expected: (unset)"
111 - else
112 - eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected[0]}"
113 - fi
114 - fi
115 - fi
116 -}
117 -
118 -distutils_use_setuptools_check
119 -
120 -: # guarantee successful exit
121 -
122 -# vim:ft=ebuild