1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 # We could depend on dev-python/cherrypy when USE=server, but
5 # that is an optional component ...
6 # Same for www-servers/tornado and USE=client ... so why not???
7 # pypy is viable but better with a cutdown set of deps
10 PYTHON_COMPAT=( python{2_7,3_5} )
11 PYTHON_REQ_USE="threads?"
14 if [[ ${PV} == *9999* ]] ; then
15 EGIT_REPO_URI="https://github.com/Lawouach/WebSocket-for-Python.git"
19 SRC_URI="https://github.com/Lawouach/WebSocket-for-Python/archive/v${PV} -> ${P}.tar.gz"
20 KEYWORDS="amd64 arm x86"
23 DESCRIPTION="WebSocket client and server library for Python 2 and 3 as well as PyPy"
24 HOMEPAGE="https://github.com/Lawouach/WebSocket-for-Python"
28 IUSE="+client +server test +threads"
29 RESTRICT="!test? ( test )"
30 # doc build requires sphinxcontrib ext packages absent from portage
32 RDEPEND=">=dev-python/greenlet-0.4.1[${PYTHON_USEDEP}]
33 $(python_gen_cond_dep 'dev-python/gevent[${PYTHON_USEDEP}]' python2_7)
34 >=dev-python/cython-0.19.1[${PYTHON_USEDEP}]
35 client? ( >=www-servers/tornado-3.1[${PYTHON_USEDEP}] )
36 server? ( >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] )"
38 >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}]
39 dev-python/unittest2[${PYTHON_USEDEP}]
40 >=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
44 # testsuite displays an issue with mock under py3 but is non fatal
45 "${PYTHON}" -m unittest discover || die "Tests failed under ${EPYTHON}"
49 distutils-r1_python_install
50 use client || rm -rf "${D}$(python_get_sitedir)"/ws4py/client
51 use server || rm -rf "${D}$(python_get_sitedir)"/ws4py/server