*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / py / py-1.5.4.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=( python2_7 python3_{6,7} pypy3 )
7
8 inherit distutils-r1
9
10 DESCRIPTION="library with cross-python path, ini-parsing, io, code, log facilities"
11 HOMEPAGE="https://pylib.readthedocs.io/en/latest/ https://pypi.org/project/py/"
12 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
13
14 LICENSE="MIT"
15 SLOT="0"
16 KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
17 IUSE="doc test"
18 RESTRICT="!test? ( test )"
19
20 RDEPEND=""
21 DEPEND="
22         dev-python/setuptools[${PYTHON_USEDEP}]
23         dev-python/setuptools_scm[${PYTHON_USEDEP}]
24         test? ( >=dev-python/pytest-2.4.2[${PYTHON_USEDEP}] )
25         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
26
27 PATCHES=( "${FILESDIR}"/${PN}-1.5.2-skip-apiwarn-pytest31.patch )
28
29 python_prepare_all() {
30         sed -e 's:intersphinx_mapping:#&:' -i doc/conf.py || die
31         distutils-r1_python_prepare_all
32 }
33
34 python_compile_all() {
35         use doc && emake -C doc html
36 }
37
38 python_test() {
39         # 1 failure, test_comments, under both pypy only.
40         # Also appears the home repo has no issue tracker.
41         [[ "${EPYTHON}" == pypy ]] && return
42         py.test -v -v || die "testing failed with ${EPYTHON}"
43 }
44
45 python_install_all() {
46         use doc && local HTML_DOCS=( doc/_build/html/. )
47         distutils-r1_python_install_all
48 }