Blame python-google-cloud-container.spec

6a98b69
# tests are enabled by default
6a98b69
%bcond_without tests
6a98b69
6a98b69
%global         srcname     google-cloud-container
6a98b69
%global         forgeurl    https://github.com/googleapis/python-container
6602166
Version:        2.10.7
6a98b69
%global         tag         v%{version}
6a98b69
%forgemeta
6a98b69
6a98b69
Name:           python-%{srcname}
6a98b69
Release:        %autorelease
6a98b69
Summary:        Python Client for Google Cloud Kubernetes Engine API
6a98b69
6a98b69
License:        ASL 2.0
6a98b69
URL:            %forgeurl
6a98b69
Source0:        %forgesource
6a98b69
Patch0:         python-google-cloud-container-mock.patch
6a98b69
6a98b69
BuildArch:      noarch
6a98b69
c9e0b5a
BuildRequires:  python3-devel
6a98b69
6a98b69
%if %{with tests}
6a98b69
BuildRequires:  python3dist(pytest)
6a98b69
BuildRequires:  python3dist(pytest-asyncio)
6a98b69
%endif
6a98b69
6a98b69
%global _description %{expand:
6a98b69
Python Client for Google Cloud Kubernetes Engine API}
6a98b69
6a98b69
%description %{_description}
6a98b69
6a98b69
6a98b69
%package -n python3-%{srcname}
6a98b69
Summary:        %{summary}
6a98b69
6a98b69
%description -n python3-%{srcname} %{_description}
6a98b69
6a98b69
6a98b69
%prep
6a98b69
%forgeautosetup -p1
6a98b69
6a98b69
6a98b69
%generate_buildrequires
6a98b69
%pyproject_buildrequires -r
6a98b69
6a98b69
6a98b69
%build
6a98b69
%pyproject_wheel
6a98b69
6a98b69
6a98b69
%install
6a98b69
%pyproject_install
6a98b69
%pyproject_save_files google
6a98b69
6a98b69
# Remove unneeded scripts.
9a3a180
rm -f %{buildroot}%{_bindir}/fixup_container_v1_keywords.py \
9a3a180
    %{buildroot}%{_bindir}/fixup_container_v1beta1_keywords.py
6a98b69
6a98b69
6a98b69
%if %{with tests}
6a98b69
%check
6a98b69
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
6a98b69
# installed module. Thanks to mhroncok for the help!
6a98b69
mv google{,_}
6a98b69
%pytest --disable-warnings tests/unit
6a98b69
mv google{_,}
6a98b69
%endif
6a98b69
6a98b69
6a98b69
%files -n python3-%{srcname} -f %{pyproject_files}
6a98b69
%license LICENSE
6a98b69
%doc README.rst CHANGELOG.md
6a98b69
%{python3_sitelib}/google_cloud_container-%{version}-py%{python3_version}-nspkg.pth
6a98b69
6a98b69
6a98b69
%changelog
6a98b69
%autochangelog