summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2020-02-07 12:54:13 +0100
committerMichał Górny <mgorny@gentoo.org>2020-02-09 17:10:25 +0100
commit00580752bc07ff19156538fc0855ce3f9f0b668c (patch)
tree0cfaff5fd6d48885f4e4070a85b3d3672f358009 /eclass/distutils-r1.eclass
parentdistutils-r1.eclass: Switch setuptools dep to PYTHON_MULTI_USEDEP (diff)
downloadgentoo-00580752bc07ff19156538fc0855ce3f9f0b668c.tar.gz
gentoo-00580752bc07ff19156538fc0855ce3f9f0b668c.tar.bz2
gentoo-00580752bc07ff19156538fc0855ce3f9f0b668c.zip
distutils-r1.eclass: Switch test deps to PYTHON_MULTI_USEDEP
Closes: https://bugs.gentoo.org/704522 Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'eclass/distutils-r1.eclass')
-rw-r--r--eclass/distutils-r1.eclass22
1 files changed, 16 insertions, 6 deletions
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 3d6866b8db5f..e546aadfa4a7 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -395,16 +395,16 @@ distutils_enable_tests() {
debug-print-function ${FUNCNAME} "${@}"
[[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
- local test_deps
+ local test_pkg
case ${1} in
nose)
- test_deps="dev-python/nose[${PYTHON_USEDEP}]"
+ test_pkg="dev-python/nose"
python_test() {
nosetests -v || die "Tests fail with ${EPYTHON}"
}
;;
pytest)
- test_deps="dev-python/pytest[${PYTHON_USEDEP}]"
+ test_pkg="dev-python/pytest"
python_test() {
pytest -vv || die "Tests fail with ${EPYTHON}"
}
@@ -424,13 +424,23 @@ distutils_enable_tests() {
die "${FUNCNAME}: unsupported argument: ${1}"
esac
- if [[ -n ${test_deps} || -n ${RDEPEND} ]]; then
+ local test_deps=${RDEPEND}
+ if [[ -n ${test_pkg} ]]; then
+ if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
+ test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
+ else
+ test_deps+=" $(python_gen_cond_dep "
+ ${test_pkg}[\${PYTHON_MULTI_USEDEP}]
+ ")"
+ fi
+ fi
+ if [[ -n ${test_deps} ]]; then
IUSE+=" test"
RESTRICT+=" !test? ( test )"
if [[ ${EAPI} == [56] ]]; then
- DEPEND+=" test? ( ${test_deps} ${RDEPEND} )"
+ DEPEND+=" test? ( ${test_deps} )"
else
- BDEPEND+=" test? ( ${test_deps} ${RDEPEND} )"
+ BDEPEND+=" test? ( ${test_deps} )"
fi
fi