0277cbb
# F35: Do not update past 2.8.0 because Fedora 35's protobuf is too old.
0277cbb
0277cbb
# Enable tests by default.
f2d870d
%bcond_without  tests
f2d870d
07851d4
%global         srcname         google-api-core
f2d870d
%global         forgeurl        https://github.com/googleapis/python-api-core
0277cbb
Version:        2.8.2
f2d870d
%global         tag             v%{version}
f2d870d
%forgemeta
fbdbe80
2b0c17f
Name:           python-%{srcname}
9a13fee
Release:        %autorelease
2b0c17f
Summary:        Core Library for Google Client Libraries
9ca0c3d
2b0c17f
License:        ASL 2.0
f2d870d
URL:            %forgeurl
f2d870d
Source0:        %forgesource
c592082
Patch0:         use-unittest-mock-builtin.patch
2b0c17f
32b50fd
BuildRequires:  python3-devel
94d8659
e8a5993
f2d870d
%if %{with tests}
f2d870d
BuildRequires:  python3dist(google-auth)
f2d870d
BuildRequires:  python3dist(googleapis-common-protos)
f2d870d
BuildRequires:  python3dist(grpcio)
f2d870d
BuildRequires:  python3dist(grpcio-gcp)
f2d870d
BuildRequires:  python3dist(protobuf)
eb87a1c
BuildRequires:  python3dist(proto-plus)
f2d870d
BuildRequires:  python3dist(pytest)
f2d870d
BuildRequires:  python3dist(pytz)
f2d870d
BuildRequires:  python3dist(requests)
f2d870d
BuildRequires:  python3dist(six)
07851d4
%endif
4fbeab8
9ca0c3d
BuildArch:      noarch
07851d4
9ca0c3d
%global _description %{expand:This library is not meant to stand-alone.
9ca0c3d
Instead it defines common helpers used by all Google API clients.}
07851d4
2b0c17f
%description
2b0c17f
%{_description}
2b0c17f
2b0c17f
2b0c17f
%package -n python3-%{srcname}
2b0c17f
Summary:        %{summary}
2b0c17f
# Extras
0277cbb
Requires:       python3dist(grpcio)
0277cbb
Requires:       python3dist(grpcio-status)
2b0c17f
2b0c17f
%description -n python3-%{srcname}
2b0c17f
%{_description}
2b0c17f
94d8659
%pyproject_extras_subpkg -n python3-%{srcname} grpc
0277cbb
2b0c17f
2b0c17f
%prep
4d8f763
%forgeautosetup -p1
07851d4
07851d4
07851d4
%generate_buildrequires
0277cbb
%pyproject_buildrequires
2b0c17f
2b0c17f
9ca0c3d
%build
9ca0c3d
%pyproject_wheel
9ca0c3d
9ca0c3d
2b0c17f
%install
07851d4
%pyproject_install
07851d4
%pyproject_save_files google
2b0c17f
2b0c17f
2b0c17f
%check
f2d870d
%if %{with tests}
703141d
# Work around an unusual pytest/PEP 420 issue where pytest can't import the
4628462
# installed module. Thanks to mhroncok for the help!
4628462
mv google{,_}
0277cbb
%pytest tests/unit \
e0197cd
    -k "not test_wrap_unary_errors \
e0197cd
        and not test_wrap_stream_errors_invocation \
e0197cd
        and not test_wrap_stream_errors_iterator_initialization \
703141d
        and not test_wrap_stream_errors_during_iteration"
4628462
mv google{_,}
fbdbe80
%endif
2b0c17f
2b0c17f
07851d4
%files -n python3-%{srcname} -f %{pyproject_files}
9a13fee
%doc README.rst CHANGELOG.md SECURITY.md
07851d4
%{python3_sitelib}/google_api_core-%{version}-py%{python3_version}-nspkg.pth
2b0c17f
ef3ce37
688e4ec
%changelog
9a13fee
%autochangelog