summaryrefslogtreecommitdiff
path: root/metadata/install-qa-check.d/60distutils-use-setuptools
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-04 22:28:33 +0100
commita978c074e4272bb901fbe4a10de0a7b2af574f17 (patch)
tree8c764c1cc0576389ce22abd317bceba71ea5732d /metadata/install-qa-check.d/60distutils-use-setuptools
parent40aaaa64e86ba6710bbeb31c4615a6ce80e75e11 (diff)
gentoo resync : 04.05.2021
Diffstat (limited to 'metadata/install-qa-check.d/60distutils-use-setuptools')
-rw-r--r--metadata/install-qa-check.d/60distutils-use-setuptools37
1 files changed, 24 insertions, 13 deletions
diff --git a/metadata/install-qa-check.d/60distutils-use-setuptools b/metadata/install-qa-check.d/60distutils-use-setuptools
index 3b9523fcdaba..d5b9f87a21a1 100644
--- a/metadata/install-qa-check.d/60distutils-use-setuptools
+++ b/metadata/install-qa-check.d/60distutils-use-setuptools
@@ -1,4 +1,4 @@
-# Copyright 2020 Gentoo Authors
+# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# QA check: verify correctness of DISTUTILS_USE_SETUPTOOLS
@@ -24,17 +24,16 @@ distutils_use_setuptools_check() {
if [[ -f ${egg} ]]; then
# if .egg-info is a file, it's plain distutils
new_expected=no
- elif grep -q -s -F '[console_scripts]' \
- "${egg}"/entry_points.txt
- then
- # entry_points == we need rdepend
- new_expected=rdepend
elif [[ -f ${egg}/requires.txt ]] &&
grep -q -s '^setuptools' \
<(sed -e '/^\[/,$d' "${egg}"/requires.txt)
then
# explicit *unconditional* rdepend in package metadata
new_expected=rdepend
+ elif grep -q -s '\[\(console\|gui\)_scripts\]' \
+ "${egg}"/entry_points.txt
+ then
+ new_expected=entry-point
else
new_expected=bdepend
fi
@@ -46,26 +45,38 @@ distutils_use_setuptools_check() {
fi
done
- # at this point, expected can contain: no bdepend rdepend
if [[ ${#expected[@]} -gt 1 ]] && has no "${expected[@]}"; then
# 'no' and '[rb]depend' are mutually exclusive
eerror "The package seems to have used distutils and setuptools simultaneously."
eerror "This could mean the package has bad conditions:"
eerror "https://dev.gentoo.org/~mgorny/python-guide/distutils.html#conditional-distutils-setuptools-use-in-packages"
eerror "Please report a bug about this and CC python@"
- elif [[ ${#expected[@]} -gt 0 ]]; then
- # bdepend+rdepend=rdepend
+ else
+ # if we did not find anything, also assume 'no' is desired,
+ # we do not want the setuptools dep
+ [[ ${#expected[@]} -eq 0 ]] && expected=( no )
+ # *+rdepend=rdepend
has rdepend "${expected[@]}" && expected=( rdepend )
- # at this point, expected should have exactly one value
- [[ ${#expected[@]} -eq 1 ]] || die "integrity error"
- if [[ ${DISTUTILS_USE_SETUPTOOLS} != ${expected} ]]; then
+ if has entry-point "${expected[@]}"; then
+ if [[ ${DISTUTILS_STRICT_ENTRY_POINTS} ]]; then
+ # option for devs to future-proof their packages
+ # please don't let ago enable it
+ expected=( bdepend )
+ else
+ # accept either rdepend or bdepend for the time being
+ # but suggest bdepend as the future-proof option
+ expected=( bdepend rdepend )
+ fi
+ fi
+
+ if ! has ${DISTUTILS_USE_SETUPTOOLS} "${expected[@]}"; then
local def=
[[ ${DISTUTILS_USE_SETUPTOOLS} == bdepend ]] && def=' (or unset)'
eqawarn "DISTUTILS_USE_SETUPTOOLS value is probably incorrect"
eqawarn " have: DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}${def}"
- eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected}"
+ eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected[0]}"
fi
fi
}