*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pexpect / pexpect-4.2.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=( python2_7 python3_6 pypy3 )
7 PYTHON_REQ_USE="threads(+)"
8
9 inherit distutils-r1
10
11 DESCRIPTION="Python module for spawning child apps and responding to expected patterns"
12 HOMEPAGE="https://pexpect.readthedocs.io/ https://pypi.org/project/pexpect/ https://github.com/pexpect/pexpect/"
13 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
14
15 LICENSE="MIT"
16 SLOT="0"
17 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"
18 IUSE="doc examples test"
19 RESTRICT="!test? ( test )"
20
21 RDEPEND=">=dev-python/ptyprocess-0.5[${PYTHON_USEDEP}]"
22 DEPEND="
23         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
24         test? ( dev-python/pytest[${PYTHON_USEDEP}] )"
25
26 python_compile_all() {
27         use doc && emake -C doc html
28 }
29
30 python_test() {
31         py.test tests || die "Tests fail with ${EPYTHON}"
32 }
33
34 python_install_all() {
35         use doc && local HTML_DOCS=( doc/_build/html/. )
36         if use examples; then
37                 dodoc -r examples
38                 docompress -x /usr/share/doc/${PF}/examples
39         fi
40         distutils-r1_python_install_all
41 }