Blame python-google-cloud-private-ca.spec

d0afa6e
# tests are enabled by default
d0afa6e
%bcond_without tests
d0afa6e
d0afa6e
%global         srcname     google-cloud-private-ca
d0afa6e
%global         forgeurl    https://github.com/googleapis/python-security-private-ca
3b12248
Version:        1.3.1
d0afa6e
%global         tag         v%{version}
d0afa6e
%forgemeta
d0afa6e
d0afa6e
Name:           python-%{srcname}
d0afa6e
Release:        %autorelease
d0afa6e
Summary:        Python Client for Google Cloud Certificate Authority Service
d0afa6e
d0afa6e
License:        ASL 2.0
d0afa6e
URL:            %forgeurl
d0afa6e
Source0:        %forgesource
3b12248
# Opened a PR upstream to import unittest.mock if available.
3b12248
# https://github.com/googleapis/python-security-private-ca/pull/232
3b12248
Patch0:         https://github.com/googleapis/python-security-private-ca/pull/232.patch
d0afa6e
d0afa6e
BuildArch:      noarch
d0afa6e
1bae621
BuildRequires:  python3-devel
d0afa6e
d0afa6e
%if %{with tests}
d0afa6e
BuildRequires:  python3dist(pytest)
d0afa6e
BuildRequires:  python3dist(pytest-asyncio)
d0afa6e
%endif
d0afa6e
d0afa6e
%global _description %{expand:
d0afa6e
Python Client for Google Cloud Certificate Authority Service}
d0afa6e
d0afa6e
%description %{_description}
d0afa6e
d0afa6e
d0afa6e
%package -n python3-%{srcname}
d0afa6e
Summary:        %{summary}
d0afa6e
d0afa6e
%description -n python3-%{srcname} %{_description}
d0afa6e
d0afa6e
d0afa6e
%prep
d0afa6e
%forgeautosetup -p1
d0afa6e
d0afa6e
d0afa6e
%generate_buildrequires
d0afa6e
%pyproject_buildrequires -r
d0afa6e
d0afa6e
d0afa6e
%build
d0afa6e
%pyproject_wheel
d0afa6e
d0afa6e
d0afa6e
%install
d0afa6e
%pyproject_install
d0afa6e
%pyproject_save_files google
d0afa6e
d0afa6e
# Remove unneeded directories and files from the final package.
d0afa6e
rm -f %{buildroot}%{_bindir}/fixup_privateca_v1beta1_keywords.py
8f88cf0
rm -rf %{buildroot}%{python3_sitelib}/{docs,samples,scripts,tests}
d0afa6e
d0afa6e
d0afa6e
%if %{with tests}
d0afa6e
%check
d0afa6e
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
d0afa6e
# installed module. Thanks to mhroncok for the help!
d0afa6e
mv google{,_}
d0afa6e
%pytest --disable-warnings tests/unit
d0afa6e
mv google{_,}
d0afa6e
%endif
d0afa6e
d0afa6e
d0afa6e
%files -n python3-%{srcname} -f %{pyproject_files}
d0afa6e
%license LICENSE
1bae621
%doc README.rst CHANGELOG.md samples
d0afa6e
%{python3_sitelib}/google_cloud_private_ca-%{version}-py%{python3_version}-nspkg.pth
d0afa6e
d0afa6e
d0afa6e
d0afa6e
%changelog
d0afa6e
%autochangelog