aboutsummaryrefslogtreecommitdiff
blob: 34d2f5b6df529f36c8a1154c4d2f39170d7f0590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{9..10} )
DISTUTILS_USE_PEP517=setuptools
inherit distutils-r1 multiprocessing

DESCRIPTION="Hunter is a flexible code tracing toolkit"
HOMEPAGE="
	https://github.com/ionelmc/python-hunter
	https://pypi.org/project/hunter/
"
SRC_URI="https://github.com/ionelmc/python-${PN}/archive/v${PV}.tar.gz -> ${P}.gh.tar.gz"
S="${WORKDIR}/python-${P}"
TEST_S="${S}_test"

LICENSE="BSD-2"
SLOT="0"
KEYWORDS="~amd64"

BDEPEND="
	dev-python/cython[${PYTHON_USEDEP}]
	>=dev-python/setuptools-scm-3.3.1[${PYTHON_USEDEP}]
	test? (
		dev-python/aspectlib[${PYTHON_USEDEP}]
		dev-python/ipdb[${PYTHON_USEDEP}]
		dev-python/manhole[${PYTHON_USEDEP}]
		dev-python/process-tests[${PYTHON_USEDEP}]
		dev-python/pytest-benchmark[${PYTHON_USEDEP}]
		dev-python/six[${PYTHON_USEDEP}]
		sys-devel/gdb
	)
"

DOCS=( AUTHORS.rst CHANGELOG.rst README.rst )

EPYTEST_DESELECT=(
	# broken
	tests/test_tracer.py::test_source_cython
	tests/test_tracer.py::test_fullsource_cython

	# too unstable
	tests/test_remote.py
)

distutils_enable_tests pytest

distutils_enable_sphinx docs \
	">=dev-python/sphinx-py3doc-enhanced-theme-2.3.2"

src_unpack() {
	default

	cp -a "${S}" "${TEST_S}" || die
	mv -f "${TEST_S}"/tests/setup.py "${TEST_S}"/setup.py || die
}

src_prepare() {
	default

	find . -name '*.c' -delete || die "removing csources failed"
}

python_compile() {
	distutils-r1_python_compile

	if use test; then
		einfo "  Building tests"
		cd "${TEST_S}" || die
		esetup.py build_ext -j $(makeopts_jobs) --inplace
	fi
}

python_test() {
	cd "${TEST_S}"/tests || die
	epytest
}