pop-loop Contains plugins that allow alternate io loops to be used to run asynchronous code in pop projects.
About
Pop used the asyncio loop by default in a built-in mod at ‘hub.pop.loop’. It became necessary to split the mod into it’s own project for more loop capabilities. For testing, loop management was difficult, but paired with pytest-pop, pop-loop makes async testing easy.
What is POP?
This project is built with pop, a Python-based implementation of Plugin Oriented Programming (POP). POP seeks to bring together concepts and wisdom from the history of computing in new ways to solve modern computing problems.
For more information:
Getting Started
Prerequisites
Python 3.8+
git (if installing from source, or contributing to the project)
Installation
If wanting to use pop-loop, you can do so by either installing from PyPI or from source.
Install from PyPI
If package is available via PyPI, include the directions.
pip install pop-loop
Install Extras
pop-loop can be installed with extras to enable the different loop plugins in this project.
trio: .. code-block:: bash
pip install pop-loop[trio]
uvloop: .. code-block:: bash
pip install pop-loop[uvloop]
qt: .. code-block:: bash
pip install pop-loop[qt]
Install from source
# clone repo
git clone git@gitlab.com/saltstack/pop/pop-loop.git
cd pop-loop
# Setup venv
python3 -m venv .venv
source .venv/bin/activate
pip install -e .
Usage
Describe some basic example use case for this plugin.
Examples
uvloop example: .. code-block:: python
import asyncio import pop.hub
hub = pop.hub.Hub()
hub.pop.loop.create(loop_plugin=”uv”) task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)
trio example: .. code-block:: python
import asyncio import pop.hub
hub = pop.hub.Hub()
hub.pop.loop.create(loop_plugin=”trio”) task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)
QT example: .. code-block:: python
import asyncio import pop.hub import PyQt5.QtWidgets as pyqt5
hub = pop.hub.Hub() hub.loop.qt.APP = pyqt5.QApplication([]) hub.pop.loop.create(loop_plugin=”qt”)
task = hub.pop.Loop.create(asyncio.sleep(0)) hub.pop.Loop.run_until_complete(task)
Acknowledgements
Img Shields for making repository badges easy.
Metadata
Release files for pop-loop 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pop-loop-1.1.0.tar.gz | 11.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pop_loop-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 25.2 kB
Release files / pop-loop-1.1.0.tar.gz
| Download URL | pop-loop-1.1.0.tar.gz |
|---|---|
| Size | 11.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9d5fd00afa2334c0edf80d9af331b668199cfbcf31a335dcf7730ff87bfc252f
|
|
BLAKE2b-256 checksum How to use checksums |
731b0b8939675e3e67c52a6e308a1b6ca429c9c372542f301fc78875c2d491bc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17
|
Release files / pop_loop-1.1.0-py3-none-any.whl
| Download URL | pop_loop-1.1.0-py3-none-any.whl |
|---|---|
| Size | 13.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c529a558895180e74eec1880fcc66189cab1e18070338590a82d0da28de179e2
|
|
BLAKE2b-256 checksum How to use checksums |
9c69278576aab27387de566cc676b405ea0ac1a8fab8cc40cfaf58bb297d1a53
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.8.0 pkginfo/1.9.6 readme-renderer/40.0 requests/2.31.0 requests-toolbelt/1.0.0 urllib3/2.0.3 tqdm/4.65.0 importlib-metadata/6.7.0 keyring/24.2.0 rfc3986/2.0.0 colorama/0.4.6 CPython/3.9.17
|