summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-05-15 08:55:27 +0000
committerCoprDistGit <infra@openeuler.org>2023-05-15 08:55:27 +0000
commitef2f84c1cf8c1e03601eb02c3d8f3b977d101436 (patch)
tree0781850013ebb2498f2f01ea7710e461f611c68d
parent21219ffe9b5b46bbb477f96751f3edecaa0d4ebb (diff)
automatic import of python-a2s
-rw-r--r--.gitignore1
-rw-r--r--python-a2s.spec165
-rw-r--r--sources1
3 files changed, 167 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..10f0bcb 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/a2s-1.0.1.tar.gz
diff --git a/python-a2s.spec b/python-a2s.spec
new file mode 100644
index 0000000..015dd2b
--- /dev/null
+++ b/python-a2s.spec
@@ -0,0 +1,165 @@
+%global _empty_manifest_terminate_build 0
+Name: python-a2s
+Version: 1.0.1
+Release: 1
+Summary: Convert python async function to a sync function for calling from a normal function in an existing event loop
+License: MIT License
+URL: https://github.com/plter/a2s
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/db/78/259fdbaf6006401eaf52109113e7a6e65229c9359d2a4f221363d9b4390c/a2s-1.0.1.tar.gz
+BuildArch: noarch
+
+
+%description
+# a2s
+
+Python async function to sync function, Convert python async function to a sync function for calling from a normal
+function in an existing event loop
+
+# Usage
+
+```python
+import asyncio
+from a2s import sync
+
+
+@sync
+async def an_async_func():
+ print("Hello World")
+
+
+def a_sync_func():
+ an_async_func()
+ pass
+
+
+async def main():
+ a_sync_func()
+ pass
+
+
+if __name__ == '__main__':
+ asyncio.run(main())
+```
+
+
+
+%package -n python3-a2s
+Summary: Convert python async function to a sync function for calling from a normal function in an existing event loop
+Provides: python-a2s
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-a2s
+# a2s
+
+Python async function to sync function, Convert python async function to a sync function for calling from a normal
+function in an existing event loop
+
+# Usage
+
+```python
+import asyncio
+from a2s import sync
+
+
+@sync
+async def an_async_func():
+ print("Hello World")
+
+
+def a_sync_func():
+ an_async_func()
+ pass
+
+
+async def main():
+ a_sync_func()
+ pass
+
+
+if __name__ == '__main__':
+ asyncio.run(main())
+```
+
+
+
+%package help
+Summary: Development documents and examples for a2s
+Provides: python3-a2s-doc
+%description help
+# a2s
+
+Python async function to sync function, Convert python async function to a sync function for calling from a normal
+function in an existing event loop
+
+# Usage
+
+```python
+import asyncio
+from a2s import sync
+
+
+@sync
+async def an_async_func():
+ print("Hello World")
+
+
+def a_sync_func():
+ an_async_func()
+ pass
+
+
+async def main():
+ a_sync_func()
+ pass
+
+
+if __name__ == '__main__':
+ asyncio.run(main())
+```
+
+
+
+%prep
+%autosetup -n a2s-1.0.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-a2s -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Mon May 15 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..ea6d958
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+5342b344fb74eb81457c9a4ce98f3e8d a2s-1.0.1.tar.gz