From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 391A6158041 for ; Mon, 1 Apr 2024 09:40:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 485ABE2A33; Mon, 1 Apr 2024 09:40:58 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2B0D8E2A32 for ; Mon, 1 Apr 2024 09:40:58 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 43EEE3431C4 for ; Mon, 1 Apr 2024 09:40:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 8812A1624 for ; Mon, 1 Apr 2024 09:40:54 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1711964192.380a5cbd2745ddfea53724246bf3b98976982064.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/distutils-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 380a5cbd2745ddfea53724246bf3b98976982064 X-VCS-Branch: master Date: Mon, 1 Apr 2024 09:40:54 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: eca3f24e-8c74-4386-9837-5d6bd5c02b96 X-Archives-Hash: c4c64509cf7bdbd1f3107585355d4ef1 commit: 380a5cbd2745ddfea53724246bf3b98976982064 Author: Michał Górny gentoo org> AuthorDate: Mon Mar 25 18:44:50 2024 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Apr 1 09:36:32 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=380a5cbd distutils-r1.eclass: Refactor `distutils_enable_tests pytest` Refactor `distutils_enable_tests pytest` to move `test_pkgs` logic straight into pytest block, as it is not used by any other variant anymore. Signed-off-by: Michał Górny gentoo.org> eclass/distutils-r1.eclass | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 44553f8da6f3..a1617999a037 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -606,16 +606,23 @@ distutils_enable_tests() { [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner" local test_deps=${RDEPEND} - local test_pkgs case ${1} in pytest) - test_pkgs='>=dev-python/pytest-7.4.4[${PYTHON_USEDEP}]' + local test_pkgs='>=dev-python/pytest-7.4.4[${PYTHON_USEDEP}]' if [[ -n ${EPYTEST_TIMEOUT} ]]; then test_pkgs+=' dev-python/pytest-timeout[${PYTHON_USEDEP}]' fi if [[ ${EPYTEST_XDIST} ]]; then test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]' fi + + if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then + test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}" + else + test_deps+=" $(python_gen_cond_dep " + ${test_pkgs} + ")" + fi ;; setup.py) ;; @@ -634,15 +641,6 @@ distutils_enable_tests() { _DISTUTILS_TEST_RUNNER=${1} python_test() { distutils-r1_python_test; } - if [[ -n ${test_pkgs} ]]; then - if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then - test_deps+=" ${test_pkgs//'${PYTHON_USEDEP}'/${PYTHON_USEDEP}}" - else - test_deps+=" $(python_gen_cond_dep " - ${test_pkgs} - ")" - fi - fi if [[ -n ${test_deps} ]]; then IUSE+=" test" RESTRICT+=" !test? ( test )"