Blame python-google-cloud-kms.spec

e2241e5
# tests are enabled by default
e2241e5
%bcond_without tests
e2241e5
e2241e5
%global         srcname     google-cloud-kms
e2241e5
%global         forgeurl    https://github.com/googleapis/python-kms
99b2865
Version:        2.11.1
e2241e5
%global         tag         v%{version}
e2241e5
%forgemeta
e2241e5
e2241e5
Name:           python-%{srcname}
6563f8e
Release:        %autorelease
e2241e5
Summary:        Python Client for Google Cloud Key Management Service (KMS) API
e2241e5
e2241e5
License:        ASL 2.0
e2241e5
URL:            %forgeurl
e2241e5
Source0:        %forgesource
e2241e5
# Fix mock > unittest.mock. Made PRs to upstream and they are aware but not
e2241e5
# accepting patches for this right now.
e2241e5
Patch0:         python-google-cloud-kms-mock-fix.patch
e2241e5
e2241e5
BuildArch:      noarch
e2241e5
e2241e5
BuildRequires:  python3-devel
e2241e5
54dc8b0
# NOTE(mhayden): Upstream dropped a requirement on setuptools, so these two are required.
54dc8b0
BuildRequires:  pyproject-rpm-macros
54dc8b0
BuildRequires:  python3-setuptools
54dc8b0
e2241e5
%if %{with tests}
e2241e5
BuildRequires:  python3dist(cryptography)
e2241e5
BuildRequires:  python3dist(pem)
e2241e5
BuildRequires:  python3dist(pytest)
e2241e5
BuildRequires:  python3dist(pytest-asyncio)
e2241e5
%endif
e2241e5
e2241e5
%global _description %{expand:
e2241e5
Manages keys and performs cryptographic operations in a central cloud service,
e2241e5
for direct use by other cloud resources and applications via the Google
e2241e5
Cloud Key Management Service (KMS) API.}
e2241e5
e2241e5
%description %{_description}
e2241e5
e2241e5
e2241e5
%package -n python3-%{srcname}
e2241e5
Summary:        %{summary}
e2241e5
%description -n python3-%{srcname} %{_description}
e2241e5
e2241e5
e2241e5
%prep
bd0a251
%forgeautosetup -p1
e2241e5
e2241e5
e2241e5
%generate_buildrequires
e2241e5
%pyproject_buildrequires -r
e2241e5
e2241e5
e2241e5
%build
e2241e5
%pyproject_wheel
e2241e5
e2241e5
e2241e5
%install
e2241e5
%pyproject_install
e2241e5
%pyproject_save_files google
e2241e5
e2241e5
# Remove unneeded executable.
e2241e5
rm -f %{buildroot}/%{_bindir}/fixup_kms_v1_keywords.py
e2241e5
e2241e5
e2241e5
%if %{with tests}
e2241e5
%check
c123a4d
# Work around an usual pytest/PEP 420 issue where pytest can't import the
c123a4d
# installed module. Thanks to mhroncok for the help!
c123a4d
mv google{,_}
c123a4d
%pytest --disable-warnings --ignore=samples tests/unit
c123a4d
mv google{_,}
e2241e5
%endif
e2241e5
e2241e5
e2241e5
%files -n python3-%{srcname} -f %{pyproject_files}
e2241e5
%license LICENSE
e2241e5
%doc README.rst CHANGELOG.md
e2241e5
%{python3_sitelib}/google_cloud_kms-%{version}-py%{python3_version}-nspkg.pth
e2241e5
e2241e5
e2241e5
%changelog
6563f8e
%autochangelog