webtest-*.ebuild: Install lint3 for Python 3
[wtk-overlay.git] / webtest-1.3.3-r1.ebuild
1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header$
4
5 #Needed by sys-cluster/keystone[test]
6
7 EAPI="5"
8 PYTHON_COMPAT=( python2_6 python2_7 )
9 #restricted for failing test :(
10 RESTRICT="test"
11
12 inherit distutils-r1 eutils
13
14 MY_PN="WebTest"
15 MY_P="${MY_PN}-${PV}"
16
17 DESCRIPTION="Helper to test WSGI applications"
18 HOMEPAGE="http://pythonpaste.org/webtest/ http://pypi.python.org/pypi/WebTest"
19 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
20
21 LICENSE="MIT"
22 SLOT="0"
23 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~x86-fbsd"
24 IUSE="doc test"
25
26 RDEPEND=">=dev-python/webob-0.9.2[${PYTHON_USEDEP}]"
27 DEPEND="${RDEPEND}
28         dev-python/setuptools[${PYTHON_USEDEP}]
29         dev-python/lxml[${PYTHON_USEDEP}]
30         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
31         test? ( dev-python/pyquery[${PYTHON_USEDEP}]
32                         dev-python/nose[${PYTHON_USEDEP}] )"
33
34 S="${WORKDIR}/${MY_P}"
35
36 python_prepare() {
37         epatch "${FILESDIR}/${PN}-1.3.4-index_fixt.patch"
38         distutils-r1_python_prepare
39 }
40
41 python_compile() {
42         distutils-r1_python_compile
43
44         if use doc; then
45                 einfo "Generation of documentation"
46                 sphinx-build docs html || die "Building of documentation failed"
47         fi
48 }
49
50 python_test() {
51         "${PYTHON}" setup.py nosetests || die
52 }
53
54 python_install() {
55         distutils-r1_python_install_all
56
57         if use doc; then
58                 dohtml -r html/*
59         fi
60 }