Blob Blame History Raw
# F35: Do not update past 2.8.0 because Fedora 35's protobuf is too old.

# Enable tests by default.
%bcond_without  tests

%global         srcname         google-api-core
%global         forgeurl
Version:        2.8.2
%global         tag             v%{version}

Name:           python-%{srcname}
Release:        %autorelease
Summary:        Core Library for Google Client Libraries

License:        ASL 2.0
URL:            %forgeurl
Source0:        %forgesource
Patch0:         use-unittest-mock-builtin.patch

BuildRequires:  python3-devel

%if %{with tests}
BuildRequires:  python3dist(google-auth)
BuildRequires:  python3dist(googleapis-common-protos)
BuildRequires:  python3dist(grpcio)
BuildRequires:  python3dist(grpcio-gcp)
BuildRequires:  python3dist(protobuf)
BuildRequires:  python3dist(proto-plus)
BuildRequires:  python3dist(pytest)
BuildRequires:  python3dist(pytz)
BuildRequires:  python3dist(requests)
BuildRequires:  python3dist(six)

BuildArch:      noarch

%global _description %{expand:This library is not meant to stand-alone.
Instead it defines common helpers used by all Google API clients.}


%package -n python3-%{srcname}
Summary:        %{summary}
# Extras
Requires:       python3dist(grpcio)
Requires:       python3dist(grpcio-status)

%description -n python3-%{srcname}

%pyproject_extras_subpkg -n python3-%{srcname} grpc

%forgeautosetup -p1



%pyproject_save_files google

%if %{with tests}
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
# installed module. Thanks to mhroncok for the help!
mv google{,_}
%pytest tests/unit \
    -k "not test_wrap_unary_errors \
        and not test_wrap_stream_errors_invocation \
        and not test_wrap_stream_errors_iterator_initialization \
        and not test_wrap_stream_errors_during_iteration"
mv google{_,}

%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst