From deba8115d2c2af26df42966b91ef04ff4dd79cde Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Thu, 14 May 2020 11:09:11 +0100 Subject: gentoo resync : 14.05.2020 --- dev-python/ws4py/Manifest | 4 +- .../ws4py-0.5.1-python3.7+-compatibility.patch | 93 ++++++++++++++++++++++ dev-python/ws4py/ws4py-0.5.1-r1.ebuild | 53 ++++++++++++ dev-python/ws4py/ws4py-9999.ebuild | 16 ++-- 4 files changed, 158 insertions(+), 8 deletions(-) create mode 100644 dev-python/ws4py/files/ws4py-0.5.1-python3.7+-compatibility.patch create mode 100644 dev-python/ws4py/ws4py-0.5.1-r1.ebuild (limited to 'dev-python/ws4py') diff --git a/dev-python/ws4py/Manifest b/dev-python/ws4py/Manifest index d87b43cebcf4..3013943dcc65 100644 --- a/dev-python/ws4py/Manifest +++ b/dev-python/ws4py/Manifest @@ -1,7 +1,9 @@ AUX ws4py-0.3.4-tests.patch 2439 BLAKE2B 0d0a185104b073ceed3c745f46b67df5916b001f5e67be50000ef1c68f923f2375be248f4961739180d4992db6fdf11d2ba3558a4725cd4f3d330303fc9c01a1 SHA512 fb8cf920ac48aface7e50576c1038db47133c6a44e7d4ef1b965d6efc4374d22392e44bfdca64bd61696a5c6ed884ef6b1e410e515ed6e1856c7f3c4862d19ff +AUX ws4py-0.5.1-python3.7+-compatibility.patch 3713 BLAKE2B f5c811b6dce12637307d2a845daa0e9e932452ba34416b088531734013f1617901617d82804b32ec22026d50c27152b68fb548b0871a11ac20ffa21fc5b435b0 SHA512 3012d74e348f7965fee811c9b0e290dcefcc4f365159ecc0fc5bc9dc77ff0e5e6d1448b62b0ced1f9e87dc2bf29f9a831d110301257d260dcb3f2d1ee7ed4f80 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 1726 BLAKE2B beffbc7b4a6cbd1487769c4b4d55ae70f748fbd6eaf9d621abc8dbf2b92e927e9173fa3c7d982dde6cbdef4b24044fd883fadb496229dc43e28106b401fed7ae SHA512 00774d6709968c5896de6fff395fc3547d34f0cbf81a2db82201853e73609269ddf1d6fdc6ec08ab568828934521cf990aa8db21bf8490dc6e0f6c7278be9c87 +EBUILD ws4py-0.5.1-r1.ebuild 1748 BLAKE2B b8c14923f8eeadf487ed27f85e719feb07fdba0c3636caebd4beef8a6dfa9d133abfa24a85f0917a08f727d9d7d01da89f98659a00c598fa5a5c1760a16c2a75 SHA512 347f4f275155716dbb9b0ff259845a4e4148981e0a961cb5de383774ef9b8627c87a13713412fc35740d47b269d5b659d6c77af8f0b1cf76a9e5908f0891807a EBUILD ws4py-0.5.1.ebuild 1690 BLAKE2B 44cbb9758f359bc8b5a549d312f9b77f95011852447778d7dd507b981965e476da6b852550524cee7d0cc640b268a51792fe5f2f1aafa9f3c4c8d467378f68d5 SHA512 98f64075746263eecbbcb0a1bd1690166f927a521cd6aa82128a928de3b6f597516b8878808793c2896ce7c65c2e9558b8ef854e5d18d9adf2ce2eef2809c118 -EBUILD ws4py-9999.ebuild 1693 BLAKE2B dd15979798a374e78162bb71a251030b5b81c034e7ef06a2c17d0baf552cf11fe669dfb83142e8ff0881c07e053412b81f58c3a0530f73dfa5f33e15b0aa694c SHA512 b6cca2a99414019a40bfece659705e58789e70e7b6b3b9e762ae20f1af1a79c607a432d707d4704637e0ad7a5df2affe27edbc2d22f0dd7e1dba68bc3a06d12c +EBUILD ws4py-9999.ebuild 1748 BLAKE2B b8c14923f8eeadf487ed27f85e719feb07fdba0c3636caebd4beef8a6dfa9d133abfa24a85f0917a08f727d9d7d01da89f98659a00c598fa5a5c1760a16c2a75 SHA512 347f4f275155716dbb9b0ff259845a4e4148981e0a961cb5de383774ef9b8627c87a13713412fc35740d47b269d5b659d6c77af8f0b1cf76a9e5908f0891807a MISC metadata.xml 480 BLAKE2B 464f4b1e941659251ece44c65b341bac398a73a13624f58a36113359866557789b255a4e45a23ff9305be2e7bcbd3ae9e30b11d0ab72a1496544b1e559e07a17 SHA512 f3785b920223b276874e389c7db00b20117aaa3e003ed03593490fda2bfcc4df20034a91a3e98c58ec30f52ad50bc81d91e2ea388e87e56bb91863edbdb6d231 diff --git a/dev-python/ws4py/files/ws4py-0.5.1-python3.7+-compatibility.patch b/dev-python/ws4py/files/ws4py-0.5.1-python3.7+-compatibility.patch new file mode 100644 index 000000000000..12b14111634a --- /dev/null +++ b/dev-python/ws4py/files/ws4py-0.5.1-python3.7+-compatibility.patch @@ -0,0 +1,93 @@ +From: Matthias Klose +Date: Sun, 29 Jul 2018 09:01:36 +0200 +Subject: Fix compatibility with Python 3.7. +Origin: http://launchpadlibrarian.net/380629852/python-ws4py_0.4.2+dfsg1-2_0.4.2+dfsg1-2ubuntu1.diff.gz +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=903529 + +--- + test/autobahn_test_servers.py | 4 ++-- + ws4py/async_websocket.py | 9 +++++++-- + ws4py/server/tulipserver.py | 7 ++++++- + 3 files changed, 15 insertions(+), 5 deletions(-) + +diff --git a/test/autobahn_test_servers.py b/test/autobahn_test_servers.py +index 3e33f82..8b77954 100644 +--- a/test/autobahn_test_servers.py ++++ b/test/autobahn_test_servers.py +@@ -142,7 +142,7 @@ def run_python_wsgi(host="127.0.0.1", port=9002): + """ + run_python_wsgi_async(host, port, False) + +-def run_python_wsgi_async(host="127.0.0.1", port=9010, async=True): ++def run_python_wsgi_async(host="127.0.0.1", port=9010, async_=True): + """ + Runs wsgi server on python 2.x with async middleware" + """ +@@ -153,7 +153,7 @@ def run_python_wsgi_async(host="127.0.0.1", port=9010, async=True): + from ws4py.server.wsgiutils import WebSocketWSGIApplication + + app = WebSocketWSGIApplication(handler_cls=EchoWebSocket) +- if async: ++ if async_: + def middleware(app): + def later(environ, start_response): + for part in app(environ, start_response): +diff --git a/ws4py/async_websocket.py b/ws4py/async_websocket.py +index 9e2a4c7..096763d 100644 +--- a/ws4py/async_websocket.py ++++ b/ws4py/async_websocket.py +@@ -18,6 +18,11 @@ delegated_generator_websocket_on_top_of_asyncio.py + import asyncio + import types + ++try: # pragma: no cover ++ asyncio_ensure_future = asyncio.ensure_future # Python >= 3.5 ++except AttributeError: # pragma: no cover ++ asyncio_ensure_future = getattr(asyncio, 'async') # Python < 3.5 ++ + from ws4py.websocket import WebSocket as _WebSocket + from ws4py.messaging import Message + +@@ -84,7 +89,7 @@ class WebSocket(_WebSocket): + def closeit(): + yield from self.proto.writer.drain() + self.proto.writer.close() +- asyncio.async(closeit()) ++ asyncio.asyncio_ensure_future(closeit()) + + def _write(self, data): + """ +@@ -94,7 +99,7 @@ class WebSocket(_WebSocket): + def sendit(data): + self.proto.writer.write(data) + yield from self.proto.writer.drain() +- asyncio.async(sendit(data)) ++ asyncio.asyncio_ensure_future(sendit(data)) + + @asyncio.coroutine + def run(self): +diff --git a/ws4py/server/tulipserver.py b/ws4py/server/tulipserver.py +index 2786c16..ce2e9fb 100644 +--- a/ws4py/server/tulipserver.py ++++ b/ws4py/server/tulipserver.py +@@ -6,6 +6,11 @@ import io + + import asyncio + ++try: # pragma: no cover ++ asyncio_ensure_future = asyncio.ensure_future # Python >= 3.5 ++except AttributeError: # pragma: no cover ++ asyncio_ensure_future = getattr(asyncio, 'async') # Python < 3.5 ++ + from ws4py import WS_KEY, WS_VERSION + from ws4py.exc import HandshakeError + from ws4py.websocket import WebSocket +@@ -40,7 +45,7 @@ class WebSocketProtocol(asyncio.StreamReaderProtocol): + #self.stream.set_transport(transport) + asyncio.StreamReaderProtocol.connection_made(self, transport) + # Let make it concurrent for others to tag along +- f = asyncio.async(self.handle_initial_handshake()) ++ f = asyncio.asyncio_ensure_future(self.handle_initial_handshake()) + f.add_done_callback(self.terminated) + + @property diff --git a/dev-python/ws4py/ws4py-0.5.1-r1.ebuild b/dev-python/ws4py/ws4py-0.5.1-r1.ebuild new file mode 100644 index 000000000000..21de5cde42da --- /dev/null +++ b/dev-python/ws4py/ws4py-0.5.1-r1.ebuild @@ -0,0 +1,53 @@ +# Copyright 1999-2020 Gentoo Authors +# 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=7 +PYTHON_COMPAT=( python3_{6,7,8} ) +PYTHON_REQ_USE="threads(+)?" + +inherit distutils-r1 +if [[ ${PV} == "9999" ]] ; then + EGIT_REPO_URI="https://github.com/Lawouach/WebSocket-for-Python.git" + inherit git-r3 +else + SRC_URI="https://github.com/Lawouach/WebSocket-for-Python/archive/${PV}.tar.gz -> ${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" +RESTRICT="!test? ( test )" +# doc build requires sphinxcontrib ext packages absent from portage + +RDEPEND=">=dev-python/greenlet-0.4.1[${PYTHON_USEDEP}] + >=dev-python/cython-0.19.1[${PYTHON_USEDEP}] + client? ( >=www-servers/tornado-3.1[${PYTHON_USEDEP}] ) + server? ( >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] )" + +DEPEND="test? ( + >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] + dev-python/unittest2[${PYTHON_USEDEP}] + >=dev-python/mock-1.0.1[${PYTHON_USEDEP}] + )" + +PATCHES=( "${FILESDIR}"/${PN}-0.5.1-python3.7+-compatibility.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 +} diff --git a/dev-python/ws4py/ws4py-9999.ebuild b/dev-python/ws4py/ws4py-9999.ebuild index 461f735ab784..21de5cde42da 100644 --- a/dev-python/ws4py/ws4py-9999.ebuild +++ b/dev-python/ws4py/ws4py-9999.ebuild @@ -6,16 +6,15 @@ # Same for www-servers/tornado and USE=client ... so why not??? # pypy is viable but better with a cutdown set of deps -EAPI=6 -PYTHON_COMPAT=( python3_6 ) -PYTHON_REQ_USE="threads?" +EAPI=7 +PYTHON_COMPAT=( python3_{6,7,8} ) +PYTHON_REQ_USE="threads(+)?" inherit distutils-r1 if [[ ${PV} == "9999" ]] ; then EGIT_REPO_URI="https://github.com/Lawouach/WebSocket-for-Python.git" inherit git-r3 else - inherit vcs-snapshot SRC_URI="https://github.com/Lawouach/WebSocket-for-Python/archive/${PV}.tar.gz -> ${P}.tar.gz" KEYWORDS="~amd64 ~arm ~x86" fi @@ -30,15 +29,18 @@ RESTRICT="!test? ( test )" # doc build requires sphinxcontrib ext packages absent from portage RDEPEND=">=dev-python/greenlet-0.4.1[${PYTHON_USEDEP}] - >=dev-python/cython-0.19.1[${PYTHON_USEDEP}] - client? ( >=www-servers/tornado-3.1[${PYTHON_USEDEP}] ) - server? ( >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] )" + >=dev-python/cython-0.19.1[${PYTHON_USEDEP}] + client? ( >=www-servers/tornado-3.1[${PYTHON_USEDEP}] ) + server? ( >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] )" + DEPEND="test? ( >=dev-python/cherrypy-3.2.4[${PYTHON_USEDEP}] dev-python/unittest2[${PYTHON_USEDEP}] >=dev-python/mock-1.0.1[${PYTHON_USEDEP}] )" +PATCHES=( "${FILESDIR}"/${PN}-0.5.1-python3.7+-compatibility.patch ) + python_test() { # testsuite displays an issue with mock under py3 but is non fatal "${PYTHON}" -m unittest discover || die "Tests failed under ${EPYTHON}" -- cgit v1.2.3