From 30209c662f162e287f0fcc55dad7f95374af29e2 Mon Sep 17 00:00:00 2001 From: eabdullin Date: Thu, 10 Jul 2025 15:30:42 +0300 Subject: [PATCH] Downgrade to 2.2.2 --- .gitignore | 2 +- .python-google-api-core.metadata | 2 +- SOURCES/use-unittest-mock-builtin.patch | 264 ++++++++++++++++++++++++ SPECS/python-google-api-core.spec | 236 +++++---------------- 4 files changed, 313 insertions(+), 191 deletions(-) create mode 100644 SOURCES/use-unittest-mock-builtin.patch diff --git a/.gitignore b/.gitignore index a9ce3d8..477d319 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/python-api-core-2.11.1.tar.gz +SOURCES/python-api-core-2.2.2.tar.gz diff --git a/.python-google-api-core.metadata b/.python-google-api-core.metadata index 7afb518..dfc1400 100644 --- a/.python-google-api-core.metadata +++ b/.python-google-api-core.metadata @@ -1 +1 @@ -4de83f11afd88505e0e51d79f85bb3accab4065a SOURCES/python-api-core-2.11.1.tar.gz +40e366d4305a802ba086d3cb6daaa11794256f4e SOURCES/python-api-core-2.2.2.tar.gz diff --git a/SOURCES/use-unittest-mock-builtin.patch b/SOURCES/use-unittest-mock-builtin.patch new file mode 100644 index 0000000..3519c3e --- /dev/null +++ b/SOURCES/use-unittest-mock-builtin.patch @@ -0,0 +1,264 @@ +From 7d007f7286d4dcb061845e291795fc5781011d3f Mon Sep 17 00:00:00 2001 +From: Major Hayden +Date: Tue, 26 Oct 2021 12:36:27 -0500 +Subject: [PATCH] Use unittest.mock + +Signed-off-by: Major Hayden +--- + tests/asyncio/future/test_async_future.py | 2 +- + tests/asyncio/gapic/test_method_async.py | 2 +- + tests/asyncio/operations_v1/test_operations_async_client.py | 2 +- + tests/asyncio/test_grpc_helpers_async.py | 2 +- + tests/asyncio/test_operation_async.py | 2 +- + tests/asyncio/test_page_iterator_async.py | 2 +- + tests/asyncio/test_retry_async.py | 2 +- + tests/unit/future/test__helpers.py | 2 +- + tests/unit/future/test_polling.py | 2 +- + tests/unit/gapic/test_method.py | 2 +- + tests/unit/test_bidi.py | 2 +- + tests/unit/test_exceptions.py | 2 +- + tests/unit/test_grpc_helpers.py | 2 +- + tests/unit/test_operation.py | 2 +- + tests/unit/test_page_iterator.py | 2 +- + tests/unit/test_path_template.py | 2 +- + tests/unit/test_retry.py | 2 +- + tests/unit/test_timeout.py | 2 +- + 18 files changed, 18 insertions(+), 18 deletions(-) + +diff --git a/tests/asyncio/future/test_async_future.py b/tests/asyncio/future/test_async_future.py +index 1e9ae33..1aaf132 100644 +--- a/tests/asyncio/future/test_async_future.py ++++ b/tests/asyncio/future/test_async_future.py +@@ -14,7 +14,7 @@ + + import asyncio + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff --git a/tests/asyncio/gapic/test_method_async.py b/tests/asyncio/gapic/test_method_async.py +index 1410747..7990e46 100644 +--- a/tests/asyncio/gapic/test_method_async.py ++++ b/tests/asyncio/gapic/test_method_async.py +@@ -14,7 +14,7 @@ + + import datetime + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/asyncio/operations_v1/test_operations_async_client.py b/tests/asyncio/operations_v1/test_operations_async_client.py +index 47c3b4b..67fc941 100644 +--- a/tests/asyncio/operations_v1/test_operations_async_client.py ++++ b/tests/asyncio/operations_v1/test_operations_async_client.py +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/asyncio/test_grpc_helpers_async.py b/tests/asyncio/test_grpc_helpers_async.py +index 3681a40..cc1a5a4 100644 +--- a/tests/asyncio/test_grpc_helpers_async.py ++++ b/tests/asyncio/test_grpc_helpers_async.py +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import mock ++from unittest import mock + import pytest # noqa: I202 + + try: +diff --git a/tests/asyncio/test_operation_async.py b/tests/asyncio/test_operation_async.py +index 886b1c8..68e6919 100644 +--- a/tests/asyncio/test_operation_async.py ++++ b/tests/asyncio/test_operation_async.py +@@ -13,7 +13,7 @@ + # limitations under the License. + + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/asyncio/test_page_iterator_async.py b/tests/asyncio/test_page_iterator_async.py +index 75f9e1c..c3f5d55 100644 +--- a/tests/asyncio/test_page_iterator_async.py ++++ b/tests/asyncio/test_page_iterator_async.py +@@ -14,7 +14,7 @@ + + import inspect + +-import mock ++from unittest import mock + import pytest + + from google.api_core import page_iterator_async +diff --git a/tests/asyncio/test_retry_async.py b/tests/asyncio/test_retry_async.py +index 9e51044..27309cb 100644 +--- a/tests/asyncio/test_retry_async.py ++++ b/tests/asyncio/test_retry_async.py +@@ -15,7 +15,7 @@ + import datetime + import re + +-import mock ++from unittest import mock + import pytest + + from google.api_core import exceptions +diff --git a/tests/unit/future/test__helpers.py b/tests/unit/future/test__helpers.py +index 98afc59..a37efdd 100644 +--- a/tests/unit/future/test__helpers.py ++++ b/tests/unit/future/test__helpers.py +@@ -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 --git a/tests/unit/future/test_polling.py b/tests/unit/future/test_polling.py +index 2381d03..79f19db 100644 +--- a/tests/unit/future/test_polling.py ++++ b/tests/unit/future/test_polling.py +@@ -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 --git a/tests/unit/gapic/test_method.py b/tests/unit/gapic/test_method.py +index 9778d23..28323da 100644 +--- a/tests/unit/gapic/test_method.py ++++ b/tests/unit/gapic/test_method.py +@@ -14,7 +14,7 @@ + + import datetime + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/unit/test_bidi.py b/tests/unit/test_bidi.py +index 7fb1620..896f653 100644 +--- a/tests/unit/test_bidi.py ++++ b/tests/unit/test_bidi.py +@@ -17,7 +17,7 @@ import logging + import queue + import threading + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/unit/test_exceptions.py b/tests/unit/test_exceptions.py +index f6345fe..fb94097 100644 +--- a/tests/unit/test_exceptions.py ++++ b/tests/unit/test_exceptions.py +@@ -15,7 +15,7 @@ + import http.client + import json + +-import mock ++from unittest import mock + import pytest + import requests + +diff --git a/tests/unit/test_grpc_helpers.py b/tests/unit/test_grpc_helpers.py +index ca969e4..95b1a24 100644 +--- a/tests/unit/test_grpc_helpers.py ++++ b/tests/unit/test_grpc_helpers.py +@@ -12,7 +12,7 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/unit/test_operation.py b/tests/unit/test_operation.py +index bafff8b..68418cd 100644 +--- a/tests/unit/test_operation.py ++++ b/tests/unit/test_operation.py +@@ -13,7 +13,7 @@ + # limitations under the License. + + +-import mock ++from unittest import mock + import pytest + + try: +diff --git a/tests/unit/test_page_iterator.py b/tests/unit/test_page_iterator.py +index a44e998..56be26f 100644 +--- a/tests/unit/test_page_iterator.py ++++ b/tests/unit/test_page_iterator.py +@@ -15,7 +15,7 @@ + import math + import types + +-import mock ++from unittest import mock + import pytest + + from google.api_core import page_iterator +diff --git a/tests/unit/test_path_template.py b/tests/unit/test_path_template.py +index 2c5216e..a72f25f 100644 +--- a/tests/unit/test_path_template.py ++++ b/tests/unit/test_path_template.py +@@ -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 --git a/tests/unit/test_retry.py b/tests/unit/test_retry.py +index 199ca55..db985e5 100644 +--- a/tests/unit/test_retry.py ++++ b/tests/unit/test_retry.py +@@ -16,7 +16,7 @@ import datetime + import itertools + import re + +-import mock ++from unittest import mock + import pytest + import requests.exceptions + +diff --git a/tests/unit/test_timeout.py b/tests/unit/test_timeout.py +index 30d624e..c13e499 100644 +--- a/tests/unit/test_timeout.py ++++ b/tests/unit/test_timeout.py +@@ -15,7 +15,7 @@ + import datetime + import itertools + +-import mock ++from unittest import mock + + from google.api_core import timeout + +-- +2.31.1 + diff --git a/SPECS/python-google-api-core.spec b/SPECS/python-google-api-core.spec index 84459b2..f5ee123 100644 --- a/SPECS/python-google-api-core.spec +++ b/SPECS/python-google-api-core.spec @@ -1,19 +1,17 @@ ## START: Set by rpmautospec -## (rpmautospec version 0.7.3) -## RPMAUTOSPEC: autorelease, autochangelog -%define autorelease(e:s:pb:n) %{?-p:0.}%{lua: - release_number = 11; +## (rpmautospec version 0.2.5) +%define autorelease(e:s:pb:) %{?-p:0.}%{lua: + release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); -}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} +}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{?dist} ## END: Set by rpmautospec -# Enable tests by default. %bcond_without tests %global srcname google-api-core %global forgeurl https://github.com/googleapis/python-api-core -Version: 2.11.1 +Version: 2.2.2 %global tag v%{version} %forgemeta @@ -21,14 +19,14 @@ Name: python-%{srcname} Release: %autorelease Summary: Core Library for Google Client Libraries -License: Apache-2.0 +License: ASL 2.0 URL: %forgeurl Source0: %forgesource +Patch0: use-unittest-mock-builtin.patch + BuildRequires: python3-devel -Epoch: 1 - %if %{with tests} BuildRequires: python3dist(google-auth) BuildRequires: python3dist(googleapis-common-protos) @@ -41,7 +39,6 @@ BuildRequires: python3dist(pytz) BuildRequires: python3dist(requests) BuildRequires: python3dist(six) %endif - BuildArch: noarch %global _description %{expand:This library is not meant to stand-alone. @@ -54,32 +51,22 @@ 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) +Requires: %{py3_dist grpcio} +Requires: %{py3_dist grpcio-gcp} %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 %forgeautosetup -p1 -# Allow a slightly older protobuf. -sed -i 's/"protobuf.*",/"protobuf>=3.19.4",/' setup.py - -# Allow a slightly older version of grpcio. -# NOTE(mhayden): All of the tests pass fine with 1.48.3 -# which is in rawhide/f38 as of 2023-02-20. -sed -i 's/1.49.1/1.48.3/g' setup.py - -# Replace mock imports with unittest.mock. -grep -rl "^[[:space:]]*import mock" tests | \ - xargs sed -i -E 's/^([[:space:]]*)import mock/\1from unittest import mock/' %generate_buildrequires -%pyproject_buildrequires -x testing +%pyproject_buildrequires -r %build @@ -93,14 +80,16 @@ grep -rl "^[[:space:]]*import mock" tests | \ %check %if %{with tests} -# Work around an unusual pytest/PEP 420 issue where pytest can't import the +# 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 tests/unit \ +%pytest --disable-warnings 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" + and not test_wrap_stream_errors_during_iteration \ + and not test_exception_with_error_code \ + and not Test_StreamingResponseIterator" mv google{_,} %endif @@ -111,221 +100,90 @@ mv google{_,} %changelog -## START: Generated by rpmautospec -* Sat Jan 18 2025 Fedora Release Engineering - 1:2.11.1-11 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jul 19 2024 Fedora Release Engineering - 1:2.11.1-10 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Sat Jun 08 2024 Python Maint - 1:2.11.1-9 -- Rebuilt for Python 3.13 - -* Sat Jun 08 2024 Python Maint - 1:2.11.1-8 -- Bootstrap for Python 3.13 - -* Fri Jan 26 2024 Fedora Release Engineering - 1:2.11.1-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Jan 22 2024 Fedora Release Engineering - 1:2.11.1-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jul 21 2023 Fedora Release Engineering - 1:2.11.1-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Thu Jul 06 2023 Major Hayden - 1:2.11.1-4 -- Bump revision number - -* Sat Jun 17 2023 Python Maint - 1:2.11.1-3 -- Rebuilt for Python 3.12 - -* Fri Jun 16 2023 Major Hayden - 1:2.11.1-2 -- Bump revision number - -* Fri Jun 16 2023 Major Hayden - 1:2.11.1-1 -- Update to 2.11.1 rhbz#2215121 - -* Thu Jun 15 2023 Python Maint - 1:2.11.0-3 -- Bootstrap for Python 3.12 - -* Wed Feb 22 2023 Major Hayden - 1:2.11.0-2 -- Set SPDX license - -* Tue Feb 21 2023 Major Hayden - 1:2.11.0-1 -- Update to 2.11.0 - -* Fri Jan 20 2023 Fedora Release Engineering - 1:2.10.2-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Thu Dec 08 2022 Major Hayden - 1:2.10.2-2 -- Bump revision number after adjusting epoch - -* Thu Dec 08 2022 Major Hayden - 1:2.10.2-1 -- Bump epoch number to downgrade - -* Thu Dec 08 2022 Major Hayden - 2.10.2-1 -- Revert "Update to 2.11.0 rhbz#2150012" - -* Wed Dec 07 2022 Major Hayden - 2.11.0-1 -- Update to 2.11.0 rhbz#2150012 - -* Mon Nov 14 2022 Major Hayden - 2.10.2-1 -- Update to 2.10.2 rhbz#2123558 - -* Fri Jul 22 2022 Fedora Release Engineering - 2.8.2-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Tue Jun 28 2022 Python Maint - 2.8.2-3 -- Rebuilt for Python 3.11 - -* Thu Jun 16 2022 Python Maint - 2.8.2-2 -- Bootstrap for Python 3.11 - -* Wed Jun 15 2022 Major Hayden - 2.8.2-1 -- Update to 2.8.2 - -* Wed Jun 15 2022 Python Maint - 2.8.1-2 -- Bootstrap for Python 3.11 - -* Fri May 27 2022 Major Hayden - 2.8.1-1 -- Update to 2.8.1 - -* Thu May 19 2022 Major Hayden - 2.8.0-1 -- 🚀 Update to 2.8.0 - -* Mon May 02 2022 Major Hayden - 2.7.3-1 -- Update to 2.7.3 - -* Wed Apr 13 2022 Major Hayden - 2.7.2-1 -- Update to 2.7.2 - -* Thu Mar 10 2022 Major Hayden - 2.7.1-1 -- Update to 2.7.1 - -* Wed Mar 09 2022 Major Hayden - 2.7.0-1 -- Update to 2.7.0 - -* Tue Mar 08 2022 Major Hayden - 2.6.1-1 -- Update to 2.6.1 - -* Fri Mar 04 2022 Major Hayden - 2.6.0-1 -- Update to 2.6.0 - -* Fri Feb 04 2022 Major Hayden - 2.5.0-1 -- Update to 2.5.0 - -* Fri Jan 21 2022 Fedora Release Engineering - 2.4.0-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Thu Jan 13 2022 Major Hayden - 2.4.0-4 -- Restore other skipped tests - -* Thu Jan 13 2022 Major Hayden - 2.4.0-3 -- Skip broken tests in rest streaming - -* Thu Jan 13 2022 Major Hayden - 2.4.0-2 -- Run all tests - -* Wed Jan 12 2022 Major Hayden - 2.4.0-1 -- Update to 2.4.0 - -* Thu Dec 16 2021 Major Hayden - 2.3.2-1 -- Update to 2.3.2 - -* Wed Dec 15 2021 Major Hayden - 2.3.1-1 -- Update to 2.3.1 - -* Wed Dec 08 2021 Major Hayden - 2.3.0-1 -- Update to 2.3.0 - -* Wed Nov 03 2021 Major Hayden - 2.2.2-1 +* Wed Nov 03 2021 Major Hayden 2.2.2-1 - Update to 2.2.2 -* Thu Oct 28 2021 Major Hayden - 2.2.1-1 +* Thu Oct 28 2021 Major Hayden 2.2.1-1 - Update to 2.2.1 -* Tue Oct 26 2021 Major Hayden - 2.2.0-1 +* Tue Oct 26 2021 Major Hayden 2.2.0-1 - Update to 2.2.0 -* Mon Oct 25 2021 Major Hayden - 2.1.1-2 +* Mon Oct 25 2021 Major Hayden 2.1.1-2 - Use python3-devel as BuildRequires -* Thu Oct 14 2021 Major Hayden - 2.1.1-1 +* Thu Oct 14 2021 Major Hayden 2.1.1-1 - Update to 2.1.0 -* Wed Oct 06 2021 Major Hayden - 2.1.0-1 +* Wed Oct 06 2021 Major Hayden 2.1.0-1 - Update to 2.1.0 -* Fri Sep 17 2021 Major Hayden - 2.0.1-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 +* Thu Sep 09 2021 Major Hayden 2.0.1-2 - Move to rpmautospec -* Wed Sep 01 2021 Major Hayden - 2.0.1-1 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* 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 +* Mon Aug 17 2020 Mohamed El Morabity 1.17.0-2 - Temporarily disable tests -* Thu Aug 13 2020 Mohamed El Morabity - 1.17.0-1 +* Thu Aug 13 2020 Mohamed El Morabity 1.17.0-1 - Rebuild -* Sat Aug 01 2020 Fedora Release Engineering - 1.21.0-3 +* 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 +* 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 +* 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-2 -- Update sources file - -* Fri Jun 05 2020 Mohamed El Morabity - 1.17.0-1 +* 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 +* Fri Jun 05 2020 Mohamed El Morabity 1.19.0-1 - First import -## END: Generated by rpmautospec