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 C6B3F158041 for ; Tue, 26 Mar 2024 18:27:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 8FBDDE2AC1; Tue, 26 Mar 2024 18:25:59 +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 D7852E2AB5 for ; Tue, 26 Mar 2024 18:25:58 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 5/7] distutils-r1.eclass: Refactor `distutils_enable_tests pytest` Date: Tue, 26 Mar 2024 19:25:43 +0100 Message-ID: <20240326182545.247160-5-mgorny@gentoo.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240326182545.247160-1-mgorny@gentoo.org> References: <20240326182545.247160-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: cf937956-460f-40c2-b924-80e50f279f1a X-Archives-Hash: 299c2681526c5202dbc37852f8e1ce61 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 --- 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 )" -- 2.44.0