summaryrefslogtreecommitdiff
path: root/metadata/install-qa-check.d
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-05-31 20:59:14 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-05-31 20:59:14 +0100
commite748ba9741f6540f4675c23e3e37b73e822c13a4 (patch)
tree23dece8beabb3a3d7c6c0273b0eb40b21c62a889 /metadata/install-qa-check.d
parent908778078736bd36f7a60a2d576d415cb8e000fa (diff)
gentoo resync : 31.05.2021
Diffstat (limited to 'metadata/install-qa-check.d')
-rw-r--r--metadata/install-qa-check.d/60distutils-use-setuptools6
-rw-r--r--metadata/install-qa-check.d/60python-tests32
2 files changed, 37 insertions, 1 deletions
diff --git a/metadata/install-qa-check.d/60distutils-use-setuptools b/metadata/install-qa-check.d/60distutils-use-setuptools
index d5b9f87a21a1..effa65358aa5 100644
--- a/metadata/install-qa-check.d/60distutils-use-setuptools
+++ b/metadata/install-qa-check.d/60distutils-use-setuptools
@@ -76,7 +76,11 @@ distutils_use_setuptools_check() {
eqawarn "DISTUTILS_USE_SETUPTOOLS value is probably incorrect"
eqawarn " have: DISTUTILS_USE_SETUPTOOLS=${DISTUTILS_USE_SETUPTOOLS}${def}"
- eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected[0]}"
+ if [[ ${expected[0]} == bdepend ]]; then
+ eqawarn " expected: (unset)"
+ else
+ eqawarn " expected: DISTUTILS_USE_SETUPTOOLS=${expected[0]}"
+ fi
fi
fi
}
diff --git a/metadata/install-qa-check.d/60python-tests b/metadata/install-qa-check.d/60python-tests
new file mode 100644
index 000000000000..713ed63d3764
--- /dev/null
+++ b/metadata/install-qa-check.d/60python-tests
@@ -0,0 +1,32 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# QA check: ensure that tests are run if present
+# Maintainer: Python project <python@gentoo.org>
+
+python_test_check() {
+ # only distutils-r1 is covered for the time being
+ has distutils-r1 ${INHERITED} || return
+ # skip packages that define tests
+ declare -p -f python_test &>/dev/null && return
+ # skip packages that explicitly restrict tests
+ has test ${RESTRICT} && return
+
+ # do we have any files looking like tests?
+ local any=$(find "${WORKDIR}" -name 'test_*.py' -print -quit)
+ [[ -n ${any} ]] || return
+
+ eqawarn
+ eqawarn 'QA Notice: this package seems to contain tests but they are not enabled.'
+ eqawarn 'Please either run tests (via distutils_enable_tests or declaring'
+ eqawarn 'python_test yourself), or add RESTRICT="test" along with an explanatory'
+ eqawarn 'comment if tests cannot be run.'
+ eqawarn
+ eqatag -v python-tests.missing
+}
+
+python_test_check
+
+: # guarantee successful exit
+
+# vim:ft=ebuild