File python-psycopg.spec of Package python-psycopg
# spec file for package python-psycopg
#
# Copyright (c) 2022 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/
#
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-psycopg
Version: 3.0.16
Release: 0
Summary: Python-PostgreSQL Database Adapter v3
License: LGPL-3.0-or-later AND (LGPL-3.0-or-later OR ZPL-2.0) AND SUSE-GPL-2.0-with-openssl-exception
URL: http://initd.org/psycopg/
Source: https://files.pythonhosted.org/packages/source/p/psycopg/psycopg-%{version}.tar.gz
BuildRequires: %{python_module devel >= 3.7}
BuildRequires: %{python_module setuptools >= 49.2.0}
BuildRequires: %{python_module wheel >= 0.37}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
# newer postgresql packages pg_config in -server-devel
%if 0%{?sle_version} > 150100 || 0%{?suse_version} > 1500
BuildRequires: postgresql-server-devel >= 9.1
%else
BuildRequires: postgresql-devel >= 9.1
%endif
%if 0%{?suse_version} || 0%{?fedora_version} >= 24
Suggests: postgresql-server
%endif
BuildArch: noarch
%python_subpackages
%description
Psycopg 3 is a modern implementation of a PostgreSQL adapter for Python.
%prep
%setup -q -n psycopg-%{version}
%build
%python_build
%install
%python_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
# tests require running PGSQL
# export PSYCOPG_TEST_DSN="host=localhost dbname=psycopg_test"
#%%pytest_arch
%files %{python_files}
%license LICENSE.txt
%doc README.rst
%{python_sitelib}/psycopg/
%{python_sitelib}/psycopg-%{version}-py%{python_version}.egg-info/
%changelog