1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{5,6} )
10 MY_PN="wsgi_intercept"
13 DESCRIPTION="WSGI application in place of a real URI for testing"
14 HOMEPAGE="https://github.com/cdent/python3-wsgi-intercept"
15 SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
19 KEYWORDS="amd64 ~arm64 x86 ~amd64-linux ~x86-linux"
21 RESTRICT="!test? ( test )"
24 dev-python/setuptools[${PYTHON_USEDEP}]
25 dev-python/six[${PYTHON_USEDEP}]
27 dev-python/httplib2[${PYTHON_USEDEP}]
28 >=dev-python/pytest-2.4[${PYTHON_USEDEP}]
29 >=dev-python/requests-2.0.1[${PYTHON_USEDEP}]
30 >=dev-python/urllib3-1.11.0[${PYTHON_USEDEP}]
31 $(python_gen_cond_dep 'dev-python/mechanize[${PYTHON_USEDEP}]' python2_7 pypy)
33 S="${WORKDIR}/${MY_P}"
35 python_prepare_all() {
36 # .pyc files cause failure of tests
37 rm -rf test/__pycache__/ || die
39 # Req'd to avoid file collisions
40 sed -e s":find_packages():find_packages(exclude=['test']):" \
43 # Disable tests connecting to the network; Bug #550710
44 sed -e 's:test_http_not_intercepted:_&:' \
45 -e 's:test_https_not_intercepted:_&:' \
46 -i test/{test_urllib.py,test_http_client.py,test_requests.py} || die
47 distutils-r1_python_prepare_all
50 python_compile_all() {
51 use doc && emake -C docs html
55 py.test || die "Tests failed under ${EPYTHON}"
58 python_install_all() {
59 use doc && local HTML_DOCS=( docs/_build/html//. )
60 distutils-r1_python_install_all