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 ACBF7158089 for ; Sat, 4 Nov 2023 06:10:38 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 225872BC057; Sat, 4 Nov 2023 06:09:18 +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 7F9412BC053 for ; Sat, 4 Nov 2023 06:09:17 +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 4/6] distutils-r1.eclass: Add pytest-xdist dep if EPYTEST_XDIST is set Date: Sat, 4 Nov 2023 07:05:13 +0100 Message-ID: <20231104060904.26947-5-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: c08c2a93-dfa1-4859-858f-d7ee360ee9a8 X-Archives-Hash: 098d2982a7f6503cd3edfca19b975ad4 Make `distutils_enable_tests pytest` automatically add the `dev-python/pytest-xdist` dependency if `EPYTEST_XDIST` is set. Signed-off-by: Michał Górny --- eclass/distutils-r1.eclass | 3 +++ eclass/python-utils-r1.eclass | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass index 3d69911d9209..3d756eaad556 100644 --- a/eclass/distutils-r1.eclass +++ b/eclass/distutils-r1.eclass @@ -617,6 +617,9 @@ distutils_enable_tests() { ;; pytest) test_pkgs='>=dev-python/pytest-7.3.1[${PYTHON_USEDEP}]' + if [[ ${EPYTEST_XDIST} ]]; then + test_pkgs+=' dev-python/pytest-xdist[${PYTHON_USEDEP}]' + fi ;; setup.py) ;; diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index f2a8d4d0f65e..c61f9e2ecb94 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -1311,7 +1311,9 @@ _python_check_occluded_packages() { # @DEFAULT_UNSET # @DESCRIPTION: # If set to a non-empty value, enables running tests in parallel -# via pytest-xdist plugin. +# via pytest-xdist plugin. If this variable is set prior to calling +# distutils_enable_tests in distutils-r1, a test dependency +# on dev-python/pytest-xdist is added automatically. # @VARIABLE: EPYTEST_JOBS # @USER_VARIABLE -- 2.42.0