15
0
Files
python-asyncpg/python-asyncpg.spec
Matej Cepl 1854f30287 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
2020-11-22 16:16:35 +00:00

80 lines
2.4 KiB
RPMSpec

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