dev-python/gevent: version bump to 1.2.2
[gentoo.git] / dev-python / gevent / gevent-1.2.2.ebuild
1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 # http://www.gevent.org/whatsnew_1_1.html#broader-platform-support
7 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
8 PYTHON_REQ_USE="ssl(+),threads(+)"
9
10 inherit distutils-r1 flag-o-matic
11
12 MY_PV=${PV/_beta/b}
13 MY_P=${PN}-${MY_PV}
14
15 DESCRIPTION="Coroutine-based network library"
16 HOMEPAGE="http://gevent.org/ https://pypi.python.org/pypi/gevent/"
17 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${MY_P}.tar.gz"
18
19 LICENSE="MIT"
20 SLOT="0"
21 KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
22 IUSE="doc examples"
23
24 RDEPEND="
25         >=dev-libs/libev-4.23
26         >=net-dns/c-ares-1.12
27         >=dev-python/greenlet-0.4.10
28         virtual/python-greenlet[${PYTHON_USEDEP}]"
29 DEPEND="${RDEPEND}
30         dev-python/setuptools[${PYTHON_USEDEP}]
31         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )"
32
33 # Tests take long and fail terribly a few times.
34 # It also seems that they require network access.
35 RESTRICT="test"
36
37 S=${WORKDIR}/${MY_P}
38
39 python_prepare_all() {
40         export LIBEV_EMBED="false"
41         export CARES_EMBED="false"
42         export EMBED="false"
43
44         distutils-r1_python_prepare_all
45 }
46
47 python_configure_all() {
48         append-flags -fno-strict-aliasing
49 }
50
51 python_compile_all() {
52         use doc && emake -C doc html
53 }
54
55 python_test() {
56         cd src/greentest || die
57
58         GEVENT_RESOLVER=thread \
59                 "${PYTHON}" testrunner.py --config known_failures.py || die
60         GEVENT_RESOLVER=ares GEVENTARES_SERVERS=8.8.8.8 \
61                 "${PYTHON}" testrunner.py --config known_failures.py \
62                 --ignore tests_that_dont_use_resolver.txt || die
63         GEVENT_FILE=thread \
64                 "${PYTHON}" testrunner.py --config known_failures.py $(grep -l subprocess test_*.py) || die
65 }
66
67 python_install_all() {
68         local DOCS=( AUTHORS README.rst )
69         use doc && local HTML_DOCS=( doc/_build/html/. )
70         use examples && dodoc -r examples
71
72         distutils-r1_python_install_all
73 }