*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / webtest / webtest-2.0.29.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=( python{2_7,3_6} )
7
8 inherit distutils-r1
9
10 MY_PN="WebTest"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="Helper to test WSGI applications"
14 HOMEPAGE="https://pypi.org/project/WebTest/"
15 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 LICENSE="MIT"
18 SLOT="0"
19 KEYWORDS="alpha amd64 arm ~arm64 ~hppa ia64 ppc64 s390 ~sh sparc x86"
20 IUSE="doc test"
21 RESTRICT="!test? ( test )"
22
23 # nose<1.3.0 appears a leftover never updated in requires.txt. tests pass fine with latest
24 RDEPEND="
25         dev-python/six[${PYTHON_USEDEP}]
26         >=dev-python/webob-1.2[${PYTHON_USEDEP}]
27         >=dev-python/waitress-0.8.5[${PYTHON_USEDEP}]
28         dev-python/beautifulsoup:4[${PYTHON_USEDEP}]"
29 DEPEND="${RDEPEND}
30         app-arch/unzip
31         dev-python/setuptools[${PYTHON_USEDEP}]
32         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
33         test? ( dev-python/nose[${PYTHON_USEDEP}]
34                 dev-python/pyquery[${PYTHON_USEDEP}]
35                 dev-python/pastedeploy[${PYTHON_USEDEP}]
36                 dev-python/wsgiproxy2[${PYTHON_USEDEP}]
37                 dev-python/coverage[${PYTHON_USEDEP}]
38                 $(python_gen_cond_dep 'dev-python/mock[${PYTHON_USEDEP}]' python2_7 )
39         )"
40
41 S="${WORKDIR}/${MY_P}"
42
43 # Makes testing easier; otherwise we get errors from pkg_resources.
44 DISTUTILS_IN_SOURCE_BUILD=1
45
46 python_prepare_all() {
47         # Prevent un-needed d'loading during doc build
48         sed -s 's:intersphinx_mapping:_&:' -i docs/conf.py || die
49         distutils-r1_python_prepare_all
50 }
51
52 python_compile_all() {
53         if use doc; then
54                 sphinx-build docs html || die
55         fi
56 }
57
58 python_test() {
59         # Tests raise ImportErrors with our default PYTHONPATH.
60         local -x PYTHONPATH=
61         nosetests || die "Tests fail with ${EPYTHON}"
62 }
63
64 python_install_all() {
65         use doc && local HTML_DOCS=( html/. )
66         distutils-r1_python_install_all
67 }