*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / radon / radon-1.4.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 PYTHON_COMPAT=( python2_7 python3_6 )
6
7 inherit distutils-r1
8
9 DESCRIPTION="Code Metrics in Python"
10 HOMEPAGE="https://radon.readthedocs.org/"
11 SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
12
13 LICENSE="MIT"
14 SLOT="0"
15 KEYWORDS="~amd64 ~x86"
16 IUSE="doc test"
17 RESTRICT="!test? ( test )"
18
19 CDEPEND="dev-python/setuptools[${PYTHON_USEDEP}]"
20 RCDEPEND="
21         >=dev-python/colorama-0.3[${PYTHON_USEDEP}]
22         <dev-python/colorama-0.4[${PYTHON_USEDEP}]
23         dev-python/flake8-polyfill[${PYTHON_USEDEP}]
24         >=dev-python/mando-0.3[${PYTHON_USEDEP}]
25         <dev-python/mando-0.4[${PYTHON_USEDEP}]
26 "
27 DEPEND="
28         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
29         ${CDEPEND}
30         test? (
31                 ${RCDEPEND}
32                 dev-python/nose[${PYTHON_USEDEP}]
33                 dev-python/mock[${PYTHON_USEDEP}]
34                 dev-python/paramunittest[${PYTHON_USEDEP}]
35         )
36 "
37 RDEPEND="
38         ${CDEPEND}
39         ${RCDEPEND}
40 "
41
42 python_compile_all() {
43         use doc && emake -C docs html
44 }
45
46 python_test() {
47         "${PYTHON}" radon/tests/run.py || die "tests failed to run under ${EPYTHON}"
48 }
49
50 python_install_all() {
51         use doc && local HTML_DOCS=( docs/_build/html/. )
52
53         distutils-r1_python_install_all
54 }