e362057
Name:           python-testing.postgresql
e362057
Version:        1.3.0
7159909
Release:        %autorelease
e362057
Summary:        Automatically sets up a PostgreSQL testing instance
00ce3ba
904589a
License:        Apache-2.0
e362057
URL:            https://github.com/tk0miya/testing.postgresql
e362057
Source0:        %{pypi_source testing.postgresql}
00ce3ba
BuildArch:      noarch
00ce3ba
e362057
# Backport unreleased commit 738c8eb19a4b064dd74ff851c379dd1cbf11bc65
e362057
# “Use utility methods of testing.common.database >= 1.1.0”, required
e362057
# for compatibility with testing.common.database >= 2.0.0.
f966da5
Patch:          %{url}/commit/738c8eb19a4b064dd74ff851c379dd1cbf11bc65.patch
e362057
e362057
# Backport unreleased commit 577445d8ff5e0ea89ccaf09fd5b82165a0875afe
e362057
# “Add CentOS/RHEL postgesql home directory blob to search patterns.”
f966da5
Patch:          %{url}/commit/577445d8ff5e0ea89ccaf09fd5b82165a0875afe.patch
e362057
00ce3ba
BuildRequires:  python3-devel
e362057
8f9b42f
BuildRequires:  postgresql-server
00ce3ba
Requires:       postgresql-server
e362057
e362057
%global common_description %{expand: \
e362057
Automatically sets up a PostgreSQL instance in a temporary directory, and
e362057
destroys it after testing.}
00ce3ba
00ce3ba
%description
e362057
%{common_description}
00ce3ba
00ce3ba
e362057
%package -n     python3-testing.postgresql
e362057
Summary:        %{summary}
e362057
e362057
%description -n python3-testing.postgresql
e362057
%{common_description}
00ce3ba
00ce3ba
00ce3ba
%prep
e362057
%autosetup -n testing.postgresql-%{version} -p1
8f9b42f
# Do not generate a BR on deprecated python3dist(nose); use pytest instead
8f9b42f
sed -r -i "s/'nose'/'pytest'/" setup.py
8f9b42f
8f9b42f
8f9b42f
%generate_buildrequires
8f9b42f
%pyproject_buildrequires -x testing
00ce3ba
00ce3ba
00ce3ba
%build
8f9b42f
%pyproject_wheel
00ce3ba
00ce3ba
00ce3ba
%install
8f9b42f
%pyproject_install
8f9b42f
%pyproject_save_files testing
00ce3ba
00ce3ba
00ce3ba
%check
8f9b42f
%pytest
00ce3ba
00ce3ba
8f9b42f
%files -n python3-testing.postgresql -f %{pyproject_files}
8f9b42f
# pyproject-rpm-macros handles LICENSE; verify with “rpm -qL -p …”
e362057
%doc README.rst
8f9b42f
e362057
# %%{python3_sitelib}/testing is a namespace package directory, but we do not
e362057
# need to (co-)own it because is owned by dependency
e362057
# python3dist(testing.common.database)
8f9b42f
%exclude %dir %{python3_sitelib}/testing
8f9b42f
e362057
%{python3_sitelib}/testing.postgresql-%{version}-py%{python3_version}-nspkg.pth
00ce3ba
00ce3ba
00ce3ba
%changelog
7159909
%autochangelog