From: Michał Górny Date: Fri, 7 Feb 2020 11:54:13 +0000 (+0100) Subject: distutils-r1.eclass: Switch test deps to PYTHON_MULTI_USEDEP X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=00580752bc07ff19156538fc0855ce3f9f0b668c;p=gentoo.git distutils-r1.eclass: Switch test deps to PYTHON_MULTI_USEDEP Closes: https://bugs.gentoo.org/704522 Signed-off-by: Michał Górny --- 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