1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 python3_6 )
10 DESCRIPTION="Highly concurrent networking library"
11 HOMEPAGE="https://pypi.org/project/eventlet/ https://github.com/eventlet/eventlet/"
12 SRC_URI="mirror://pypi/e/${PN}/${P}.tar.gz"
16 KEYWORDS="~amd64 ~arm64 ~x86"
17 IUSE="doc examples test"
18 RESTRICT="!test? ( test )"
21 >=dev-python/dnspython-1.15.0[${PYTHON_USEDEP}]
22 virtual/python-enum34[${PYTHON_USEDEP}]
23 >=dev-python/greenlet-0.3[${PYTHON_USEDEP}]
24 >=dev-python/monotonic-1.4[${PYTHON_USEDEP}]
25 >=dev-python/six-1.10.0[${PYTHON_USEDEP}]"
26 DEPEND="doc? ( dev-python/sphinx[${PYTHON_USEDEP}]
27 >=dev-python/python-docs-2.7.6-r1:2.7 )
29 dev-python/pyopenssl[${PYTHON_USEDEP}]
30 dev-python/nose[${PYTHON_USEDEP}] )"
32 python_prepare_all() {
33 # provided by virtual/python-enum34
34 sed -i '/enum-compat/d' setup.py || die
37 local PYTHON_DOC_ATOM=$(best_version -b dev-python/python-docs:2.7)
38 local PYTHON_DOC_VERSION="${PYTHON_DOC_ATOM#dev-python/python-docs-}"
39 local PYTHON_DOC="/usr/share/doc/python-docs-${PYTHON_DOC_VERSION}/html"
40 local PYTHON_DOC_INVENTORY="${PYTHON_DOC}/objects.inv"
41 sed -i "s|'http://docs.python.org/': None|'${PYTHON_DOC}': '${PYTHON_DOC_INVENTORY}'|" doc/conf.py || die
45 # sed -i '/This is a Python 3 module/d' eventlet/green/http/__init__.py || die
46 # sed -i 's/^import/from OpenSSL import/g' eventlet/green/OpenSSL/__init__.py || die
47 # sed -i 's/^from version/from OpenSSL.version/' eventlet/green/OpenSSL/__init__.py || die
48 sed -i 's/TEST_TIMEOUT = 1/TEST_TIMEOUT = 10/' tests/__init__.py || die
51 # Prevent file collisions from teestsuite
52 sed -e "s:'tests', :'tests', 'tests.*', :" -i setup.py || die
54 distutils-r1_python_prepare_all
57 python_compile_all() {
58 # https://github.com/eventlet/eventlet/issues/152
59 use doc && emake -C doc html
63 # Several errors 1 failure
64 # https://github.com/eventlet/eventlet/issues/151
65 nosetests tests || die "Tests fail with ${EPYTHON}"
68 python_install_all() {
69 use doc && local HTML_DOCS=( doc/_build/html/. )
71 docompress -x "/usr/share/doc/${PF}/examples"
75 distutils-r1_python_install_all