summaryrefslogtreecommitdiff
path: root/dev-python/coverage/coverage-7.17.0.ebuild
diff options
context:
space:
mode:
authorCrucible <crucible@localhost>2026-10-23 03:06:05 -0500
committerCrucible <crucible@localhost>2026-10-23 03:06:05 -0500
commita12baa2c6bdd04b0d13246478eb2fe31665f042f (patch)
tree45584454b94554adc977b91d3d6e2990b376050a /dev-python/coverage/coverage-7.17.0.ebuild
parent0039841fcf8a9deaf0f4851ba1c1e80baeea37e2 (diff)
downloadsrcux-a12baa2c6bdd04b0d13246478eb2fe31665f042f.tar.gz
srcux-a12baa2c6bdd04b0d13246478eb2fe31665f042f.tar.xz
srcux-a12baa2c6bdd04b0d13246478eb2fe31665f042f.zip
Publish srcux candidate 0000000851-20261023-030226HEADdevelop
Diffstat (limited to 'dev-python/coverage/coverage-7.17.0.ebuild')
-rw-r--r--dev-python/coverage/coverage-7.17.0.ebuild119
1 files changed, 119 insertions, 0 deletions
diff --git a/dev-python/coverage/coverage-7.17.0.ebuild b/dev-python/coverage/coverage-7.17.0.ebuild
new file mode 100644
index 000000000000..e06d7b973915
--- /dev/null
+++ b/dev-python/coverage/coverage-7.17.0.ebuild
@@ -0,0 +1,119 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYPI_VERIFY_REPO=https://github.com/coveragepy/coveragepy
+PYTHON_FULLY_TESTED=( python3_{12..15} python3_{14,15}t )
+PYTHON_COMPAT=( python3_{13..14} )
+PYTHON_REQ_USE="threads(+),sqlite(+)"
+
+inherit distutils-r1 multiprocessing pypi
+
+DESCRIPTION="Code coverage measurement for Python"
+HOMEPAGE="
+ https://coverage.readthedocs.io/en/latest/
+ https://github.com/coveragepy/coveragepy/
+ https://pypi.org/project/coverage/
+"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-macos"
+IUSE="+native-extensions"
+
+BDEPEND="
+ test? (
+ >=dev-python/unittest-mixins-1.4[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep '
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ ' "${PYTHON_FULLY_TESTED[@]}")
+ )
+"
+
+EPYTEST_PLUGINS=( pytest-{rerunfailures,xdist} )
+EPYTEST_XDIST=1
+distutils_enable_tests pytest
+
+python_compile() {
+ if ! use native-extensions; then
+ local -x COVERAGE_DISABLE_EXTENSION=1
+ fi
+
+ distutils-r1_python_compile
+}
+
+test_tracer() {
+ local -x COVERAGE_CORE=${1}
+
+ if [[ ${EPYTHON} == python3.15 && ${COVERAGE_CORE} == sysmon ]] &&
+ has_version "dev-lang/python:3.15[jit]"
+ then
+ local EPYTEST_DESELECT=(
+ "${EPYTEST_DESELECT[@]}"
+ tests/test_arcs.py::LoopArcTest::test_continue
+ )
+ fi
+
+ einfo " Testing with the ${COVERAGE_CORE} core ..."
+ nonfatal epytest -o addopts= "${@:2}" tests ||
+ die "Tests failed with ${EPYTHON}, ${COVERAGE_CORE} core"
+}
+
+python_test() {
+ local EPYTEST_PLUGINS=( "${EPYTEST_PLUGINS[@]}" )
+ if has_version "dev-python/hypothesis[${PYTHON_USEDEP}]"; then
+ EPYTEST_PLUGINS+=( hypothesis )
+ fi
+
+ local EPYTEST_DESELECT=(
+ # broken because of pytest plugins explicity loaded
+ tests/test_debug.py::ShortStackTest::test_short_stack{,_skip}
+ # these expect specific availability of C extension matching
+ # COVERAGE_CORE (which breaks testing pytracer on CPython)
+ tests/test_cmdline.py::CmdLineStdoutTest::test_version
+ tests/test_debug.py::DebugTraceTest::test_debug_sys_ctracer
+ # packaging tests, fragile to setuptools version
+ tests/test_setup.py
+ )
+ local EPYTEST_IGNORE=(
+ # pip these days insists on fetching build deps from Internet
+ tests/test_venv.py
+ )
+
+ "${EPYTHON}" igor.py zip_mods || die
+
+ local -x COVERAGE_TESTING=True
+ # TODO: figure out why they can't be imported inside test env
+ local -x COVERAGE_NO_CONTRACTS=1
+
+ local jobs=${EPYTEST_JOBS:-$(makeopts_jobs)}
+ local xdist_args=()
+ if [[ ${jobs} -gt 1 ]]; then
+ # required upstream to avoid cross-test conflicts
+ xdist_args+=( --dist=loadgroup )
+ fi
+
+ local prev_opt=$(shopt -p nullglob)
+ shopt -s nullglob
+ local c_ext=( "${BUILD_DIR}/install$(python_get_sitedir)"/coverage/*.so )
+ ${prev_opt}
+
+ if [[ -n ${c_ext} ]]; then
+ cp "${c_ext}" coverage/ || die
+ test_tracer ctrace "${xdist_args[@]}"
+ fi
+
+ test_tracer pytrace "${xdist_args[@]}"
+
+ # available since CPython 3.12
+ if [[ ${EPYTHON} == python* ]]; then
+ test_tracer sysmon "${xdist_args[@]}"
+ fi
+
+ if [[ -n ${c_ext} ]]; then
+ rm coverage/*.so || die
+ fi
+}