diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:11:29 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-10 04:11:29 +0000 |
| commit | 593ed2a434c162ded3079aab7787197da97eec59 (patch) | |
| tree | 73f38a364aeb08aa8b1e0cc4f4cb9f7808b9cd18 | |
| parent | 79ef50ee6774db5f403a88d8a7c37a44fc86c341 (diff) | |
automatic import of python-greenletioopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-greenletio.spec | 253 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 255 insertions, 0 deletions
@@ -0,0 +1 @@ +/greenletio-0.10.1.tar.gz diff --git a/python-greenletio.spec b/python-greenletio.spec new file mode 100644 index 0000000..ee5e5ed --- /dev/null +++ b/python-greenletio.spec @@ -0,0 +1,253 @@ +%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 + +[](https://github.com/miguelgrinberg/greenletio/actions) [](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 + +[](https://github.com/miguelgrinberg/greenletio/actions) [](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 + +[](https://github.com/miguelgrinberg/greenletio/actions) [](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 <Python_Bot@openeuler.org> - 0.10.1-1 +- Package Spec generated @@ -0,0 +1 @@ +9cd946831cf663c7cfaa47fa1c4b659a greenletio-0.10.1.tar.gz |
