diff --git a/.python-google-api-core.metadata b/.python-google-api-core.metadata index a24bc82..cbc09d7 100644 --- a/.python-google-api-core.metadata +++ b/.python-google-api-core.metadata @@ -1 +1 @@ -45b028a5bfec5451b3d3e762ac9dad467f987f3b SOURCES/google-api-core-1.17.0.tar.gz +07f7e5a6f4f15edd330263509aafca51e2e808fa SOURCES/python-api-core-2.0.1.tar.gz diff --git a/SOURCES/use-unittest-mock-builtin.patch b/SOURCES/use-unittest-mock-builtin.patch new file mode 100644 index 0000000..968a0dd --- /dev/null +++ b/SOURCES/use-unittest-mock-builtin.patch @@ -0,0 +1,216 @@ +diff -up ./tests/asyncio/future/test_async_future.py.orig ./tests/asyncio/future/test_async_future.py +--- ./tests/asyncio/future/test_async_future.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/future/test_async_future.py 2021-08-23 07:05:20.264433127 -0500 +@@ -14,7 +14,7 @@ + + import asyncio + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/asyncio/gapic/test_method_async.py.orig ./tests/asyncio/gapic/test_method_async.py +--- ./tests/asyncio/gapic/test_method_async.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/gapic/test_method_async.py 2021-08-23 07:05:20.265433119 -0500 +@@ -15,7 +15,7 @@ + import datetime + + from grpc import aio +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/asyncio/operations_v1/test_operations_async_client.py.orig ./tests/asyncio/operations_v1/test_operations_async_client.py +--- ./tests/asyncio/operations_v1/test_operations_async_client.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/operations_v1/test_operations_async_client.py 2021-08-23 07:05:20.265433119 -0500 +@@ -13,7 +13,7 @@ + # limitations under the License. + + from grpc import aio +-import mock ++from unittest import mock + import pytest + + from google.api_core import grpc_helpers_async, operations_v1, page_iterator_async +diff -up ./tests/asyncio/test_grpc_helpers_async.py.orig ./tests/asyncio/test_grpc_helpers_async.py +--- ./tests/asyncio/test_grpc_helpers_async.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/test_grpc_helpers_async.py 2021-08-23 07:05:20.265433119 -0500 +@@ -14,7 +14,7 @@ + + import grpc + from grpc import aio +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/asyncio/test_operation_async.py.orig ./tests/asyncio/test_operation_async.py +--- ./tests/asyncio/test_operation_async.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/test_operation_async.py 2021-08-23 07:05:20.266433111 -0500 +@@ -13,7 +13,7 @@ + # limitations under the License. + + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/asyncio/test_page_iterator_async.py.orig ./tests/asyncio/test_page_iterator_async.py +--- ./tests/asyncio/test_page_iterator_async.py.orig 2021-08-23 07:02:16.988893673 -0500 ++++ ./tests/asyncio/test_page_iterator_async.py 2021-08-23 07:05:20.266433111 -0500 +@@ -14,7 +14,7 @@ + + import inspect + +-import mock ++from unittest import mock + import pytest + + from google.api_core import page_iterator_async +diff -up ./tests/asyncio/test_retry_async.py.orig ./tests/asyncio/test_retry_async.py +--- ./tests/asyncio/test_retry_async.py.orig 2021-08-23 07:02:16.989893665 -0500 ++++ ./tests/asyncio/test_retry_async.py 2021-08-23 07:05:20.267433103 -0500 +@@ -15,7 +15,7 @@ + import datetime + import re + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/unit/future/test__helpers.py.orig ./tests/unit/future/test__helpers.py +--- ./tests/unit/future/test__helpers.py.orig 2021-08-23 07:02:16.989893665 -0500 ++++ ./tests/unit/future/test__helpers.py 2021-08-23 07:05:20.267433103 -0500 +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import mock ++from unittest import mock + + from google.api_core.future import _helpers + +diff -up ./tests/unit/future/test_polling.py.orig ./tests/unit/future/test_polling.py +--- ./tests/unit/future/test_polling.py.orig 2021-08-23 07:02:16.989893665 -0500 ++++ ./tests/unit/future/test_polling.py 2021-08-23 07:05:20.268433095 -0500 +@@ -16,7 +16,7 @@ import concurrent.futures + import threading + import time + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions, retry +diff -up ./tests/unit/gapic/test_method.py.orig ./tests/unit/gapic/test_method.py +--- ./tests/unit/gapic/test_method.py.orig 2021-08-23 07:02:16.989893665 -0500 ++++ ./tests/unit/gapic/test_method.py 2021-08-23 07:05:20.268433095 -0500 +@@ -14,7 +14,7 @@ + + import datetime + +-import mock ++from unittest import mock + + from google.api_core import exceptions + from google.api_core import retry +diff -up ./tests/unit/test_bidi.py.orig ./tests/unit/test_bidi.py +--- ./tests/unit/test_bidi.py.orig 2021-08-23 07:02:16.989893665 -0500 ++++ ./tests/unit/test_bidi.py 2021-08-23 07:05:20.269433087 -0500 +@@ -18,7 +18,7 @@ import queue + import threading + + import grpc +-import mock ++from unittest import mock + import pytest + + from google.api_core import bidi +diff -up ./tests/unit/test_exceptions.py.orig ./tests/unit/test_exceptions.py +--- ./tests/unit/test_exceptions.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_exceptions.py 2021-08-23 07:05:20.269433087 -0500 +@@ -16,7 +16,7 @@ import http.client + import json + + import grpc +-import mock ++from unittest import mock + import requests + + from google.api_core import exceptions +diff -up ./tests/unit/test_grpc_helpers.py.orig ./tests/unit/test_grpc_helpers.py +--- ./tests/unit/test_grpc_helpers.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_grpc_helpers.py 2021-08-23 07:05:20.270433079 -0500 +@@ -13,7 +13,7 @@ + # limitations under the License. + + import grpc +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff -up ./tests/unit/test_operation.py.orig ./tests/unit/test_operation.py +--- ./tests/unit/test_operation.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_operation.py 2021-08-23 07:05:20.270433079 -0500 +@@ -13,7 +13,7 @@ + # limitations under the License. + + +-import mock ++from unittest import mock + + from google.api_core import exceptions + from google.api_core import operation +diff -up ./tests/unit/test_page_iterator.py.orig ./tests/unit/test_page_iterator.py +--- ./tests/unit/test_page_iterator.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_page_iterator.py 2021-08-23 07:05:20.271433071 -0500 +@@ -15,7 +15,7 @@ + import math + import types + +-import mock ++from unittest import mock + import pytest + + from google.api_core import page_iterator +diff -up ./tests/unit/test_path_template.py.orig ./tests/unit/test_path_template.py +--- ./tests/unit/test_path_template.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_path_template.py 2021-08-23 07:05:20.271433071 -0500 +@@ -14,7 +14,7 @@ + + from __future__ import unicode_literals + +-import mock ++from unittest import mock + import pytest + + from google.api_core import path_template +diff -up ./tests/unit/test_retry.py.orig ./tests/unit/test_retry.py +--- ./tests/unit/test_retry.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_retry.py 2021-08-23 07:05:20.272433063 -0500 +@@ -16,7 +16,7 @@ import datetime + import itertools + import re + +-import mock ++from unittest import mock + import pytest + import requests.exceptions + +diff -up ./tests/unit/test_timeout.py.orig ./tests/unit/test_timeout.py +--- ./tests/unit/test_timeout.py.orig 2021-08-23 07:02:16.990893657 -0500 ++++ ./tests/unit/test_timeout.py 2021-08-23 07:05:20.273433055 -0500 +@@ -15,7 +15,7 @@ + import datetime + import itertools + +-import mock ++from unittest import mock + + from google.api_core import timeout + diff --git a/SPECS/python-google-api-core.spec b/SPECS/python-google-api-core.spec index e2d045e..80b8786 100644 --- a/SPECS/python-google-api-core.spec +++ b/SPECS/python-google-api-core.spec @@ -1,30 +1,50 @@ -%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.} +## START: Set by rpmautospec +## (rpmautospec version 0.2.5) +%define autorelease(e:s:pb:) %{?-p:0.}%{lua: + release_number = 3; + base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); + print(release_number + base_release_number - 1); +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} +## END: Set by rpmautospec + +%bcond_with tests + +%global srcname google-api-core +%global forgeurl https://github.com/googleapis/python-api-core +Version: 2.0.1 +%global tag v%{version} +%forgemeta Name: python-%{srcname} -Version: 1.17.0 -Release: 3%{?dist} +Release: %autorelease Summary: Core Library for Google Client Libraries License: ASL 2.0 -URL: https://github.com/googleapis/python-api-core/ -Source0: %{url}/archive/v%{version}/%{srcname}-%{version}.tar.gz +URL: %forgeurl +Source0: %{url}/archive/%{tag}.tar.gz#/python-api-core-%{version}.tar.gz +Patch0: use-unittest-mock-builtin.patch + +BuildRequires: pyproject-rpm-macros BuildRequires: python3-devel -BuildRequires: %{py3_dist setuptools} -# Required for tests -BuildRequires: %{py3_dist google-auth} -BuildRequires: %{py3_dist googleapis-common-protos} -BuildRequires: %{py3_dist grpcio} -BuildRequires: %{py3_dist mock} -BuildRequires: %{py3_dist protobuf} -BuildRequires: %{py3_dist pytest} -BuildRequires: %{py3_dist pytz} -BuildRequires: %{py3_dist requests} -BuildRequires: %{py3_dist six} + +%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) +%endif BuildArch: noarch +%global _description %{expand:This library is not meant to stand-alone. +Instead it defines common helpers used by all Google API clients.} + %description %{_description} @@ -34,48 +54,115 @@ Summary: %{summary} # Extras Requires: %{py3_dist grpcio} Requires: %{py3_dist grpcio-gcp} -%{?python_provide:%python_provide python3-%{srcname}} %description -n python3-%{srcname} %{_description} +%pyproject_extras_subpkg -n python3-%{srcname} grpc +%pyproject_extras_subpkg -n python3-%{srcname} grpcgcp +%pyproject_extras_subpkg -n python3-%{srcname} grpcio-gcp %prep -%autosetup -n python-api-core-%{version} +%forgesetup +%patch0 -p0 + -# Remove bundled egg-info -rm -rf *.egg-info +%generate_buildrequires +%pyproject_buildrequires -r %build -%py3_build +%pyproject_wheel %install -%py3_install +%pyproject_install +%pyproject_save_files google %check -# Python is unable to find google.api_core modules in Rawhide (with or without -# PYTHONPATH set). Tests are temporarily disabled -# PYTHONPATH=$RPM_BUILD_ROOT%%{python3_sitelib}/ pytest-%%{python3_version} -v +%if %{with tests} +# Work around an usual pytest/PEP 420 issue where pytest can't import the +# installed module. Thanks to mhroncok for the help! +mv google{,_} +%pytest --disable-warnings tests/unit +mv google{_,} +%endif -%files -n python3-%{srcname} -%doc CHANGELOG.md README.rst +%files -n python3-%{srcname} -f %{pyproject_files} +%doc README.rst CHANGELOG.md SECURITY.md %license LICENSE -%{python3_sitelib}/google/api_core/ -%{python3_sitelib}/google_api_core-*.egg-info/ -%{python3_sitelib}/google_api_core-*-nspkg.pth +%{python3_sitelib}/google_api_core-%{version}-py%{python3_version}-nspkg.pth %changelog -* Wed Jan 27 2021 Fedora Release Engineering - 1.17.0-3 +* Fri Sep 17 2021 Major Hayden 2.0.1-3 +- Fix tests with PEP 420 workaround + +* Thu Sep 09 2021 Major Hayden 2.0.1-2 +- Move to rpmautospec + +* Wed Sep 01 2021 Major Hayden 2.0.1-1 +- Update to 2.0.1 + +* Mon Aug 23 2021 Major Hayden 2.0.0-2 +- Add proto-plus dependency for tests + +* Mon Aug 23 2021 Major Hayden 2.0.0-1 +- Update to 2.0.0 + +* Tue Jul 27 2021 Major Hayden 1.31.1-2 +- Use correct path for extracted sources + +* Tue Jul 27 2021 Major Hayden 1.31.1-1 +- Update to 1.31.1 + +* Fri Jul 23 2021 Fedora Release Engineering 1.31.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Thu Jul 15 2021 Major Hayden 1.31.0-2 +- Add grpc, grpcgcp, and grpcio-gcp extras packages + +* Fri Jul 09 2021 Major Hayden 1.31.0-1 +- Update to 1.31.0 + +* Tue Jun 15 2021 Major Hayden 1.30.0-3 +- Get the right sources this time + +* Tue Jun 15 2021 Major Hayden 1.30.0-2 +- Include patch in new sources + +* Tue Jun 15 2021 Major Hayden 1.30.0-1 +- Update to v1.3.0 + +* Fri Jun 04 2021 Python Maint 1.29.0-2 +- Rebuilt for Python 3.10 + +* Thu Jun 03 2021 Mohamed El Morabity 1.29.0-1 +- Update to 1.29.0 + +* Wed Jan 27 2021 Fedora Release Engineering 1.17.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild -* Mon Aug 17 2020 Mohamed El Morabity - 1.17.0-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild +* Mon Aug 17 2020 Mohamed El Morabity 1.17.0-2 - Temporarily disable tests -* Fri Jun 05 2020 Mohamed El Morabity - 1.17.0-1 -- Initial RPM release +* Thu Aug 13 2020 Mohamed El Morabity 1.17.0-1 +- Rebuild + +* Sat Aug 01 2020 Fedora Release Engineering 1.21.0-3 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jul 29 2020 Fedora Release Engineering 1.21.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Fri Jun 19 2020 Mohamed El Morabity 1.21.0-1 +- Update to 1.21.0 + +* Fri Jun 05 2020 Mohamed El Morabity 1.17.0-1 +- Revert to 1.17.0 until grpc is updated + +* Fri Jun 05 2020 Mohamed El Morabity 1.19.0-1 +- First import