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
This commit is contained in:
2020-11-22 16:16:35 +00:00
committed by Git OBS Bridge
commit de013bbb3b
6 changed files with 161 additions and 0 deletions

24
.gitattributes vendored Normal file
View File

@@ -0,0 +1,24 @@
*.changes merge=merge-changes
*.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
*.tar 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

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
*.obscpio
*.osc
_build.*
.pbuild

3
asyncpg-0.20.1.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:394bf19bdddbba07a38cd6fb526ebf66e120444d6b3097332b78efd5b26495b0
size 734341

34
merged-static-fix.patch Normal file
View File

@@ -0,0 +1,34 @@
From 76091445db8b49a7d78504b47eb34fcbfbb89567 Mon Sep 17 00:00:00 2001
From: Elvis Pranskevichus <elvis@magic.io>
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

17
python-asyncpg.changes Normal file
View File

@@ -0,0 +1,17 @@
-------------------------------------------------------------------
Sun Nov 22 14:12:03 UTC 2020 - John Vandenberg <jayvdb@gmail.com>
- 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 <bruno@ioda-net.ch>
- Update to version 0.20.1
-------------------------------------------------------------------
Wed Dec 26 14:01:50 UTC 2018 - Bruno Friedmann <bruno@ioda-net.ch>
- Initial packaging asyncpg version 0.18.2

79
python-asyncpg.spec Normal file
View File

@@ -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