Blob Blame History Raw
%global         srcname         google-api-core
%global         _description    %{expand:This library is not meant to stand-alone.
Instead it defines common helpers used by all Google API clients.}

%global         forgeurl        https://github.com/googleapis/python-api-core/
Version:        1.30.0
%global         tag             v%{version}
%global         distprefix      %{nil}
%forgemeta

# tests are enabled by default
%bcond_without  tests

Name:           python-%{srcname}
Release:        1%{?dist}
Summary:        Core Library for Google Client Libraries
License:        ASL 2.0
URL:            %forgeurl
Source0:        %forgesource
# NOTE(mhayden): Upstream still uses the mock module but I submitted a PR to use
# the built-in unittest.mock instead.
Patch0:         https://github.com/googleapis/python-api-core/pull/208.patch

BuildRequires:  pyproject-rpm-macros
BuildRequires:  python3-devel

BuildArch:      noarch

%if %{with tests}
BuildRequires:  python3-google-api-client
BuildRequires:  python3-google-auth
BuildRequires:  python3-googleapis-common-protos
BuildRequires:  python3-grpcio
BuildRequires:  python3-grpcio-gcp
BuildRequires:  python3-protobuf
BuildRequires:  python3-pytest
BuildRequires:  python3-pytz
BuildRequires:  python3-requests
BuildRequires:  python3-six
%endif


%description
%{_description}


%package -n python3-%{srcname}
Summary:        %{summary}
# Extras
Requires:       %{py3_dist grpcio}
Requires:       %{py3_dist grpcio-gcp}
%{?python_provide:%python_provide python3-%{srcname}}

%description -n python3-%{srcname}
%{_description}


%prep
%autosetup -p1 -n python-api-core-%{version}


%build
%pyproject_wheel


%generate_buildrequires
%pyproject_buildrequires -r


%install
%pyproject_install
%pyproject_save_files google


%if %{with tests}
%check
%pytest -k "not test_next" tests/unit
%endif


%files -n python3-%{srcname} -f %{pyproject_files}
%doc CHANGELOG.md README.rst
%license LICENSE
%{python3_sitelib}/google_api_core-%{version}-py%{python3_version}-nspkg.pth


%changelog
* Tue Jun 15 2021 Major Hayden <major@mhtx.net> - 1.30.0-1
- Update version to 1.30.0.

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

* Thu Jun 03 2021 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.29.0-1
- Update to 1.29.0

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

* Mon Aug 17 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.17.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
- Temporarily disable tests

* Fri Jun 05 2020 Mohamed El Morabity <melmorabity@fedoraproject.org> - 1.17.0-1
- Initial RPM release