From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 finch.gentoo.org (Postfix) with ESMTPS id BF6C21582EF for ; Sat, 01 Mar 2025 08:16:48 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 7E3A3343096 for ; Sat, 01 Mar 2025 08:16:48 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 7CC2C1102B7; Sat, 01 Mar 2025 08:16:47 +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) server-digest SHA256) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 75D9F1102B7 for ; Sat, 01 Mar 2025 08:16:47 +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) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2FA9F3430D1 for ; Sat, 01 Mar 2025 08:16:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 890E52731 for ; Sat, 01 Mar 2025 08:16:45 +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: <1740816999.61febafe65f875bad8fa868bdcfad4b5ba448fbe.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pytest-cov/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pytest-cov/pytest-cov-6.0.0.ebuild X-VCS-Directories: dev-python/pytest-cov/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 61febafe65f875bad8fa868bdcfad4b5ba448fbe X-VCS-Branch: master Date: Sat, 01 Mar 2025 08:16:45 +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: 525586a5-487e-4ef1-9bc6-5dc95f593e34 X-Archives-Hash: 4be80e8b02bd9ffe8690fea6fe6d0a9b commit: 61febafe65f875bad8fa868bdcfad4b5ba448fbe Author: Michał Górny gentoo org> AuthorDate: Sat Mar 1 08:15:08 2025 +0000 Commit: Michał Górny gentoo org> CommitDate: Sat Mar 1 08:16:39 2025 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61febafe dev-python/pytest-cov: Fix tests Closes: https://bugs.gentoo.org/889886 Signed-off-by: Michał Górny gentoo.org> dev-python/pytest-cov/pytest-cov-6.0.0.ebuild | 28 +++++++++++++-------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/dev-python/pytest-cov/pytest-cov-6.0.0.ebuild b/dev-python/pytest-cov/pytest-cov-6.0.0.ebuild index 7a0c80e7d268..c03e424ab078 100644 --- a/dev-python/pytest-cov/pytest-cov-6.0.0.ebuild +++ b/dev-python/pytest-cov/pytest-cov-6.0.0.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2024 Gentoo Authors +# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -7,7 +7,7 @@ DISTUTILS_USE_PEP517=setuptools PYPI_NO_NORMALIZE=1 PYTHON_COMPAT=( python3_{10..12} pypy3 ) -inherit distutils-r1 multiprocessing pypi +inherit distutils-r1 pypi DESCRIPTION="pytest plugin for coverage reporting" HOMEPAGE=" @@ -24,12 +24,13 @@ RDEPEND=" >=dev-python/pytest-3.6[${PYTHON_USEDEP}] >=dev-python/coverage-6.4.4-r1[${PYTHON_USEDEP}] " +# NB: xdist is also used directly in the test suite BDEPEND=" test? ( - dev-python/virtualenv[${PYTHON_USEDEP}] dev-python/fields[${PYTHON_USEDEP}] >=dev-python/process-tests-2.0.2[${PYTHON_USEDEP}] dev-python/pytest-xdist[${PYTHON_USEDEP}] + dev-python/virtualenv[${PYTHON_USEDEP}] ) " @@ -39,6 +40,7 @@ PATCHES=( distutils_enable_sphinx docs \ dev-python/furo +EPYTEST_XDIST=1 distutils_enable_tests pytest python_test() { @@ -46,18 +48,14 @@ python_test() { local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 local -x PYTEST_PLUGINS=pytest_cov.plugin,xdist.plugin,xdist.looponfail - local src=$( - "${EPYTHON}" -c "import coverage as m; print(*m.__path__)" || die - ) - # TODO: why do we need to do that?! # https://github.com/pytest-dev/pytest-cov/issues/517 - ln -s "${src}" \ - "${BUILD_DIR}/install$(python_get_sitedir)/coverage" || die - - nonfatal epytest -n "$(makeopts_jobs)" --dist=worksteal - local ret=${?} - - rm "${BUILD_DIR}/install$(python_get_sitedir)/coverage" || die + local -x PYTHONPATH=$(python_get_sitedir):${PYTHONPATH} + local EPYTEST_DESELECT=( + # this one's broken by the PYTHONPATH hack + # the alternative is to symlink coverage and pytest into venv, + # but that's ugly and likely to break again in the future + tests/test_pytest_cov.py::test_central_subprocess_change_cwd_with_pythonpath + ) - [[ ${ret} -ne 0 ]] && die "epytest failed on ${EPYTHON}" + epytest }