diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d5f490 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/python-access-approval-1.3.5.tar.gz diff --git a/python-google-cloud-access-approval-mock.patch b/python-google-cloud-access-approval-mock.patch new file mode 100644 index 0000000..034478e --- /dev/null +++ b/python-google-cloud-access-approval-mock.patch @@ -0,0 +1,26 @@ +From 6e9dc85ae7094faae80fe4aad2ed1e4e61d4864b Mon Sep 17 00:00:00 2001 +From: Major Hayden +Date: Thu, 26 Aug 2021 09:52:26 -0500 +Subject: [PATCH] Use unittest.mock + +Signed-off-by: Major Hayden +--- + tests/unit/gapic/accessapproval_v1/test_access_approval.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/unit/gapic/accessapproval_v1/test_access_approval.py b/tests/unit/gapic/accessapproval_v1/test_access_approval.py +index 0a52eec..b20dcec 100644 +--- a/tests/unit/gapic/accessapproval_v1/test_access_approval.py ++++ b/tests/unit/gapic/accessapproval_v1/test_access_approval.py +@@ -14,7 +14,7 @@ + # limitations under the License. + # + import os +-import mock ++from unittest import mock + import packaging.version + + import grpc +-- +2.31.1 + diff --git a/python-google-cloud-access-approval.spec b/python-google-cloud-access-approval.spec new file mode 100644 index 0000000..28b6a58 --- /dev/null +++ b/python-google-cloud-access-approval.spec @@ -0,0 +1,100 @@ +# tests are enabled by default +%bcond_without tests + +%global srcname google-cloud-access-approval +%global forgeurl https://github.com/googleapis/python-access-approval +Version: 1.3.5 +%global tag v%{version} +%forgemeta + +Name: python-%{srcname} +Release: %autorelease +Summary: Python Client for Google Cloud Access Approval API + +License: ASL 2.0 +URL: %forgeurl +Source0: %forgesource +Patch0: python-google-cloud-access-approval-mock.patch + +BuildArch: noarch + +BuildRequires: python3-devel +BuildRequires: pyproject-rpm-macros + +%if %{with tests} +BuildRequires: python3dist(pytest) +BuildRequires: python3dist(pytest-asyncio) +%endif + +%global _description %{expand: +The Access Approval API is an API for controlling access to data by Google +personnel.} + +%description %{_description} + + +%package -n python3-%{srcname} +Summary: %{summary} + +%description -n python3-%{srcname} %{_description} + + +%package -n python3-%{srcname}-doc +Requires: python3-docs +BuildRequires: python3-docs +BuildRequires: python3dist(recommonmark) +BuildRequires: python3dist(sphinx) +Summary: Documentation for python-%{srcname} + +%description -n python3-%{srcname}-doc +Documentation for python-%{srcname} + + +%prep +%forgeautosetup -p1 + + +%generate_buildrequires +%pyproject_buildrequires -r + + +%build +%pyproject_wheel + +# Generate documentation. +PYTHONPATH="${PWD}:${PWD}/docs/" sphinx-build docs html %{?_smp_mflags} +rm -rf html/.{doctrees,buildinfo} + + +%install +%pyproject_install +%pyproject_save_files google + +# Remove unneeded executable. +rm -f %{buildroot}%{_bindir}/fixup_accessapproval_v1_keywords.py + + +%if %{with tests} +%check +# Work around an usual pytest/PEP 420 issue where pytest can't import the +# installed module. Thanks to mhroncok for the help! +mv google{,_} +%pytest --disable-warnings tests/unit +mv google{_,} +%endif + + + +%files -n python3-%{srcname} -f %{pyproject_files} +%license LICENSE +%doc README.rst CHANGELOG.md +%{python3_sitelib}/google_cloud_access_approval-%{version}-py%{python3_version}-nspkg.pth + + +%files -n python3-%{srcname}-doc +%license LICENSE +%doc html + + +%changelog +%autochangelog diff --git a/sources b/sources new file mode 100644 index 0000000..2db3386 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (python-access-approval-1.3.5.tar.gz) = 94179570f362133833ff6261ad183b5f5744884e7561c52fce5bd3c9a24dd097fa774cfd5e40de1ad9c83e36de07a944a5a6ca9a04216d3136d9a3f6dfa7d6a6