*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / entrypoints / entrypoints-0.2.3.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( pypy3 python{2_7,3_{6,7}} )
7
8 inherit distutils-r1
9
10 DESCRIPTION="Discover and load entry points from installed packages"
11 HOMEPAGE="https://github.com/takluyver/entrypoints"
12 SRC_URI="https://github.com//takluyver/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
13
14 LICENSE="BSD"
15 SLOT="0"
16 KEYWORDS="amd64 ~arm ~arm64 x86"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 DEPEND="
21         dev-python/setuptools[${PYTHON_USEDEP}]
22         $(python_gen_cond_dep '>=dev-python/configparser-3.5.0[${PYTHON_USEDEP}]' 'python2*')
23         test? (
24                 dev-python/pytest[${PYTHON_USEDEP}]
25                 virtual/python-pathlib[${PYTHON_USEDEP}]
26         )
27         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
28         "
29
30 PATCHES=(
31         "${FILESDIR}/${P}"-setup.py.patch
32         "${FILESDIR}/${PN}"-0.2.1-init.py.patch
33 )
34
35 python_prepare_all() {
36         # Prevent un-needed download during build
37         if use doc; then
38                 sed -e "/^    'sphinx.ext.intersphinx',/d" -i doc/conf.py || die
39         fi
40
41         distutils-r1_python_prepare_all
42
43         mv "${WORKDIR}/${P}"/entrypoints.py "${WORKDIR}/${P}/${PN}/" || die
44 }
45
46 python_compile_all() {
47         if use doc; then
48                 emake -C doc html
49                 HTML_DOCS=( doc/_build/html/. )
50         fi
51 }
52
53 python_test() {
54         distutils_install_for_testing
55         cd "${TEST_DIR}"/lib || die
56         cp -r "${S}"/tests "${TEST_DIR}"/lib/ || die
57         py.test || die
58 }