summaryrefslogtreecommitdiff
path: root/dev-python/ws4py
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2018-03-10 19:15:28 +0000
committerV3n3RiX <venerix@redcorelinux.org>2018-03-10 19:15:28 +0000
commitda6a52f691ef980bab92d003d5df8f463c623af8 (patch)
tree4d89e0d5915f8a3f57c8f9c17420ba3f7b44b7b2 /dev-python/ws4py
parent80208fb578cf92cc308906660ca6d7860c6b2a1f (diff)
gentoo resync : 10.03.2018
Diffstat (limited to 'dev-python/ws4py')
-rw-r--r--dev-python/ws4py/Manifest2
-rw-r--r--dev-python/ws4py/files/ws4py-0.3.4-tests.patch67
-rw-r--r--dev-python/ws4py/ws4py-0.3.4-r1.ebuild55
3 files changed, 124 insertions, 0 deletions
diff --git a/dev-python/ws4py/Manifest b/dev-python/ws4py/Manifest
index 6446faef6814..814091fb570b 100644
--- a/dev-python/ws4py/Manifest
+++ b/dev-python/ws4py/Manifest
@@ -1,5 +1,7 @@
+AUX ws4py-0.3.4-tests.patch 2439 BLAKE2B 0d0a185104b073ceed3c745f46b67df5916b001f5e67be50000ef1c68f923f2375be248f4961739180d4992db6fdf11d2ba3558a4725cd4f3d330303fc9c01a1 SHA512 fb8cf920ac48aface7e50576c1038db47133c6a44e7d4ef1b965d6efc4374d22392e44bfdca64bd61696a5c6ed884ef6b1e410e515ed6e1856c7f3c4862d19ff
DIST ws4py-0.3.4.tar.gz 65467 BLAKE2B c51e338f3c65e100b55e83cd7b09fb8e4eafec3adc118a2744ea4aabc54c91efacda94cb3018550049d617b6759198cfbdb4497a024c597de942abe9e5517ab6 SHA512 32cd2eb9df7367e2bf42e354766a0ca407715a863be6b51b7701ec6e0537a2ecf7c2a59423f56ae093855b075c30a4065c7f7efe3b0227915639223b9ba7a55f
DIST ws4py-0.5.1.tar.gz 116673 BLAKE2B 31db304800f0d3da61dc4c1a3381a8fcfcfa8f16b36d916311cc32f1d294c9f7b3627dac673edf824f529f485f825ca418ab1e1a8a2fda5583c6a6a1bd9b752c SHA512 4c90d66d37fb5bdc8f7fc9fd184b20a7dc2dae811ecf3a041477e3c26a2577008be7041799daca5b8c0de65cb2454022a6c135cf02534ca98b6946abbfce0e11
+EBUILD ws4py-0.3.4-r1.ebuild 1786 BLAKE2B 80ba523bfb22ce3bc466ca231da610d15b5139f01f7165ada06006cdaf75123000eae716ac3aae6ccf8e14fe12a20fcbdec19fff82ebe59da7a3a5a19345d569 SHA512 7d3d17f5391d811570916d6cfe15c22a4b1035757df68c6b16175e2f4744fb4eeecfbcffe93e39b31181d55520d177c3350cc793ee6624f3a15f3924a26f94ed
EBUILD ws4py-0.3.4.ebuild 1744 BLAKE2B 60b5ecfa1ae1f3732be19b927ea594e4b2c1ffd9a0980365b684ca578f40276f4c5432606b43c9bf2ff841d73d52057fbf600833fcb528c5b3c6639c3129a6dc SHA512 c286aac539f135c63001503cdb1ede1cdb5c589a5871025ff1b445c257fc68859bac8022c13b4bf4b9b43940fabe6786e285f521ea646f5eb10b8f0edc8671e9
EBUILD ws4py-0.5.1.ebuild 1757 BLAKE2B 91537d7c377c77209c934fc1bd2cebe54fe8ae6053c2831cfe243fa306ec5a236b9f2ac9fc298ec1dddca03f347ffa327f47e968f90cfe9341bf3ea6662c5905 SHA512 8fb67724223be45dc4da1f9d3e03dfd151029cefa0efd05dfed89bf6ad9808f00bfa458c0abe5fa0c670b97ba318ea753818f7974518a865b09c949c12776c00
EBUILD ws4py-9999.ebuild 1758 BLAKE2B 47a6b79fe9acbb8b336165f0080806dcf5929596fd95daad03211a398ad34c648e4935dda3a54b11b3fbc9ea33947187a6a279eba3cf8c86a7478b5eff7cee39 SHA512 db3f7a232a93c30bc77bbf1c3840f228ecbe1539499c271c8a4a3ff26b75bf75c3426e07a9292466594b01bceb3df1580367a74ecfae8f00912a77617ab16efd
diff --git a/dev-python/ws4py/files/ws4py-0.3.4-tests.patch b/dev-python/ws4py/files/ws4py-0.3.4-tests.patch
new file mode 100644
index 000000000000..dde60f2ed04d
--- /dev/null
+++ b/dev-python/ws4py/files/ws4py-0.3.4-tests.patch
@@ -0,0 +1,67 @@
+From 185c88cb6779b3b15a5c14047bb62b8fcb8d2e57 Mon Sep 17 00:00:00 2001
+From: Sebastian Pipping <sebastian@pipping.org>
+Date: Sat, 10 Mar 2018 00:33:37 +0100
+Subject: [PATCH] Fix AttributeErrors from mistaken Mock.assert_call_once_with
+
+This commit is a backport/subset of:
+https://github.com/Lawouach/WebSocket-for-Python/commit/b5d47f7b3497f1b713a20fe6306b7d9afdd8c408
+---
+ test/test_manager.py | 12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+diff --git a/test/test_manager.py b/test/test_manager.py
+index 8c229b0..aacc162 100644
+--- a/test/test_manager.py
++++ b/test/test_manager.py
+@@ -16,10 +16,10 @@ class WSManagerTest(unittest.TestCase):
+ ws.sock.fileno.return_value = 1
+
+ m.add(ws)
+- m.poller.register.assert_call_once_with(ws)
++ m.poller.register.assert_called_once_with(1)
+
+ m.remove(ws)
+- m.poller.unregister.assert_call_once_with(ws)
++ m.poller.unregister.assert_called_once_with(1)
+
+ @patch('ws4py.manager.SelectPoller')
+ def test_cannot_add_websocket_more_than_once(self, MockSelectPoller):
+@@ -49,7 +49,7 @@ class WSManagerTest(unittest.TestCase):
+ self.assertEqual(len(m), 1)
+ m.remove(ws)
+ self.assertEqual(len(m), 0)
+- m.poller.unregister.assert_call_once_with(ws)
++ m.poller.unregister.assert_called_once_with(1)
+ m.poller.reset_mock()
+
+ m.remove(ws)
+@@ -98,7 +98,7 @@ class WSManagerTest(unittest.TestCase):
+ m.add(ws)
+ m.start()
+
+- ws.terminate.assert_call_once_with()
++ ws.terminate.assert_called_once_with()
+
+ m.stop()
+
+@@ -109,7 +109,7 @@ class WSManagerTest(unittest.TestCase):
+ ws = MagicMock()
+ m.add(ws)
+ m.close_all()
+- ws.terminate.assert_call_once_with(1001, 'Server is shutting down')
++ ws.close.assert_called_once_with(code=1001, reason='Server is shutting down')
+
+ @patch('ws4py.manager.SelectPoller')
+ def test_broadcast(self, MockSelectPoller):
+@@ -120,7 +120,7 @@ class WSManagerTest(unittest.TestCase):
+ m.add(ws)
+
+ m.broadcast(b'hello there')
+- ws.send.assert_call_once_with(b'hello there')
++ ws.send.assert_called_once_with(b'hello there', False)
+
+ @patch('ws4py.manager.SelectPoller')
+ def test_broadcast_failure_must_not_break_caller(self, MockSelectPoller):
+--
+2.16.2
+
diff --git a/dev-python/ws4py/ws4py-0.3.4-r1.ebuild b/dev-python/ws4py/ws4py-0.3.4-r1.ebuild
new file mode 100644
index 000000000000..6ab67dfda7d9
--- /dev/null
+++ b/dev-python/ws4py/ws4py-0.3.4-r1.ebuild
@@ -0,0 +1,55 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+# We could depend on dev-python/cherrypy when USE=server, but
+# that is an optional component ...
+# Same for www-servers/tornado and USE=client ... so why not???
+# pypy is viable but better with a cutdown set of deps
+
+EAPI="5"
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} )
+PYTHON_REQ_USE="threads?"
+
+inherit distutils-r1
+if [[ ${PV} == "9999" ]] ; then
+ EGIT_REPO_URI="https://github.com/Lawouach/WebSocket-for-Python.git"
+ inherit git-2
+else
+ inherit vcs-snapshot
+ SRC_URI="https://github.com/Lawouach/WebSocket-for-Python/tarball/v${PV} -> ${P}.tar.gz"
+ KEYWORDS="~amd64 ~arm ~x86"
+fi
+
+DESCRIPTION="WebSocket client and server library for Python 2 and 3 as well as PyPy"
+HOMEPAGE="https://github.com/Lawouach/WebSocket-for-Python"
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="+client +server test +threads"
+# doc build requires sphinxcontrib ext packages absent from portage
+
+RDEPEND=">=dev-python/greenlet-0.4.1[${PYTHON_USEDEP}]
+ $(python_gen_cond_dep 'dev-python/gevent[${PYTHON_USEDEP}]' python2_7)
+ >=dev-python/cython-0.19.1[${PYTHON_USEDEP}]
+ client? ( >=www-servers/tornado-3.1[${PYTHON_USEDEP}] )
+ server? ( <dev-python/cherrypy-9[${PYTHON_USEDEP}] )"
+DEPEND="test? (
+ <dev-python/cherrypy-9[${PYTHON_USEDEP}]
+ dev-python/unittest2[${PYTHON_USEDEP}]
+ >=dev-python/mock-1.0.1[${PYTHON_USEDEP}]
+ )"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-tests.patch
+)
+
+python_test() {
+ # testsuite displays an issue with mock under py3 but is non fatal
+ "${PYTHON}" -m unittest discover || die "Tests failed under ${EPYTHON}"
+}
+
+python_install() {
+ distutils-r1_python_install
+ use client || rm -rf "${D}$(python_get_sitedir)"/ws4py/client
+ use server || rm -rf "${D}$(python_get_sitedir)"/ws4py/server
+}