Blame python-google-cloud-org-policy.spec

81cc4d9
# The package currently has an empty test directory.
81cc4d9
%bcond_with tests
81cc4d9
81cc4d9
%global         srcname     google-cloud-org-policy
81cc4d9
%global         forgeurl    https://github.com/googleapis/python-org-policy
6416f3c
Version:        1.3.1
81cc4d9
%global         tag         v%{version}
81cc4d9
%forgemeta
81cc4d9
81cc4d9
Name:           python-%{srcname}
81cc4d9
Release:        %autorelease
81cc4d9
Summary:        Python Client for Google Cloud Organization Policy API
81cc4d9
81cc4d9
License:        ASL 2.0
81cc4d9
URL:            %forgeurl
81cc4d9
Source0:        %forgesource
81cc4d9
81cc4d9
BuildArch:      noarch
81cc4d9
2eae52c
BuildRequires:  python3-devel
81cc4d9
81cc4d9
%if %{with tests}
81cc4d9
BuildRequires:  python3dist(pytest)
81cc4d9
BuildRequires:  python3dist(pytest-asyncio)
81cc4d9
%endif
81cc4d9
81cc4d9
%global _description %{expand:
81cc4d9
The Organization Policy API allows users to configure governance rules on their
81cc4d9
GCP resources across the Cloud Resource Hierarchy.}
81cc4d9
81cc4d9
%description %{_description}
81cc4d9
81cc4d9
81cc4d9
%package -n python3-%{srcname}
81cc4d9
Summary:        %{summary}
81cc4d9
81cc4d9
%description -n python3-%{srcname} %{_description}
81cc4d9
81cc4d9
81cc4d9
%prep
81cc4d9
%forgeautosetup -p1
81cc4d9
81cc4d9
81cc4d9
%generate_buildrequires
81cc4d9
%pyproject_buildrequires -r
81cc4d9
81cc4d9
81cc4d9
%build
81cc4d9
%pyproject_wheel
81cc4d9
81cc4d9
81cc4d9
%install
81cc4d9
%pyproject_install
81cc4d9
%pyproject_save_files google
81cc4d9
81cc4d9
# Remove extra scripts, docs files, and tests.
2eae52c
rm -rf %{buildroot}%{python3_sitelib}/{docs,samples,scripts,tests}
81cc4d9
81cc4d9
81cc4d9
%if %{with tests}
81cc4d9
%check
81cc4d9
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
81cc4d9
# installed module. Thanks to mhroncok for the help!
81cc4d9
mv google{,_}
81cc4d9
%pytest --disable-warnings tests/unit
81cc4d9
mv google{_,}
81cc4d9
%endif
81cc4d9
81cc4d9
81cc4d9
%files -n python3-%{srcname} -f %{pyproject_files}
81cc4d9
%license LICENSE
81cc4d9
%doc README.rst CHANGELOG.md
81cc4d9
%{python3_sitelib}/google_cloud_org_policy-%{version}-py%{python3_version}-nspkg.pth
81cc4d9
81cc4d9
81cc4d9
%changelog
81cc4d9
%autochangelog