diff options
| author | root <root@alpha.trunkmasters.com> | 2026-09-14 03:04:42 -0500 |
|---|---|---|
| committer | root <root@alpha.trunkmasters.com> | 2026-09-14 03:04:42 -0500 |
| commit | d09313d7f2546bde376a20ff739a5e90cb229e25 (patch) | |
| tree | a409e87d73f1fd8dc145a1210d1a44bb1b1982c7 /dev-python/coverage/coverage-7.16.1.ebuild | |
| parent | 98066fc1faacac449ddea472e456f23ad0e2a515 (diff) | |
| download | baldeagleos-repo-d09313d7f2546bde376a20ff739a5e90cb229e25.tar.gz baldeagleos-repo-d09313d7f2546bde376a20ff739a5e90cb229e25.tar.xz baldeagleos-repo-d09313d7f2546bde376a20ff739a5e90cb229e25.zip | |
Adding metadata
Diffstat (limited to 'dev-python/coverage/coverage-7.16.1.ebuild')
| -rw-r--r-- | dev-python/coverage/coverage-7.16.1.ebuild | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/dev-python/coverage/coverage-7.16.1.ebuild b/dev-python/coverage/coverage-7.16.1.ebuild new file mode 100644 index 000000000000..bb83b5e46e2e --- /dev/null +++ b/dev-python/coverage/coverage-7.16.1.ebuild @@ -0,0 +1,108 @@ +# 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_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}] + ) +" + +EPYTEST_PLUGINS=( hypothesis 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_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 Python 3.12 + test_tracer sysmon "${xdist_args[@]}" + + if [[ -n ${c_ext} ]]; then + rm coverage/*.so || die + fi +} |
