summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-10 06:40:02 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-10 06:40:02 +0000
commit852b5ed7a0e9ddec44bd78e04cf6e3270fa1e641 (patch)
treee51aa299a972e9c7e54429a8df198cb7357c5826
parentfdd3312fbd9c7e1549d6b5f9ddafad77b4109096 (diff)
automatic import of python-websockets
-rw-r--r--.gitignore1
-rw-r--r--python-websockets.spec99
-rw-r--r--sources2
3 files changed, 56 insertions, 46 deletions
diff --git a/.gitignore b/.gitignore
index c8b3dee..ad8a816 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
/websockets-10.4.tar.gz
+/websockets-11.0.1.tar.gz
diff --git a/python-websockets.spec b/python-websockets.spec
index 17bcb95..ea40aa3 100644
--- a/python-websockets.spec
+++ b/python-websockets.spec
@@ -1,32 +1,25 @@
%global _empty_manifest_terminate_build 0
Name: python-websockets
-Version: 10.4
+Version: 11.0.1
Release: 1
Summary: An implementation of the WebSocket Protocol (RFC 6455 & 7692)
-License: BSD
-URL: https://github.com/aaugustin/websockets
-Source0: https://mirrors.nju.edu.cn/pypi/web/packages/85/dc/549a807a53c13fd4a8dac286f117a7a71260defea9ec0c05d6027f2ae273/websockets-10.4.tar.gz
+License: BSD-3-Clause
+URL: https://pypi.org/project/websockets/
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/bd/90/6b5802fad3992d6eac7163216e0389a72475cbb57b23005135190e96d160/websockets-11.0.1.tar.gz
%description
websockets is a library for building WebSocket_ servers and clients in Python
with a focus on correctness, simplicity, robustness, and performance.
-Built on top of ``asyncio``, Python's standard asynchronous I/O framework, it
-provides an elegant coroutine-based API.
+Built on top of ``asyncio``, Python's standard asynchronous I/O framework, the
+default implementation provides an elegant coroutine-based API.
+An implementation on top of ``threading`` and a Sans-I/O implementation are also
+available.
`Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>`_
-Here's how a client sends and receives messages:
+Here's an echo server with the ``asyncio`` API:
#!/usr/bin/env python
import asyncio
- from websockets import connect
- async def hello(uri):
- async with connect(uri) as websocket:
- await websocket.send("Hello world!")
- await websocket.recv()
- asyncio.run(hello("ws://localhost:8765"))
-And here's an echo server:
- #!/usr/bin/env python
- import asyncio
- from websockets import serve
+ from websockets.server import serve
async def echo(websocket):
async for message in websocket:
await websocket.send(message)
@@ -34,6 +27,16 @@ And here's an echo server:
async with serve(echo, "localhost", 8765):
await asyncio.Future() # run forever
asyncio.run(main())
+Here's how a client sends and receives messages with the ``threading`` API:
+ #!/usr/bin/env python
+ import asyncio
+ from websockets.sync.client import connect
+ def hello():
+ with connect("ws://localhost:8765") as websocket:
+ websocket.send("Hello world!")
+ message = websocket.recv()
+ print(f"Received: {message}")
+ hello()
Does that look good?
`Get started with the tutorial! <https://websockets.readthedocs.io/en/stable/intro/index.html>`_
@@ -49,22 +52,15 @@ BuildRequires: gdb
%description -n python3-websockets
websockets is a library for building WebSocket_ servers and clients in Python
with a focus on correctness, simplicity, robustness, and performance.
-Built on top of ``asyncio``, Python's standard asynchronous I/O framework, it
-provides an elegant coroutine-based API.
+Built on top of ``asyncio``, Python's standard asynchronous I/O framework, the
+default implementation provides an elegant coroutine-based API.
+An implementation on top of ``threading`` and a Sans-I/O implementation are also
+available.
`Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>`_
-Here's how a client sends and receives messages:
- #!/usr/bin/env python
- import asyncio
- from websockets import connect
- async def hello(uri):
- async with connect(uri) as websocket:
- await websocket.send("Hello world!")
- await websocket.recv()
- asyncio.run(hello("ws://localhost:8765"))
-And here's an echo server:
+Here's an echo server with the ``asyncio`` API:
#!/usr/bin/env python
import asyncio
- from websockets import serve
+ from websockets.server import serve
async def echo(websocket):
async for message in websocket:
await websocket.send(message)
@@ -72,6 +68,16 @@ And here's an echo server:
async with serve(echo, "localhost", 8765):
await asyncio.Future() # run forever
asyncio.run(main())
+Here's how a client sends and receives messages with the ``threading`` API:
+ #!/usr/bin/env python
+ import asyncio
+ from websockets.sync.client import connect
+ def hello():
+ with connect("ws://localhost:8765") as websocket:
+ websocket.send("Hello world!")
+ message = websocket.recv()
+ print(f"Received: {message}")
+ hello()
Does that look good?
`Get started with the tutorial! <https://websockets.readthedocs.io/en/stable/intro/index.html>`_
@@ -81,22 +87,15 @@ Provides: python3-websockets-doc
%description help
websockets is a library for building WebSocket_ servers and clients in Python
with a focus on correctness, simplicity, robustness, and performance.
-Built on top of ``asyncio``, Python's standard asynchronous I/O framework, it
-provides an elegant coroutine-based API.
+Built on top of ``asyncio``, Python's standard asynchronous I/O framework, the
+default implementation provides an elegant coroutine-based API.
+An implementation on top of ``threading`` and a Sans-I/O implementation are also
+available.
`Documentation is available on Read the Docs. <https://websockets.readthedocs.io/>`_
-Here's how a client sends and receives messages:
- #!/usr/bin/env python
- import asyncio
- from websockets import connect
- async def hello(uri):
- async with connect(uri) as websocket:
- await websocket.send("Hello world!")
- await websocket.recv()
- asyncio.run(hello("ws://localhost:8765"))
-And here's an echo server:
+Here's an echo server with the ``asyncio`` API:
#!/usr/bin/env python
import asyncio
- from websockets import serve
+ from websockets.server import serve
async def echo(websocket):
async for message in websocket:
await websocket.send(message)
@@ -104,11 +103,21 @@ And here's an echo server:
async with serve(echo, "localhost", 8765):
await asyncio.Future() # run forever
asyncio.run(main())
+Here's how a client sends and receives messages with the ``threading`` API:
+ #!/usr/bin/env python
+ import asyncio
+ from websockets.sync.client import connect
+ def hello():
+ with connect("ws://localhost:8765") as websocket:
+ websocket.send("Hello world!")
+ message = websocket.recv()
+ print(f"Received: {message}")
+ hello()
Does that look good?
`Get started with the tutorial! <https://websockets.readthedocs.io/en/stable/intro/index.html>`_
%prep
-%autosetup -n websockets-10.4
+%autosetup -n websockets-11.0.1
%build
%py3_build
@@ -148,5 +157,5 @@ mv %{buildroot}/doclist.lst .
%{_docdir}/*
%changelog
-* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 10.4-1
+* Mon Apr 10 2023 Python_Bot <Python_Bot@openeuler.org> - 11.0.1-1
- Package Spec generated
diff --git a/sources b/sources
index 3c33e51..f9d3bac 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-d6b1a2cb5e194ae43f849c125b71c8db websockets-10.4.tar.gz
+ce1f2b10250cd3fa233ff572593d6ed3 websockets-11.0.1.tar.gz