1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{6,7} )
8 DISTUTILS_USE_SETUPTOOLS=rdepend
12 DESCRIPTION="Line-by-line profiler"
13 HOMEPAGE="https://github.com/pyutils/line_profiler"
14 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
20 BDEPEND="dev-python/cython[${PYTHON_USEDEP}]
21 dev-python/scikit-build[${PYTHON_USEDEP}]"
23 RDEPEND="dev-python/ipython[${PYTHON_USEDEP}]"
26 dev-python/coverage[${PYTHON_USEDEP}]
27 dev-python/ubelt[${PYTHON_USEDEP}] )"
29 distutils_enable_tests pytest
32 # tests fail if not already installed
33 # to fix this, source files should be in PYTHONPATH
34 # also, tests call kernprof, so we have to move that
35 # back to the source files and make it executable
36 cp "${BUILD_DIR}/lib/kernprof.py" "${WORKDIR}/${P}/kernprof" || die
37 chmod +x "${WORKDIR}/${P}/kernprof" || die
38 cp "${BUILD_DIR}/lib/${PN}" -r "${WORKDIR}/${P}" || die
39 PYTHONPATH="${WORKDIR}/${P}"
40 PATH="${PATH}:${WORKDIR}/${P}"
42 pytest -vv || die "Tests fail with ${EPYTHON}"