Blob Blame History Raw
%bcond tests 1

# When bootstrapping, we do not include the “grpc” extra in the BR’s. That adds
# a BR on python3dist(grpcio), but this package is required by
# python3dist(grpcio-status), which creates a circular dependency with grpc.
%bcond_without bootstrap

Name:           python-googleapis-common-protos
Version:        1.63.0
Release:        9%{?dist}
Summary:        Common protobufs used in Google APIs

License:        Apache-2.0
URL:            https://github.com/googleapis/python-api-common-protos
Source:         %{url}/archive/v%{version}/python-api-common-protos-%{version}.tar.gz

# fix: increase upper limit for protobuf 5.X versions
# https://github.com/googleapis/python-api-common-protos/pull/212
Patch:          %{url}/pull/212.patch

BuildArch:      noarch

BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  python3dist(pytest)
%endif

%global common_description %{expand:
%{summary}.}

%description %{common_description}


%package -n python3-googleapis-common-protos
Summary:        %{summary}

%description -n python3-googleapis-common-protos %{common_description}


%pyproject_extras_subpkg -n python3-googleapis-common-protos grpc


%prep
%autosetup -n python-api-common-protos-%{version} -p1


%generate_buildrequires
%pyproject_buildrequires %{?!with_bootstrap:-x grpc}


%build
%pyproject_wheel


%install
%pyproject_install
%pyproject_save_files -l google


%check
%if %{with tests}
# NOTE(mhayden): Setting PYTHONUSERBASE as a hack for PEP 420 namespaces.
# Thanks to churchyard for the fix.
PYTHONUSERBASE=%{buildroot}%{_prefix} \
    %pytest tests/unit
%endif


%files -n python3-googleapis-common-protos -f %{pyproject_files}
%doc CHANGELOG.md
%doc README.rst


%changelog
* Wed Feb 05 2025 Joel Capitao <jcapitao@redhat.com> - 1.63.0-9
- Enable bootstrap flag

* Sat Jan 18 2025 Fedora Release Engineering <releng@fedoraproject.org> - 1.63.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild

* Mon Sep 09 2024 Jonathan Wright <jonathan@almalinux.org> - 1.63.0-7
- update bootstrap macro

* Thu Jul 08 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.53.0-4
- Drop version conditional; maintain the existing practice of cherry-picking
  updates to stable branches rather than merging

* Thu Jul 08 2021 Benjamin A. Beasley <code@musicinmybrain.net> - 1.53.0-3
- Tweak how the description macro is written
- Drop obsolete python_provide macro
- Switch to pyproject-rpm-macros
- Add the metapackage for the “grpc” extra
- Add a check section that “smoke-tests” imports

* Fri Jun 04 2021 Python Maint <python-maint@redhat.com> - 1.53.0-2
- Rebuilt for Python 3.10

* Sun Mar 21 2021 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.53.0-1
- Update to 1.53.0

* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.52.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 1.52.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild

* Thu Jun 18 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.52.0-1
- Update to 1.52.0

* Sun May 31 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.51.0-2
- Rebuild for Python 3.9

* Fri May 29 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.51.0-1
- Initial RPM release