*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / diff-cover / diff-cover-2.3.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Automatically find diff lines that need test coverage"
11 HOMEPAGE="https://github.com/Bachmann1234/diff-cover"
12 SRC_URI="https://github.com/Bachmann1234/diff-cover/archive/v${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="Apache-2.0"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17 IUSE="test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
21         >=dev-python/jinja-2.7.1[${PYTHON_USEDEP}]
22         dev-python/jinja2_pluralize[${PYTHON_USEDEP}]
23         dev-python/pygments[${PYTHON_USEDEP}]
24         dev-python/six[${PYTHON_USEDEP}]"
25 DEPEND="${RDEPEND}
26         test? (
27                 dev-python/coverage[${PYTHON_USEDEP}]
28                 dev-python/flake8[${PYTHON_USEDEP}]
29                 dev-python/mock[${PYTHON_USEDEP}]
30                 dev-python/nose[${PYTHON_USEDEP}]
31                 >=dev-python/pycodestyle-2.4.0[${PYTHON_USEDEP}]
32                 dev-python/pyflakes[${PYTHON_USEDEP}]
33         )"
34
35 MY_PN=${PN/-/_}
36 S=${WORKDIR}/${MY_PN}-${PV}
37
38 python_prepare_all() {
39         # TypeError: test_parse_range_notation() takes exactly 2 arguments (1 given)
40         sed -e 's|test_parse_range_notation|_\0|' \
41                 -i "${MY_PN}/tests/test_diff_cover_main.py" || die
42
43         distutils-r1_python_prepare_all
44 }
45
46 python_test() {
47         esetup.py test || die "tests failed with ${EPYTHON}"
48 }