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 31C68158089 for ; Sat, 4 Nov 2023 06:09:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A1F882BC032; Sat, 4 Nov 2023 06:09:14 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 4C81E2BC02E for ; Sat, 4 Nov 2023 06:09:14 +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 1/6] distutils-r1.eclass: Refactor `d_e_t unittest` (NFC) Date: Sat, 4 Nov 2023 07:05:10 +0100 Message-ID: <20231104060904.26947-2-mgorny@gentoo.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231104060904.26947-1-mgorny@gentoo.org> References: <20231104060904.26947-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: 861b742c-3a1f-4a02-802c-722197f71e4b X-Archives-Hash: 2940504e37303a009a8c9bc7cb3bf81a Signed-off-by: Michał Górny --- eclass/distutils-r1.eclass | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 1cc91110dccf..9dd091921391 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -608,6 +608,8 @@ distutils_enable_tests() { esac [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes exactly one argument: test-runner" + + local test_deps=${RDEPEND} local test_pkg case ${1} in nose) @@ -619,7 +621,12 @@ distutils_enable_tests() { setup.py) ;; unittest) - # dep handled below + # unittest-or-fail is needed in py<3.12 + test_deps+=" + $(python_gen_cond_dep ' + dev-python/unittest-or-fail[${PYTHON_USEDEP}] + ' 3.10 3.11) + " ;; *) die "${FUNCNAME}: unsupported argument: ${1}" @@ -628,7 +635,6 @@ distutils_enable_tests() { _DISTUTILS_TEST_RUNNER=${1} python_test() { distutils-r1_python_test; } - local test_deps=${RDEPEND} if [[ -n ${test_pkg} ]]; then if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then test_deps+=" ${test_pkg}[${PYTHON_USEDEP}]" @@ -637,13 +643,6 @@ distutils_enable_tests() { ${test_pkg}[\${PYTHON_USEDEP}] ")" fi - elif [[ ${1} == unittest ]]; then - # unittest-or-fail is needed in py<3.12 - test_deps+=" - $(python_gen_cond_dep ' - dev-python/unittest-or-fail[${PYTHON_USEDEP}] - ' 3.{9..11}) - " fi if [[ -n ${test_deps} ]]; then IUSE+=" test" -- 2.42.0