summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-fastapi-socketio.spec333
-rw-r--r--sources1
3 files changed, 335 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..85c34b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/fastapi-socketio-0.0.10.tar.gz
diff --git a/python-fastapi-socketio.spec b/python-fastapi-socketio.spec
new file mode 100644
index 0000000..c2a578d
--- /dev/null
+++ b/python-fastapi-socketio.spec
@@ -0,0 +1,333 @@
+%global _empty_manifest_terminate_build 0
+Name: python-fastapi-socketio
+Version: 0.0.10
+Release: 1
+Summary: Easily integrate socket.io with your FastAPI app.
+License: Apache License, Version 2.0
+URL: https://github.com/pyropy/fastapi-socketio
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e1/14/dde9633af2168f1929447c7d8a8947e9371dfca37d58c72d8c1ad686db75/fastapi-socketio-0.0.10.tar.gz
+BuildArch: noarch
+
+Requires: python3-fastapi
+Requires: python3-socketio
+Requires: python3-pytest
+
+%description
+# fastapi-socketio
+
+[![PyPI](https://img.shields.io/pypi/v/fastapi-socketio.svg)](https://pypi.org/project/fastapi-socketio/)
+[![Changelog](https://img.shields.io/github/v/release/pyropy/fastapi-socketio?label=changelog)](https://github.com/pyropy/fastapi-socketio/releases)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/pyropy/fastapi-socketio/blob/main/LICENSE)
+
+Easly integrate socket.io with your FastAPI app.
+
+## Installation
+
+Install this plugin using `pip`:
+
+ $ pip install fastapi-socketio
+
+## Usage
+
+To add SocketIO support to FastAPI all you need to do is import `SocketManager` and pass it `FastAPI` object.
+
+```python
+# app.py
+from fastapi import FastAPI
+from fastapi_socketio import SocketManager
+
+app = FastAPI()
+socket_manager = SocketManager(app=app)
+```
+
+
+Now you can use SocketIO directly from your `FastAPI` app object.
+```python
+# socket_handlers.py
+from .app import app
+
+@app.sio.on('join')
+async def handle_join(sid, *args, **kwargs):
+ await app.sio.emit('lobby', 'User joined')
+
+```
+
+Or you can import `SocketManager` object that exposes most of the SocketIO functionality.
+
+```python
+# socket_handlers2.py
+from .app import socket_manager as sm
+
+@sm.on('leave')
+async def handle_leave(sid, *args, **kwargs):
+ await sm.emit('lobby', 'User left')
+
+```
+
+## Development
+
+To contribute to this library, first checkout the code. Then create a new virtual environment:
+
+ cd fastapi-socketio
+ python -mvenv venv
+ source venv/bin/activate
+
+Or if you are using `pipenv`:
+
+ pipenv shell
+
+Now install the dependencies and tests:
+
+ pip install -e '.[test]'
+
+To run the tests:
+
+ pytest
+
+
+## Run example
+
+To run the examples simply run:
+
+```bash
+PYTHONPATH=. python examples/app.py
+```
+
+Before running example make sure you have all dependencies installed.
+
+## Contributors
+
+For list of contributors please reefer to CONTRIBUTORS.md file in this repository.
+
+
+
+%package -n python3-fastapi-socketio
+Summary: Easily integrate socket.io with your FastAPI app.
+Provides: python-fastapi-socketio
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-fastapi-socketio
+# fastapi-socketio
+
+[![PyPI](https://img.shields.io/pypi/v/fastapi-socketio.svg)](https://pypi.org/project/fastapi-socketio/)
+[![Changelog](https://img.shields.io/github/v/release/pyropy/fastapi-socketio?label=changelog)](https://github.com/pyropy/fastapi-socketio/releases)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/pyropy/fastapi-socketio/blob/main/LICENSE)
+
+Easly integrate socket.io with your FastAPI app.
+
+## Installation
+
+Install this plugin using `pip`:
+
+ $ pip install fastapi-socketio
+
+## Usage
+
+To add SocketIO support to FastAPI all you need to do is import `SocketManager` and pass it `FastAPI` object.
+
+```python
+# app.py
+from fastapi import FastAPI
+from fastapi_socketio import SocketManager
+
+app = FastAPI()
+socket_manager = SocketManager(app=app)
+```
+
+
+Now you can use SocketIO directly from your `FastAPI` app object.
+```python
+# socket_handlers.py
+from .app import app
+
+@app.sio.on('join')
+async def handle_join(sid, *args, **kwargs):
+ await app.sio.emit('lobby', 'User joined')
+
+```
+
+Or you can import `SocketManager` object that exposes most of the SocketIO functionality.
+
+```python
+# socket_handlers2.py
+from .app import socket_manager as sm
+
+@sm.on('leave')
+async def handle_leave(sid, *args, **kwargs):
+ await sm.emit('lobby', 'User left')
+
+```
+
+## Development
+
+To contribute to this library, first checkout the code. Then create a new virtual environment:
+
+ cd fastapi-socketio
+ python -mvenv venv
+ source venv/bin/activate
+
+Or if you are using `pipenv`:
+
+ pipenv shell
+
+Now install the dependencies and tests:
+
+ pip install -e '.[test]'
+
+To run the tests:
+
+ pytest
+
+
+## Run example
+
+To run the examples simply run:
+
+```bash
+PYTHONPATH=. python examples/app.py
+```
+
+Before running example make sure you have all dependencies installed.
+
+## Contributors
+
+For list of contributors please reefer to CONTRIBUTORS.md file in this repository.
+
+
+
+%package help
+Summary: Development documents and examples for fastapi-socketio
+Provides: python3-fastapi-socketio-doc
+%description help
+# fastapi-socketio
+
+[![PyPI](https://img.shields.io/pypi/v/fastapi-socketio.svg)](https://pypi.org/project/fastapi-socketio/)
+[![Changelog](https://img.shields.io/github/v/release/pyropy/fastapi-socketio?label=changelog)](https://github.com/pyropy/fastapi-socketio/releases)
+[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/pyropy/fastapi-socketio/blob/main/LICENSE)
+
+Easly integrate socket.io with your FastAPI app.
+
+## Installation
+
+Install this plugin using `pip`:
+
+ $ pip install fastapi-socketio
+
+## Usage
+
+To add SocketIO support to FastAPI all you need to do is import `SocketManager` and pass it `FastAPI` object.
+
+```python
+# app.py
+from fastapi import FastAPI
+from fastapi_socketio import SocketManager
+
+app = FastAPI()
+socket_manager = SocketManager(app=app)
+```
+
+
+Now you can use SocketIO directly from your `FastAPI` app object.
+```python
+# socket_handlers.py
+from .app import app
+
+@app.sio.on('join')
+async def handle_join(sid, *args, **kwargs):
+ await app.sio.emit('lobby', 'User joined')
+
+```
+
+Or you can import `SocketManager` object that exposes most of the SocketIO functionality.
+
+```python
+# socket_handlers2.py
+from .app import socket_manager as sm
+
+@sm.on('leave')
+async def handle_leave(sid, *args, **kwargs):
+ await sm.emit('lobby', 'User left')
+
+```
+
+## Development
+
+To contribute to this library, first checkout the code. Then create a new virtual environment:
+
+ cd fastapi-socketio
+ python -mvenv venv
+ source venv/bin/activate
+
+Or if you are using `pipenv`:
+
+ pipenv shell
+
+Now install the dependencies and tests:
+
+ pip install -e '.[test]'
+
+To run the tests:
+
+ pytest
+
+
+## Run example
+
+To run the examples simply run:
+
+```bash
+PYTHONPATH=. python examples/app.py
+```
+
+Before running example make sure you have all dependencies installed.
+
+## Contributors
+
+For list of contributors please reefer to CONTRIBUTORS.md file in this repository.
+
+
+
+%prep
+%autosetup -n fastapi-socketio-0.0.10
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-fastapi-socketio -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 0.0.10-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..54898e2
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+f627a90d4aeaf1c381da9b751b9c47f7 fastapi-socketio-0.0.10.tar.gz