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