*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / jaraco-packaging / jaraco-packaging-4.1.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
8 inherit distutils-r1
9
10 MY_PN="${PN/-/.}"
11 DESCRIPTION="Tools to supplement packaging Python releases"
12 HOMEPAGE="https://github.com/jaraco/jaraco.packaging"
13 SRC_URI="mirror://pypi/${PN:0:1}/${MY_PN}/${MY_PN}-${PV}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 sparc x86"
18 IUSE="doc test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND=">=dev-python/six-1.4[${PYTHON_USEDEP}]"
22 DEPEND="dev-python/setuptools[${PYTHON_USEDEP}]
23         >=dev-python/setuptools_scm-1.9[${PYTHON_USEDEP}]
24         doc? (
25                 dev-python/rst-linker[${PYTHON_USEDEP}]
26                 dev-python/sphinx[${PYTHON_USEDEP}]
27         )
28         test? (
29                 ${RDEPEND}
30                 >=dev-python/pytest-2.8[${PYTHON_USEDEP}]
31                 dev-python/pytest-runner[${PYTHON_USEDEP}]
32         )
33 "
34
35 S="${WORKDIR}/${MY_PN}-${PV}"
36
37 python_compile_all() {
38         if use doc; then
39                 cd docs || die
40                 sphinx-build . _build/html || die
41                 HTML_DOCS=( docs/_build/html/. )
42         fi
43 }
44
45 python_test() {
46         # Skip one test which requires network access
47         PYTHONPATH=. py.test -v -k "not test_revived_distribution" \
48                 || die "tests failed with ${EPYTHON}"
49 }