Blame python-google-cloud-dns.spec

b7e67c2
# tests are enabled by default
b7e67c2
%bcond_without tests
b7e67c2
b7e67c2
%global         srcname     google-cloud-dns
b7e67c2
%global         forgeurl    https://github.com/googleapis/python-dns
4ba45ac
Version:        0.34.2
b7e67c2
%global         tag         v%{version}
b7e67c2
%forgemeta
b7e67c2
b7e67c2
Name:           python-%{srcname}
b7e67c2
Release:        %autorelease
b7e67c2
Summary:        Python Client for Google Cloud DNS
b7e67c2
b7e67c2
License:        ASL 2.0
b7e67c2
URL:            %forgeurl
b7e67c2
Source0:        %forgesource
b7e67c2
Patch0:         python-google-cloud-dns-mock.patch
b7e67c2
b7e67c2
BuildArch:      noarch
b7e67c2
b7e67c2
BuildRequires:  pyproject-rpm-macros
b7e67c2
b7e67c2
%if %{with tests}
b7e67c2
BuildRequires:  python3dist(google-cloud-core)
b7e67c2
BuildRequires:  python3dist(pytest)
b7e67c2
%endif
b7e67c2
b7e67c2
%global _description %{expand:
b7e67c2
The Google Cloud DNS API provides methods that you can use to manage DNS
b7e67c2
on Google infrastructure.}
b7e67c2
b7e67c2
%description %{_description}
b7e67c2
b7e67c2
%package -n python3-%{srcname}
b7e67c2
Summary: %{summary}
b7e67c2
%{?python_provide:%python_provide python3-%{srcname}}
b7e67c2
b7e67c2
%description -n python3-%{srcname} %_description
b7e67c2
b7e67c2
%prep
b7e67c2
%forgeautosetup -p1
b7e67c2
b7e67c2
%generate_buildrequires
b7e67c2
%pyproject_buildrequires -r
b7e67c2
b7e67c2
%build
b7e67c2
%pyproject_wheel
b7e67c2
b7e67c2
%install
b7e67c2
%pyproject_install
b7e67c2
%pyproject_save_files google
b7e67c2
b7e67c2
%check
51d3395
%pyproject_check_import
51d3395
51d3395
%if %{with tests}
51d3395
# NOTE(mhayden): Setting PYTHONUSERBASE as a hack for PEP 420 namespaces.
51d3395
# Thanks to churchyard for the fix.
51d3395
PYTHONUSERBASE=%{buildroot}%{_prefix} \
51d3395
    %pytest tests/unit
b7e67c2
%endif
b7e67c2
b7e67c2
%files -n python3-%{srcname} -f %{pyproject_files}
b7e67c2
%doc README.rst CHANGELOG.md SECURITY.md
b7e67c2
%license LICENSE
b7e67c2
%{python3_sitelib}/google_cloud_dns-%{version}-py*-nspkg.pth
b7e67c2
b7e67c2
%changelog
b7e67c2
%autochangelog