diff --git a/.gitignore b/.gitignore index faacac8..317c09b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /python-api-core-1.30.0.tar.gz /google-api-core-1.31.0.tar.gz /google-api-core-1.31.1.tar.gz +/python-api-core-2.0.0.tar.gz diff --git a/python-google-api-core.spec b/python-google-api-core.spec index 496165c..5b81d31 100644 --- a/python-google-api-core.spec +++ b/python-google-api-core.spec @@ -1,30 +1,34 @@ +%bcond_without tests + %global srcname google-api-core -%global _with_tests 1 +%global forgeurl https://github.com/googleapis/python-api-core +Version: 2.0.0 +%global tag v%{version} +%forgemeta Name: python-%{srcname} -Version: 1.31.1 Release: 1%{?dist} Summary: Core Library for Google Client Libraries License: ASL 2.0 -URL: https://pypi.org/project/%{srcname}/ -Source0: %pypi_source +URL: %forgeurl +Source0: %forgesource Patch0: use-unittest-mock-builtin.patch BuildRequires: pyproject-rpm-macros BuildRequires: python3-devel -%if 0%{?_with_tests} -BuildRequires: %{py3_dist google-auth} -BuildRequires: %{py3_dist googleapis-common-protos} -BuildRequires: %{py3_dist grpcio} -BuildRequires: %{py3_dist grpcio-gcp} -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(pytest) +BuildRequires: python3dist(pytz) +BuildRequires: python3dist(requests) +BuildRequires: python3dist(six) %endif BuildArch: noarch @@ -49,7 +53,8 @@ Requires: %{py3_dist grpcio-gcp} %pyproject_extras_subpkg -n python3-%{srcname} grpcio-gcp %prep -%autosetup -p0 -n python-api-core-%{version} +%forgesetup +%patch0 -p0 %generate_buildrequires @@ -70,8 +75,12 @@ Requires: %{py3_dist grpcio-gcp} # method called importlib that seems to work. # More details here: https://docs.pytest.org/en/6.2.x/pythonpath.html %check -%if 0%{?_with_tests} -%pytest --import-mode importlib tests/unit +%if %{with tests} +# Skipping two tests here which require proto-plus that is not packaged in +# Fedora. +%pytest --import-mode importlib \ + -k "not test_field_mask_ignore_trailing_underscore and not test_field_mask_ignore_trailing_underscore_with_nesting" \ + tests/unit %endif @@ -82,6 +91,10 @@ Requires: %{py3_dist grpcio-gcp} %changelog +* Mon Aug 23 2021 Major Hayden - 2.0.0-1 +- Update to 2.0.0 +- Use github for upstream source + * Tue Jul 27 2021 Major Hayden - 1.31.1-1 - Update to 1.31.1 diff --git a/sources b/sources index 866b736..8c1e987 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (google-api-core-1.31.1.tar.gz) = 29c84b98ae39416dbcb8ba7412237007bddea6e9a3af07c1f7753bfe57576125325a6412b73ab7d58c57257405b4b6aa36e043d0cf2496517828c7594f6698ef +SHA512 (python-api-core-2.0.0.tar.gz) = 588dcdeb80c4cd53ebc9d1a76efc03bc3bff22aa850d48385edc0bc6a0d343b406d26e64d22c0befc06f6406bb6c8efcf07947c6e48c49e6f077b72b8414403f diff --git a/use-unittest-mock-builtin.patch b/use-unittest-mock-builtin.patch index bb28637..968a0dd 100644 --- a/use-unittest-mock-builtin.patch +++ b/use-unittest-mock-builtin.patch @@ -1,215 +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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/future/test_async_future.py 2021-07-09 14:49:34.127828651 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/gapic/test_method_async.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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.experimental import aio + + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/operations_v1/test_operations_async_client.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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.experimental import aio + + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/test_grpc_helpers_async.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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.experimental import aio + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/test_operation_async.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/test_page_iterator_async.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/asyncio/test_retry_async.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/future/test__helpers.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/future/test_polling.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/gapic/test_method.py 2021-07-09 14:49:34.126828657 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_bidi.py 2021-07-09 14:49:34.126828657 -0500 -@@ -17,7 +17,7 @@ import logging +--- ./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 six.moves import queue - + + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_exceptions.py 2021-07-09 14:49:34.125828664 -0500 -@@ -15,7 +15,7 @@ +--- ./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 six.moves import http_client - + + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_grpc_helpers.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_operation.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_page_iterator.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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 - import six - + + 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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_path_template.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_retry.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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-07-09 13:05:42.000000000 -0500 -+++ ./tests/unit/test_timeout.py 2021-07-09 14:49:34.125828664 -0500 +--- ./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 +