Stable for ppc, wrt bug #450174
[wtk-overlay.git] / webtest-2.0.3.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 EAPI=5
6
7 # sigh.
8 RESTRICT="test"
9
10 PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
11 PYTHON_TESTS_RESTRICTED_ABIS="3.*"
12
13 inherit distutils-r1
14
15 MY_PN="WebTest"
16 MY_P="${MY_PN}-${PV}"
17
18 DESCRIPTION="Helper to test WSGI applications"
19 HOMEPAGE="http://pythonpaste.org/webtest/ http://pypi.python.org/pypi/WebTest"
20 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.zip"
21
22 LICENSE="MIT"
23 SLOT="0"
24 KEYWORDS="~amd64 ~x86"
25 IUSE="doc test"
26
27 RDEPEND=">=dev-python/webob-0.9.2[${PYTHON_USEDEP}]"
28 DEPEND="${RDEPEND}
29         app-arch/unzip
30         dev-python/setuptools[${PYTHON_USEDEP}]
31         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
32         test? ( dev-python/nose[${PYTHON_USEDEP}]
33                 dev-python/pyquery[${PYTHON_USEDEP}]
34                 dev-python/waitress[${PYTHON_USEDEP}]
35                 dev-python/wsgiproxy2[${PYTHON_USEDEP}]
36                 dev-python/paste
37                 dev-python/pastedeploy )"
38
39 S="${WORKDIR}/${MY_P}"
40
41 python_compile_all() {
42         if use doc; then
43                 sphinx-build docs html || die
44         fi
45 }
46
47 python_test() {
48         nosetests || die "Tests fail with ${EPYTHON}"
49 }
50
51 python_install() {
52         distutils-r1_python_install
53
54         # Why is it so?
55         if [[ ${EPYTHON} == python3* ]]; then
56                 rm -f "${D}$(python_get_sitedir)"/webtest/lint3.py
57         fi
58 }
59
60 python_install_all() {
61         use doc && local HTML_DOCS=( html/. )
62         distutils-r1_python_install_all
63 }