From 1854f30287488b0ff597875ddea7689eaeb741445ce4188d845763c1889ef0ef Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Sun, 22 Nov 2020 16:16:35 +0000 Subject: [PATCH] Accepting request 849971 from home:jayvdb:py-submit Modern equiv of psycopg2, which is also maintained at d-l-py. It is a dependency of a very large number of python libraries already present in d-l-py, and many others which should be in d-l-py because they are considered core by most other Linux distros, so I believe this new should also be maintained here. 4.5k stars on GitHub. Already present in Debian & Ubuntu & co, Arch & Manjaro & co, Gentoo, *ports, nix, Kali https://repology.org/projects/?search=asyncpg OBS-URL: https://build.opensuse.org/request/show/849971 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-asyncpg?expand=0&rev=1 --- .gitattributes | 23 ++++++++++++ .gitignore | 1 + asyncpg-0.20.1.tar.gz | 3 ++ merged-static-fix.patch | 34 ++++++++++++++++++ python-asyncpg.changes | 17 +++++++++ python-asyncpg.spec | 79 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 157 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 asyncpg-0.20.1.tar.gz create mode 100644 merged-static-fix.patch create mode 100644 python-asyncpg.changes create mode 100644 python-asyncpg.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/asyncpg-0.20.1.tar.gz b/asyncpg-0.20.1.tar.gz new file mode 100644 index 0000000..5dd48db --- /dev/null +++ b/asyncpg-0.20.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:394bf19bdddbba07a38cd6fb526ebf66e120444d6b3097332b78efd5b26495b0 +size 734341 diff --git a/merged-static-fix.patch b/merged-static-fix.patch new file mode 100644 index 0000000..17b6a26 --- /dev/null +++ b/merged-static-fix.patch @@ -0,0 +1,34 @@ +From 76091445db8b49a7d78504b47eb34fcbfbb89567 Mon Sep 17 00:00:00 2001 +From: Elvis Pranskevichus +Date: Fri, 1 May 2020 20:02:39 -0700 +Subject: [PATCH] Properly declare uuid_to_str and uuid_to_hex as static + +Without `static` the toolchain might get confused and this might lead to +`undefined symbol: uuid_to_hex` errors. +--- + tohex.h | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/tohex.h b/tohex.h +index 3d2f5ad..60dd820 100644 +--- a/tohex.h ++++ b/tohex.h +@@ -27,7 +27,7 @@ + } + + +-void inline ++static inline void + uuid_to_str(const char *source, char *dest) + { + HEX_PRELUDE +@@ -44,7 +44,8 @@ uuid_to_str(const char *source, char *dest) + HEX_2_BYTES(source + 14, dest + 32) + } + +-void inline ++ ++static inline void + uuid_to_hex(const char *source, char *dest) + { + HEX_PRELUDE diff --git a/python-asyncpg.changes b/python-asyncpg.changes new file mode 100644 index 0000000..2dcc93d --- /dev/null +++ b/python-asyncpg.changes @@ -0,0 +1,17 @@ +------------------------------------------------------------------- +Sun Nov 22 14:12:03 UTC 2020 - John Vandenberg + +- Tidy spec +- Add merged-static-fix.patch to support Python 3.8 +- Activate test suite + +------------------------------------------------------------------- +Fri Jan 24 08:54:51 UTC 2020 - Bruno Friedmann + +- Update to version 0.20.1 + +------------------------------------------------------------------- +Wed Dec 26 14:01:50 UTC 2018 - Bruno Friedmann + +- Initial packaging asyncpg version 0.18.2 + diff --git a/python-asyncpg.spec b/python-asyncpg.spec new file mode 100644 index 0000000..703b322 --- /dev/null +++ b/python-asyncpg.spec @@ -0,0 +1,79 @@ +# +# spec file for package python-asyncpg +# +# Copyright (c) 2020 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define skip_python2 1 +%{?!python_module:%define python_module() python-%{**} python3-%{**}} +Name: python-asyncpg +Version: 0.20.1 +Release: 0 +Summary: Python asyncio PosgtreSQL driver +License: Apache-2.0 +Group: Development/Languages/Python +URL: https://github.com/MagicStack/asyncpg +Source: https://files.pythonhosted.org/packages/source/a/asyncpg/asyncpg-%{version}.tar.gz +# https://github.com/MagicStack/asyncpg/issues/594 +Patch0: https://github.com/MagicStack/py-pgproto/commit/760914.patch#/merged-static-fix.patch +BuildRequires: %{python_module Cython >= 0.28} +BuildRequires: %{python_module devel >= 3.5} +BuildRequires: %{python_module setuptools} +BuildRequires: fdupes +BuildRequires: python-rpm-macros +Requires: libpq5 >= 9.4 +# SECTION test requirements +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module uvloop >= 0.14.0} +BuildRequires: postgresql-contrib +BuildRequires: postgresql-server +# /SECTION +%python_subpackages + +%description +A fast PostgreSQL Database Client Library for Python/asyncio. + +**asyncpg** is a database interface library designed specifically for +PostgreSQL and Python/asyncio with clean implementation + +%prep +%setup -q -n asyncpg-%{version} +cd asyncpg/pgproto +%patch0 -p1 + +%build +%python_build + +%install +%python_install +%{python_expand find %{buildroot}%{$python_sitearch} -name '*.[ch]' -delete +%fdupes -s %{buildroot}%{$python_sitearch} +} + +%check +# Needed to avoid asyncpg.cluster.ClusterError: +# could not find pg_config executable +export PGINSTALLATION=%{_bindir} + +mv asyncpg .asyncpg +%pytest_arch -rs +mv .asyncpg asyncpg + +%files %{python_files} +%license LICENSE +%doc README.rst +%{python_sitearch}/* + +%changelog