%global _empty_manifest_terminate_build 0 Name: python-greenletio Version: 0.10.1 Release: 1 Summary: Asyncio integration with sync code using greenlets. License: MIT License URL: https://github.com/miguelgrinberg/greenletio Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2f/62/3cdfbbd1eb512cc3bb310ee499a7aa5f64472e714214a216ca30f3736aaf/greenletio-0.10.1.tar.gz BuildArch: noarch Requires: python3-greenlet %description # greenletio [![Build status](https://github.com/miguelgrinberg/greenletio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/greenletio/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/greenletio/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/greenletio) This project allows synchronous and asynchronous functions to be used together. Unlike other methods based on executors and thread or process pools, `greenletio` allows synchronous functions to work like their asynchronous counterparts, without the need to create expensive threads or processes. ## Examples The following are some of the possibilities when using `greenletio`. ### Convert a sync function into an awaitable ```python import asyncio from greenletio import async_ @async_ def sync_function(arg): pass async def async_function(): await sync_function(42) asyncio.run(async_function()) ``` ### Use await inside a sync function ```python from greenletio import await_ async def async_function(): pass def sync_function(): await_(async_function()) ``` ### Call an async function as a normal function ```python from greenletio import await_ @await_ async def async_function(): pass def sync_function(): async_function() ``` ## Resources - [Documentation](http://greenletio.readthedocs.io/en/latest/) - [PyPI](https://pypi.python.org/pypi/greenletio) - [Change Log](https://github.com/miguelgrinberg/greenletio/blob/main/CHANGES.md) %package -n python3-greenletio Summary: Asyncio integration with sync code using greenlets. Provides: python-greenletio BuildRequires: python3-devel BuildRequires: python3-setuptools BuildRequires: python3-pip %description -n python3-greenletio # greenletio [![Build status](https://github.com/miguelgrinberg/greenletio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/greenletio/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/greenletio/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/greenletio) This project allows synchronous and asynchronous functions to be used together. Unlike other methods based on executors and thread or process pools, `greenletio` allows synchronous functions to work like their asynchronous counterparts, without the need to create expensive threads or processes. ## Examples The following are some of the possibilities when using `greenletio`. ### Convert a sync function into an awaitable ```python import asyncio from greenletio import async_ @async_ def sync_function(arg): pass async def async_function(): await sync_function(42) asyncio.run(async_function()) ``` ### Use await inside a sync function ```python from greenletio import await_ async def async_function(): pass def sync_function(): await_(async_function()) ``` ### Call an async function as a normal function ```python from greenletio import await_ @await_ async def async_function(): pass def sync_function(): async_function() ``` ## Resources - [Documentation](http://greenletio.readthedocs.io/en/latest/) - [PyPI](https://pypi.python.org/pypi/greenletio) - [Change Log](https://github.com/miguelgrinberg/greenletio/blob/main/CHANGES.md) %package help Summary: Development documents and examples for greenletio Provides: python3-greenletio-doc %description help # greenletio [![Build status](https://github.com/miguelgrinberg/greenletio/workflows/build/badge.svg)](https://github.com/miguelgrinberg/greenletio/actions) [![codecov](https://codecov.io/gh/miguelgrinberg/greenletio/branch/main/graph/badge.svg)](https://codecov.io/gh/miguelgrinberg/greenletio) This project allows synchronous and asynchronous functions to be used together. Unlike other methods based on executors and thread or process pools, `greenletio` allows synchronous functions to work like their asynchronous counterparts, without the need to create expensive threads or processes. ## Examples The following are some of the possibilities when using `greenletio`. ### Convert a sync function into an awaitable ```python import asyncio from greenletio import async_ @async_ def sync_function(arg): pass async def async_function(): await sync_function(42) asyncio.run(async_function()) ``` ### Use await inside a sync function ```python from greenletio import await_ async def async_function(): pass def sync_function(): await_(async_function()) ``` ### Call an async function as a normal function ```python from greenletio import await_ @await_ async def async_function(): pass def sync_function(): async_function() ``` ## Resources - [Documentation](http://greenletio.readthedocs.io/en/latest/) - [PyPI](https://pypi.python.org/pypi/greenletio) - [Change Log](https://github.com/miguelgrinberg/greenletio/blob/main/CHANGES.md) %prep %autosetup -n greenletio-0.10.1 %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-greenletio -f filelist.lst %dir %{python3_sitelib}/* %files help -f doclist.lst %{_docdir}/* %changelog * Wed May 10 2023 Python_Bot - 0.10.1-1 - Package Spec generated