diff --git a/packages/p/python-google-cloud-storage/.files b/packages/p/python-google-cloud-storage/.files index 0e3585a3d1e..d45be0f5da2 100644 Binary files a/packages/p/python-google-cloud-storage/.files and b/packages/p/python-google-cloud-storage/.files differ diff --git a/packages/p/python-google-cloud-storage/.rev b/packages/p/python-google-cloud-storage/.rev index 04802e4270f..c646a03e90b 100644 --- a/packages/p/python-google-cloud-storage/.rev +++ b/packages/p/python-google-cloud-storage/.rev @@ -162,4 +162,23 @@ * This is just a simple PR to better describe what the code (forwarded request 969826 from glaubitz) 969851 + + 3f5eec2b0145c3d035cb5004400d9ce1 + 2.3.0 + + dimstar_suse + REQUIRES https://build.opensuse.org/request/show/970437 + +- Update to 2.3.0: + - add dual region bucket support and sample + - track invocation id for retry metrics + - deps: drop pkg_resources + - fix links in blob module +- Add patches: + - no-relative-imports.patch to allow running the test suite + with pytest (gh#googleapis/python-storage#772) + - demock.patch to remove dependency on the external package + mock (gh#googleapis/python-storage#770) + 970440 + diff --git a/packages/p/python-google-cloud-storage/demock.patch b/packages/p/python-google-cloud-storage/demock.patch new file mode 100644 index 00000000000..0698cc5c12d --- /dev/null +++ b/packages/p/python-google-cloud-storage/demock.patch @@ -0,0 +1,194 @@ +--- + tests/system/test_blob.py | 2 +- + tests/unit/test__helpers.py | 5 +---- + tests/unit/test__http.py | 3 +-- + tests/unit/test__signing.py | 2 +- + tests/unit/test_acl.py | 3 +-- + tests/unit/test_batch.py | 2 +- + tests/unit/test_blob.py | 2 +- + tests/unit/test_bucket.py | 2 +- + tests/unit/test_client.py | 4 ++-- + tests/unit/test_fileio.py | 2 +- + tests/unit/test_hmac_key.py | 3 +-- + tests/unit/test_notification.py | 3 +-- + tests/unit/test_retry.py | 3 +-- + 13 files changed, 14 insertions(+), 22 deletions(-) + +--- a/tests/system/test_blob.py ++++ b/tests/system/test_blob.py +@@ -18,9 +18,9 @@ import io + import os + import tempfile + import warnings ++from unittest import mock + + import pytest +-import mock + + from google import resumable_media + from google.api_core import exceptions +--- a/tests/unit/test__helpers.py ++++ b/tests/unit/test__helpers.py +@@ -13,8 +13,7 @@ + # limitations under the License. + + import unittest +- +-import mock ++from unittest import mock + + from google.cloud.storage.retry import DEFAULT_RETRY + from google.cloud.storage.retry import DEFAULT_RETRY_IF_METAGENERATION_SPECIFIED +@@ -556,8 +555,6 @@ class Test__base64_md5hash(unittest.Test + self.assertEqual(SIGNED_CONTENT, b"kBiQqOnIz21aGlQrIp/r/w==") + + def test_it_with_stubs(self): +- import mock +- + class _Buffer(object): + def __init__(self, return_vals): + self.return_vals = return_vals +--- a/tests/unit/test__http.py ++++ b/tests/unit/test__http.py +@@ -16,8 +16,7 @@ import os.path + import sys + import unittest + from unittest.mock import patch +- +-import mock ++from unittest import mock + + from google.cloud.storage import _helpers + sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..', '..'))) +--- a/tests/unit/test__signing.py ++++ b/tests/unit/test__signing.py +@@ -24,8 +24,8 @@ import sys + import time + import unittest + import urllib.parse ++from unittest import mock + +-import mock + import pytest + + sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..'))) +--- a/tests/unit/test_acl.py ++++ b/tests/unit/test_acl.py +@@ -13,8 +13,7 @@ + # limitations under the License. + + import unittest +- +-import mock ++from unittest import mock + + from google.cloud.storage.retry import ( + DEFAULT_RETRY, +--- a/tests/unit/test_batch.py ++++ b/tests/unit/test_batch.py +@@ -16,8 +16,8 @@ import http.client + from http.client import SERVICE_UNAVAILABLE + from http.client import NO_CONTENT + import unittest ++from unittest import mock + +-import mock + import requests + + +--- a/tests/unit/test_blob.py ++++ b/tests/unit/test_blob.py +@@ -23,9 +23,9 @@ import tempfile + import unittest + import http.client + from unittest.mock import patch ++from unittest import mock + from urllib.parse import urlencode + +-import mock + import pytest + + from google.cloud.storage import _helpers +--- a/tests/unit/test_bucket.py ++++ b/tests/unit/test_bucket.py +@@ -14,8 +14,8 @@ + + import datetime + import unittest ++from unittest import mock + +-import mock + import pytest + + from google.cloud.storage.retry import DEFAULT_RETRY +--- a/tests/unit/test_client.py ++++ b/tests/unit/test_client.py +@@ -16,8 +16,6 @@ import base64 + import http.client + import io + import json +-from unittest.mock import patch +-import mock + import os.path + import pytest + import re +@@ -25,6 +23,8 @@ import requests + import sys + import unittest + import urllib ++from unittest.mock import patch ++from unittest import mock + + from google.api_core import exceptions + from google.auth.credentials import AnonymousCredentials +--- a/tests/unit/test_fileio.py ++++ b/tests/unit/test_fileio.py +@@ -17,8 +17,8 @@ + import unittest + import io + import string ++from unittest import mock + +-import mock + + from google.api_core.exceptions import RequestRangeNotSatisfiable + from google.cloud.storage.retry import DEFAULT_RETRY +--- a/tests/unit/test_hmac_key.py ++++ b/tests/unit/test_hmac_key.py +@@ -13,8 +13,7 @@ + # limitations under the License. + + import unittest +- +-import mock ++from unittest import mock + + from google.cloud.storage.retry import DEFAULT_RETRY + from google.cloud.storage.retry import DEFAULT_RETRY_IF_ETAG_IN_JSON +--- a/tests/unit/test_notification.py ++++ b/tests/unit/test_notification.py +@@ -13,8 +13,7 @@ + # limitations under the License. + + import unittest +- +-import mock ++from unittest import mock + + from google.cloud.storage.retry import DEFAULT_RETRY + +--- a/tests/unit/test_retry.py ++++ b/tests/unit/test_retry.py +@@ -13,11 +13,10 @@ + # limitations under the License. + + import unittest ++from unittest import mock + + from google.cloud.storage import _helpers + +-import mock +- + + class Test_should_retry(unittest.TestCase): + def _call_fut(self, exc): diff --git a/packages/p/python-google-cloud-storage/google-cloud-storage-2.2.1.tar.gz b/packages/p/python-google-cloud-storage/google-cloud-storage-2.2.1.tar.gz deleted file mode 120000 index 9b21ac3a940..00000000000 --- a/packages/p/python-google-cloud-storage/google-cloud-storage-2.2.1.tar.gz +++ /dev/null @@ -1 +0,0 @@ -/ipfs/bafybeif6yjizpgdwbe64ymuzx7jzvysrpt6aknpcvhm7m64yncycit5mf4 \ No newline at end of file diff --git a/packages/p/python-google-cloud-storage/google-cloud-storage-2.3.0.tar.gz b/packages/p/python-google-cloud-storage/google-cloud-storage-2.3.0.tar.gz new file mode 120000 index 00000000000..4abe111ebc0 --- /dev/null +++ b/packages/p/python-google-cloud-storage/google-cloud-storage-2.3.0.tar.gz @@ -0,0 +1 @@ +/ipfs/bafybeihxiwnob4374h37olbby4ofpt2tof6qtzixukikwqro62zss5mao4 \ No newline at end of file diff --git a/packages/p/python-google-cloud-storage/no-relative-imports.patch b/packages/p/python-google-cloud-storage/no-relative-imports.patch index 30dffe3319b..65bbfd547db 100644 --- a/packages/p/python-google-cloud-storage/no-relative-imports.patch +++ b/packages/p/python-google-cloud-storage/no-relative-imports.patch @@ -1,32 +1,31 @@ -diff -Nru google-cloud-storage-2.2.1.orig/tests/unit/test_client.py google-cloud-storage-2.2.1/tests/unit/test_client.py ---- google-cloud-storage-2.2.1.orig/tests/unit/test_client.py 2022-03-15 20:58:01.000000000 +0100 -+++ google-cloud-storage-2.2.1/tests/unit/test_client.py 2022-04-13 11:48:44.913965418 +0200 -@@ -17,9 +17,11 @@ - import io - import json - import mock +--- + tests/unit/test__http.py | 3 +++ + tests/unit/test__signing.py | 5 ++++- + tests/unit/test_blob.py | 2 ++ + tests/unit/test_client.py | 5 ++++- + 4 files changed, 13 insertions(+), 2 deletions(-) + +--- a/tests/unit/test__http.py ++++ b/tests/unit/test__http.py +@@ -12,12 +12,15 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + +import os.path - import pytest - import re - import requests +import sys import unittest - import urllib + from unittest.mock import patch -@@ -32,7 +34,8 @@ - from google.cloud.storage.retry import DEFAULT_RETRY - from google.cloud.storage.retry import DEFAULT_RETRY_IF_GENERATION_SPECIFIED + import mock --from . import _read_local_json -+sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..'))) -+from unit import _read_local_json + from google.cloud.storage import _helpers ++sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..', '..'))) + from tests.unit.test__helpers import GCCL_INVOCATION_TEST_CONST - _SERVICE_ACCOUNT_JSON = _read_local_json("url_signer_v4_test_account.json") - _CONFORMANCE_TESTS = _read_local_json("url_signer_v4_test_data.json")[ -diff -Nru google-cloud-storage-2.2.1.orig/tests/unit/test__signing.py google-cloud-storage-2.2.1/tests/unit/test__signing.py ---- google-cloud-storage-2.2.1.orig/tests/unit/test__signing.py 2022-03-15 20:58:01.000000000 +0100 -+++ google-cloud-storage-2.2.1/tests/unit/test__signing.py 2022-04-13 11:47:30.200372762 +0200 -@@ -19,6 +19,8 @@ + +--- a/tests/unit/test__signing.py ++++ b/tests/unit/test__signing.py +@@ -19,6 +19,8 @@ import binascii import calendar import datetime import json @@ -35,7 +34,7 @@ diff -Nru google-cloud-storage-2.2.1.orig/tests/unit/test__signing.py google-clo import time import unittest import urllib.parse -@@ -26,7 +28,8 @@ +@@ -26,7 +28,8 @@ import urllib.parse import mock import pytest @@ -45,3 +44,46 @@ diff -Nru google-cloud-storage-2.2.1.orig/tests/unit/test__signing.py google-clo _SERVICE_ACCOUNT_JSON = _read_local_json("url_signer_v4_test_account.json") +--- a/tests/unit/test_blob.py ++++ b/tests/unit/test_blob.py +@@ -18,6 +18,7 @@ import hashlib + import io + import json + import os ++import sys + import tempfile + import unittest + import http.client +@@ -35,6 +36,7 @@ from google.cloud.storage.retry import ( + ) + from google.cloud.storage.retry import DEFAULT_RETRY_IF_ETAG_IN_JSON + from google.cloud.storage.retry import DEFAULT_RETRY_IF_GENERATION_SPECIFIED ++sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..', '..'))) + from tests.unit.test__helpers import GCCL_INVOCATION_TEST_CONST + + +--- a/tests/unit/test_client.py ++++ b/tests/unit/test_client.py +@@ -18,9 +18,11 @@ import io + import json + from unittest.mock import patch + import mock ++import os.path + import pytest + import re + import requests ++import sys + import unittest + import urllib + +@@ -33,8 +35,9 @@ from google.cloud.storage._helpers impor + from google.cloud.storage import _helpers + from google.cloud.storage.retry import DEFAULT_RETRY + from google.cloud.storage.retry import DEFAULT_RETRY_IF_GENERATION_SPECIFIED ++sys.path.insert(0, os.path.abspath(os.path.join(__file__, '..', '..', '..'))) + from tests.unit.test__helpers import GCCL_INVOCATION_TEST_CONST +-from . import _read_local_json ++from tests.unit import _read_local_json + + _SERVICE_ACCOUNT_JSON = _read_local_json("url_signer_v4_test_account.json") + _CONFORMANCE_TESTS = _read_local_json("url_signer_v4_test_data.json")[ diff --git a/packages/p/python-google-cloud-storage/python-google-cloud-storage.changes b/packages/p/python-google-cloud-storage/python-google-cloud-storage.changes index e649701b0ad..c27df0f7122 100644 --- a/packages/p/python-google-cloud-storage/python-google-cloud-storage.changes +++ b/packages/p/python-google-cloud-storage/python-google-cloud-storage.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Fri Apr 15 08:55:20 UTC 2022 - Matej Cepl + +- Update to 2.3.0: + - add dual region bucket support and sample + - track invocation id for retry metrics + - deps: drop pkg_resources + - fix links in blob module +- Add patches: + - no-relative-imports.patch to allow running the test suite + with pytest (gh#googleapis/python-storage#772) + - demock.patch to remove dependency on the external package + mock (gh#googleapis/python-storage#770) + ------------------------------------------------------------------- Wed Apr 13 10:13:58 UTC 2022 - John Paul Adrian Glaubitz diff --git a/packages/p/python-google-cloud-storage/python-google-cloud-storage.spec b/packages/p/python-google-cloud-storage/python-google-cloud-storage.spec index d914a65d7da..a5333625ae0 100644 --- a/packages/p/python-google-cloud-storage/python-google-cloud-storage.spec +++ b/packages/p/python-google-cloud-storage/python-google-cloud-storage.spec @@ -20,20 +20,22 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-google-cloud-storage -Version: 2.2.1 +Version: 2.3.0 Release: 0 Summary: Google Cloud Storage API python client library License: Apache-2.0 URL: https://github.com/googleapis/python-storage Source: https://files.pythonhosted.org/packages/source/g/google-cloud-storage/google-cloud-storage-%{version}.tar.gz -# PATCH-FIX-UPSTREAM no-relative-imports.patch bsc#[0-9]+ mcepl@suse.com +# PATCH-FIX-UPSTREAM no-relative-imports.patch gh#googleapis/python-storage#772 mcepl@suse.com # fix relative imports -Patch2: no-relative-imports.patch +Patch0: no-relative-imports.patch +# PATCH-FIX-UPSTREAM demock.patch gh#googleapis/python-storage#770 mcepl@suse.com +# Don’t use external mock package +Patch1: demock.patch BuildRequires: %{python_module google-api-core >= 1.31.5} BuildRequires: %{python_module google-auth >= 1.25.0} -BuildRequires: %{python_module google-cloud-core >= 1.6.0} +BuildRequires: %{python_module google-cloud-core >= 2.3.0} BuildRequires: %{python_module google-resumable-media >= 2.3.2} -BuildRequires: %{python_module mock >= 3.0.0} BuildRequires: %{python_module packaging} BuildRequires: %{python_module pip} BuildRequires: %{python_module pytest} @@ -69,7 +71,7 @@ to users via direct download. This package provides client to it. %check export PYTEST_ADDOPTS="--import-mode=importlib" -%pytest tests/unit -k 'not network' +%pytest -k 'not network' tests/unit %files %{python_files} %license LICENSE