Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH 2/2] distutils-r1.eclass: Switch test deps to PYTHON_MULTI_USEDEP
Date: Fri, 07 Feb 2020 12:23:07
Message-Id: 20200207122217.503103-2-mgorny@gentoo.org
In Reply to: [gentoo-dev] [PATCH 1/2] distutils-r1.eclass: Switch setuptools dep to PYTHON_MULTI_USEDEP by "Michał Górny"
1 Closes: https://bugs.gentoo.org/704522
2 Signed-off-by: Michał Górny <mgorny@g.o>
3 ---
4 eclass/distutils-r1.eclass | 22 ++++++++++++++++------
5 1 file changed, 16 insertions(+), 6 deletions(-)
6
7 diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
8 index 3d6866b8db5f..2738340d5e26 100644
9 --- a/eclass/distutils-r1.eclass
10 +++ b/eclass/distutils-r1.eclass
11 @@ -395,16 +395,16 @@ distutils_enable_tests() {
12 debug-print-function ${FUNCNAME} "${@}"
13 [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner"
14
15 - local test_deps
16 + local test_pkg
17 case ${1} in
18 nose)
19 - test_deps="dev-python/nose[${PYTHON_USEDEP}]"
20 + test_pkg="dev-python/nose"
21 python_test() {
22 nosetests -v || die "Tests fail with ${EPYTHON}"
23 }
24 ;;
25 pytest)
26 - test_deps="dev-python/pytest[${PYTHON_USEDEP}]"
27 + test_pkg="dev-python/pytest"
28 python_test() {
29 pytest -vv || die "Tests fail with ${EPYTHON}"
30 }
31 @@ -424,13 +424,23 @@ distutils_enable_tests() {
32 die "${FUNCNAME}: unsupported argument: ${1}"
33 esac
34
35 - if [[ -n ${test_deps} || -n ${RDEPEND} ]]; then
36 + local test_deps=${RDEPEND}
37 + if [[ -n ${test_pkg} ]]; then
38 + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
39 + test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]"
40 + else
41 + test_deps+=" $(python_gen_any_dep '
42 + ${test_pkg}[${PYTHON_MULTI_USEDEP}]
43 + ')"
44 + fi
45 + fi
46 + if [[ -n ${test_deps} ]]; then
47 IUSE+=" test"
48 RESTRICT+=" !test? ( test )"
49 if [[ ${EAPI} == [56] ]]; then
50 - DEPEND+=" test? ( ${test_deps} ${RDEPEND} )"
51 + DEPEND+=" test? ( ${test_deps} )"
52 else
53 - BDEPEND+=" test? ( ${test_deps} ${RDEPEND} )"
54 + BDEPEND+=" test? ( ${test_deps} )"
55 fi
56 fi
57
58 --
59 2.25.0