Hello community,
here is the log from the commit of package python-google-cloud-core for
openSUSE:Factory checked in at 2020-04-10 23:53:08
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-google-cloud-core (Old)
and /work/SRC/openSUSE:Factory/.python-google-cloud-core.new.3248 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-cloud-core"
Fri Apr 10 23:53:08 2020 rev:6 rq:792420 version:1.3.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-google-cloud-core/python-google-cloud-core.changes
2019-09-18 13:09:29.644714458 +0200
+++
/work/SRC/openSUSE:Factory/.python-google-cloud-core.new.3248/python-google-cloud-core.changes
2020-04-10 23:53:36.680714569 +0200
@@ -1,0 +2,7 @@
+Wed Apr 8 11:32:28 UTC 2020 - Marketa Calabkova <[email protected]>
+
+- Update to 1.3.0
+ * Add timeout param to JSONConnection.api_request().
+ * Change default api_request() timeout to non-None
+
+-------------------------------------------------------------------
Old:
----
google-cloud-core-1.0.3.tar.gz
New:
----
google-cloud-core-1.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-google-cloud-core.spec ++++++
--- /var/tmp/diff_new_pack.Ra6NTD/_old 2020-04-10 23:53:37.768715367 +0200
+++ /var/tmp/diff_new_pack.Ra6NTD/_new 2020-04-10 23:53:37.772715370 +0200
@@ -1,7 +1,7 @@
#
# spec file for package python-google-cloud-core
#
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -18,14 +18,14 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-google-cloud-core
-Version: 1.0.3
+Version: 1.3.0
Release: 0
Summary: Google Cloud API client core library
License: Apache-2.0
Group: Development/Languages/Python
URL: https://github.com/GoogleCloudPlatform/google-cloud-python
Source:
https://files.pythonhosted.org/packages/source/g/google-cloud-core/google-cloud-core-%{version}.tar.gz
-BuildRequires: %{python_module google-api-core >= 1.14.0}
+BuildRequires: %{python_module google-api-core >= 1.16.0}
BuildRequires: %{python_module grpcio >= 1.8.2}
BuildRequires: %{python_module mock}
BuildRequires: %{python_module pytest}
@@ -33,7 +33,7 @@
BuildRequires: fdupes
BuildRequires: python-futures
BuildRequires: python-rpm-macros
-Requires: python-google-api-core >= 1.14.0
+Requires: python-google-api-core >= 1.16.0
Recommends: python-grpcio >= 1.8.2
BuildArch: noarch
%ifpython2
++++++ google-cloud-core-1.0.3.tar.gz -> google-cloud-core-1.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/PKG-INFO
new/google-cloud-core-1.3.0/PKG-INFO
--- old/google-cloud-core-1.0.3/PKG-INFO 2019-07-29 19:57:23.000000000
+0200
+++ new/google-cloud-core-1.3.0/PKG-INFO 2020-01-31 23:02:20.810099000
+0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: google-cloud-core
-Version: 1.0.3
+Version: 1.3.0
Summary: Google Cloud API client core library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
@@ -9,7 +9,7 @@
Description: Core Helpers for Google Cloud Python Client Library
===================================================
- |pypi| |versions| |compat_check_pypi| |compat_check_github|
+ |pypi| |versions|
This library is not meant to stand-alone. Instead it defines
common helpers (e.g. base ``Client`` classes) used by all of the
@@ -22,10 +22,6 @@
:target: https://pypi.org/project/google-cloud-core/
.. |versions| image::
https://img.shields.io/pypi/pyversions/google-cloud-core.svg
:target: https://pypi.org/project/google-cloud-core/
- .. |compat_check_pypi| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-cloud-core
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-cloud-core
- .. |compat_check_github| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
.. _Documentation:
https://googleapis.dev/python/google-cloud-core/latest
Quick Start
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/README.rst
new/google-cloud-core-1.3.0/README.rst
--- old/google-cloud-core-1.0.3/README.rst 2019-07-29 19:53:56.000000000
+0200
+++ new/google-cloud-core-1.3.0/README.rst 2020-01-31 22:59:39.000000000
+0100
@@ -1,7 +1,7 @@
Core Helpers for Google Cloud Python Client Library
===================================================
-|pypi| |versions| |compat_check_pypi| |compat_check_github|
+|pypi| |versions|
This library is not meant to stand-alone. Instead it defines
common helpers (e.g. base ``Client`` classes) used by all of the
@@ -14,10 +14,6 @@
:target: https://pypi.org/project/google-cloud-core/
.. |versions| image::
https://img.shields.io/pypi/pyversions/google-cloud-core.svg
:target: https://pypi.org/project/google-cloud-core/
-.. |compat_check_pypi| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-cloud-core
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-cloud-core
-.. |compat_check_github| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
.. _Documentation: https://googleapis.dev/python/google-cloud-core/latest
Quick Start
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/google/cloud/_http.py
new/google-cloud-core-1.3.0/google/cloud/_http.py
--- old/google-cloud-core-1.0.3/google/cloud/_http.py 2019-07-29
19:53:56.000000000 +0200
+++ new/google-cloud-core-1.3.0/google/cloud/_http.py 2020-01-31
22:59:39.000000000 +0100
@@ -46,6 +46,8 @@
'extra_headers' instead.
"""
+_DEFAULT_TIMEOUT = 60 # in seconds
+
class Connection(object):
"""A generic connection to Google Cloud Platform.
@@ -222,6 +224,7 @@
content_type=None,
headers=None,
target_object=None,
+ timeout=_DEFAULT_TIMEOUT,
):
"""A low level method to send a request to the API.
@@ -250,6 +253,13 @@
custom behavior, for example, to defer an HTTP request and complete
initialization of the object at a later time.
+ :type timeout: float or tuple
+ :param timeout: (optional) The amount of time, in seconds, to wait
+ for the server response.
+
+ Can also be passed as a tuple (connect_timeout, read_timeout).
+ See :meth:`requests.Session.request` documentation for details.
+
:rtype: :class:`requests.Response`
:returns: The HTTP response.
"""
@@ -263,10 +273,12 @@
headers[CLIENT_INFO_HEADER] = self.user_agent
headers["User-Agent"] = self.user_agent
- return self._do_request(method, url, headers, data, target_object)
+ return self._do_request(
+ method, url, headers, data, target_object, timeout=timeout
+ )
def _do_request(
- self, method, url, headers, data, target_object
+ self, method, url, headers, data, target_object,
timeout=_DEFAULT_TIMEOUT
): # pylint: disable=unused-argument
"""Low-level helper: perform the actual API request over HTTP.
@@ -289,10 +301,19 @@
(Optional) Unused ``target_object`` here but may be used by a
superclass.
+ :type timeout: float or tuple
+ :param timeout: (optional) The amount of time, in seconds, to wait
+ for the server response.
+
+ Can also be passed as a tuple (connect_timeout, read_timeout).
+ See :meth:`requests.Session.request` documentation for details.
+
:rtype: :class:`requests.Response`
:returns: The HTTP response.
"""
- return self.http.request(url=url, method=method, headers=headers,
data=data)
+ return self.http.request(
+ url=url, method=method, headers=headers, data=data, timeout=timeout
+ )
def api_request(
self,
@@ -306,6 +327,7 @@
api_version=None,
expect_json=True,
_target_object=None,
+ timeout=_DEFAULT_TIMEOUT,
):
"""Make a request over the HTTP transport to the API.
@@ -360,6 +382,13 @@
can allow custom behavior, for example, to defer an HTTP request
and complete initialization of the object at a later time.
+ :type timeout: float or tuple
+ :param timeout: (optional) The amount of time, in seconds, to wait
+ for the server response.
+
+ Can also be passed as a tuple (connect_timeout, read_timeout).
+ See :meth:`requests.Session.request` documentation for details.
+
:raises ~google.cloud.exceptions.GoogleCloudError: if the response code
is not 200 OK.
:raises ValueError: if the response content type is not JSON.
@@ -387,6 +416,7 @@
content_type=content_type,
headers=headers,
target_object=_target_object,
+ timeout=timeout,
)
if not 200 <= response.status_code < 300:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/google/cloud/client.py
new/google-cloud-core-1.3.0/google/cloud/client.py
--- old/google-cloud-core-1.0.3/google/cloud/client.py 2019-07-29
19:53:56.000000000 +0200
+++ new/google-cloud-core-1.3.0/google/cloud/client.py 2020-01-31
22:59:39.000000000 +0100
@@ -29,7 +29,7 @@
_GOOGLE_AUTH_CREDENTIALS_HELP = (
"This library only supports credentials from google-auth-library-python. "
- "See https://google-cloud-python.readthedocs.io/en/latest/core/auth.html "
+ "See https://google-auth.readthedocs.io/en/latest/ "
"for help on authentication with this library."
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-cloud-core-1.0.3/google_cloud_core.egg-info/PKG-INFO
new/google-cloud-core-1.3.0/google_cloud_core.egg-info/PKG-INFO
--- old/google-cloud-core-1.0.3/google_cloud_core.egg-info/PKG-INFO
2019-07-29 19:57:23.000000000 +0200
+++ new/google-cloud-core-1.3.0/google_cloud_core.egg-info/PKG-INFO
2020-01-31 23:02:20.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: google-cloud-core
-Version: 1.0.3
+Version: 1.3.0
Summary: Google Cloud API client core library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
@@ -9,7 +9,7 @@
Description: Core Helpers for Google Cloud Python Client Library
===================================================
- |pypi| |versions| |compat_check_pypi| |compat_check_github|
+ |pypi| |versions|
This library is not meant to stand-alone. Instead it defines
common helpers (e.g. base ``Client`` classes) used by all of the
@@ -22,10 +22,6 @@
:target: https://pypi.org/project/google-cloud-core/
.. |versions| image::
https://img.shields.io/pypi/pyversions/google-cloud-core.svg
:target: https://pypi.org/project/google-cloud-core/
- .. |compat_check_pypi| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=google-cloud-core
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=google-cloud-core
- .. |compat_check_github| image::
https://python-compatibility-tools.appspot.com/one_badge_image?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
- :target:
https://python-compatibility-tools.appspot.com/one_badge_target?package=git%2Bgit%3A//github.com/googleapis/google-cloud-python.git%23subdirectory%3Dcore
.. _Documentation:
https://googleapis.dev/python/google-cloud-core/latest
Quick Start
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-cloud-core-1.0.3/google_cloud_core.egg-info/requires.txt
new/google-cloud-core-1.3.0/google_cloud_core.egg-info/requires.txt
--- old/google-cloud-core-1.0.3/google_cloud_core.egg-info/requires.txt
2019-07-29 19:57:23.000000000 +0200
+++ new/google-cloud-core-1.3.0/google_cloud_core.egg-info/requires.txt
2020-01-31 23:02:20.000000000 +0100
@@ -1,4 +1,4 @@
-google-api-core<2.0.0dev,>=1.14.0
+google-api-core<2.0.0dev,>=1.16.0
[grpc]
grpcio<2.0dev,>=1.8.2
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/setup.py
new/google-cloud-core-1.3.0/setup.py
--- old/google-cloud-core-1.0.3/setup.py 2019-07-29 19:53:56.000000000
+0200
+++ new/google-cloud-core-1.3.0/setup.py 2020-01-31 22:59:39.000000000
+0100
@@ -22,13 +22,13 @@
name = "google-cloud-core"
description = "Google Cloud API client core library"
-version = "1.0.3"
+version = "1.3.0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
# 'Development Status :: 5 - Production/Stable'
release_status = "Development Status :: 4 - Beta"
-dependencies = ["google-api-core >= 1.14.0, < 2.0.0dev"]
+dependencies = ["google-api-core >= 1.16.0, < 2.0.0dev"]
extras = {"grpc": "grpcio >= 1.8.2, < 2.0dev"}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-cloud-core-1.0.3/tests/unit/test__http.py
new/google-cloud-core-1.3.0/tests/unit/test__http.py
--- old/google-cloud-core-1.0.3/tests/unit/test__http.py 2019-07-29
19:53:56.000000000 +0200
+++ new/google-cloud-core-1.3.0/tests/unit/test__http.py 2020-01-31
22:59:39.000000000 +0100
@@ -147,6 +147,12 @@
EMPTY_JSON_RESPONSE = make_response(content=b"{}", headers=JSON_HEADERS)
@staticmethod
+ def _get_default_timeout():
+ from google.cloud._http import _DEFAULT_TIMEOUT
+
+ return _DEFAULT_TIMEOUT
+
+ @staticmethod
def _get_target_class():
from google.cloud._http import JSONConnection
@@ -217,7 +223,11 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=url, headers=expected_headers, data=None
+ method="GET",
+ url=url,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
)
def test__make_request_w_data_no_extra_headers(self):
@@ -238,7 +248,11 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=url, headers=expected_headers, data=data
+ method="GET",
+ url=url,
+ headers=expected_headers,
+ data=data,
+ timeout=self._get_default_timeout(),
)
def test__make_request_w_extra_headers(self):
@@ -258,7 +272,34 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=url, headers=expected_headers, data=None
+ method="GET",
+ url=url,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
+ )
+
+ def test__make_request_w_timeout(self):
+ from google.cloud._http import CLIENT_INFO_HEADER
+
+ http = make_requests_session([make_response()])
+ client = mock.Mock(_http=http, spec=["_http"])
+ conn = self._make_one(client)
+
+ url = "http://example.com/test"
+ conn._make_request("GET", url, timeout=(5.5, 2.8))
+
+ expected_headers = {
+ "Accept-Encoding": "gzip",
+ "User-Agent": conn.user_agent,
+ CLIENT_INFO_HEADER: conn.user_agent,
+ }
+ http.request.assert_called_once_with(
+ method="GET",
+ url=url,
+ headers=expected_headers,
+ data=None,
+ timeout=(5.5, 2.8),
)
def test_api_request_defaults(self):
@@ -282,7 +323,11 @@
base=conn.API_BASE_URL, version=conn.API_VERSION, path=path
)
http.request.assert_called_once_with(
- method="GET", url=expected_url, headers=expected_headers, data=None
+ method="GET",
+ url=expected_url,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
)
def test_api_request_w_non_json_response(self):
@@ -321,7 +366,11 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=mock.ANY, headers=expected_headers, data=None
+ method="GET",
+ url=mock.ANY,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
)
url = http.request.call_args[1]["url"]
@@ -351,7 +400,11 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=mock.ANY, headers=expected_headers, data=None
+ method="GET",
+ url=mock.ANY,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
)
def test_api_request_w_extra_headers(self):
@@ -377,7 +430,11 @@
CLIENT_INFO_HEADER: conn.user_agent,
}
http.request.assert_called_once_with(
- method="GET", url=mock.ANY, headers=expected_headers, data=None
+ method="GET",
+ url=mock.ANY,
+ headers=expected_headers,
+ data=None,
+ timeout=self._get_default_timeout(),
)
def test_api_request_w_data(self):
@@ -400,7 +457,39 @@
}
http.request.assert_called_once_with(
- method="POST", url=mock.ANY, headers=expected_headers,
data=expected_data
+ method="POST",
+ url=mock.ANY,
+ headers=expected_headers,
+ data=expected_data,
+ timeout=self._get_default_timeout(),
+ )
+
+ def test_api_request_w_timeout(self):
+ from google.cloud._http import CLIENT_INFO_HEADER
+
+ http = make_requests_session(
+ [make_response(content=b"{}", headers=self.JSON_HEADERS)]
+ )
+ client = mock.Mock(_http=http, spec=["_http"])
+ conn = self._make_mock_one(client)
+ path = "/path/required"
+
+ self.assertEqual(conn.api_request("GET", path, timeout=(2.2, 3.3)), {})
+
+ expected_headers = {
+ "Accept-Encoding": "gzip",
+ "User-Agent": conn.user_agent,
+ CLIENT_INFO_HEADER: conn.user_agent,
+ }
+ expected_url = "{base}/mock/{version}{path}".format(
+ base=conn.API_BASE_URL, version=conn.API_VERSION, path=path
+ )
+ http.request.assert_called_once_with(
+ method="GET",
+ url=expected_url,
+ headers=expected_headers,
+ data=None,
+ timeout=(2.2, 3.3),
)
def test_api_request_w_404(self):