Hello community,
here is the log from the commit of package python-google-api-core for
openSUSE:Factory checked in at 2019-05-16 22:10:39
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-google-api-core (Old)
and /work/SRC/openSUSE:Factory/.python-google-api-core.new.5148 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-google-api-core"
Thu May 16 22:10:39 2019 rev:8 rq:703515 version:1.11.0
Changes:
--------
---
/work/SRC/openSUSE:Factory/python-google-api-core/python-google-api-core.changes
2019-03-28 22:48:31.291056536 +0100
+++
/work/SRC/openSUSE:Factory/.python-google-api-core.new.5148/python-google-api-core.changes
2019-05-16 22:11:14.610220864 +0200
@@ -1,0 +2,6 @@
+Thu May 16 17:48:16 UTC 2019 - [email protected]
+
+- Update to 1.11.0:
+ * Refactor ‘client_info’ support. (#7849)
+
+-------------------------------------------------------------------
Old:
----
google-api-core-1.8.2.tar.gz
New:
----
google-api-core-1.11.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-google-api-core.spec ++++++
--- /var/tmp/diff_new_pack.MgdGW9/_old 2019-05-16 22:11:15.302220271 +0200
+++ /var/tmp/diff_new_pack.MgdGW9/_new 2019-05-16 22:11:15.346220233 +0200
@@ -18,7 +18,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
Name: python-google-api-core
-Version: 1.8.2
+Version: 1.11.0
Release: 0
Summary: Google API client core library
License: Apache-2.0
++++++ google-api-core-1.8.2.tar.gz -> google-api-core-1.11.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/.coveragerc
new/google-api-core-1.11.0/.coveragerc
--- old/google-api-core-1.8.2/.coveragerc 1970-01-01 01:00:00.000000000
+0100
+++ new/google-api-core-1.11.0/.coveragerc 2018-09-13 21:58:16.000000000
+0200
@@ -0,0 +1,13 @@
+[run]
+branch = True
+
+[report]
+fail_under = 100
+show_missing = True
+exclude_lines =
+ # Re-enable the standard pragma
+ pragma: NO COVER
+ # Ignore debug-only repr
+ def __repr__
+ # Ignore abstract methods
+ raise NotImplementedError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/.flake8
new/google-api-core-1.11.0/.flake8
--- old/google-api-core-1.8.2/.flake8 1970-01-01 01:00:00.000000000 +0100
+++ new/google-api-core-1.11.0/.flake8 2018-12-03 18:45:52.000000000 +0100
@@ -0,0 +1,11 @@
+[flake8]
+import-order-style=google
+# Note: this forces all google imports to be in the third group. See
+# https://github.com/PyCQA/flake8-import-order/issues/111
+application-import-names=google
+ignore = E203, E266, E501, W503
+exclude =
+ __pycache__,
+ .git,
+ *.pyc,
+ conf.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/CHANGELOG.md
new/google-api-core-1.11.0/CHANGELOG.md
--- old/google-api-core-1.8.2/CHANGELOG.md 1970-01-01 01:00:00.000000000
+0100
+++ new/google-api-core-1.11.0/CHANGELOG.md 2019-05-15 19:57:02.000000000
+0200
@@ -0,0 +1,281 @@
+# Changelog
+
+[PyPI History][1]
+
+[1]: https://pypi.org/project/google-api-core/#history
+
+## 1.11.0
+
+05-15-2019 10:29 PDT
+
+### New Features
+
+- Refactor 'client_info' support.
([#7849](https://github.com/googleapis/google-cloud-python/pull/7849))
+
+## 1.10.0
+
+04-29-2019 10:12 PDT
+
+### Implementation Changes
+
+- Append leading zeros for nanosecond precision DateTimes
+ ([#7663](https://github.com/googleapis/google-cloud-python/pull/7663))
+
+### New Features
+
+- Add `user_agent` property to `ClientInfo`
+ ([#7799](https://github.com/googleapis/google-cloud-python/pull/7799))
+
+## 1.9.0
+
+04-05-2019 10:38 PDT
+
+
+### Implementation Changes
+- Allow passing metadata as part of creating a bidi
([#7514](https://github.com/googleapis/google-cloud-python/pull/7514))
+
+### Internal / Testing Changes
+- Update setup.py
+- API Core: specify a pytype output directory in setup.cfg.
([#7639](https://github.com/googleapis/google-cloud-python/pull/7639))
+
+## 1.8.2
+
+03-22-2019 16:27 PDT
+
+
+### Implementation Changes
+- Remove classifier for Python 3.4 for end-of-life.
([#7535](https://github.com/googleapis/google-cloud-python/pull/7535))
+
+### Internal / Testing Changes
+- When re-opening a `ResumableBidiRPC` set `_request_queue_generator` to
`None`. ([#7548](https://github.com/googleapis/google-cloud-python/pull/7548))
+
+## 1.8.1
+
+03-12-2019 12:45 PDT
+
+### Implementation Changes
+- Protect the creation of a background thread in BackgroundConsumer and wait
on it starting.
([#7499](https://github.com/googleapis/google-cloud-python/pull/7499))
+
+## 1.8.0
+
+02-23-2019 15:46 PST
+
+
+### New Features
+- Add support to unwrap Anys into wrapped pb2 objects.
([#7430](https://github.com/googleapis/google-cloud-python/pull/7430))
+- Add `Operation.deserialize`.
([#7427](https://github.com/googleapis/google-cloud-python/pull/7427))
+
+### Documentation
+- Updated client library documentation URLs.
([#7307](https://github.com/googleapis/google-cloud-python/pull/7307))
+
+### Internal / Testing Changes
+- Fix new lint failure.
([#7382](https://github.com/googleapis/google-cloud-python/pull/7382))
+
+## 1.7.0
+
+12-17-2018 13:56 PST
+
+### New Features
+- Support converting `DatetimeWithNanos` to / from
`google.protobuf.timestamp_pb2.Timestamp`.
([#6919](https://github.com/googleapis/google-cloud-python/pull/6919))
+
+### Documentation
+- Document Python 2 deprecation.
([#6910](https://github.com/googleapis/google-cloud-python/pull/6910))
+- Add usage example for `google.api_core.iam.Polcy`.
([#6855](https://github.com/googleapis/google-cloud-python/pull/6855))
+
+### Internal / Testing Changes
+- Work around pytype big for `ABCMeta.register`.
([#6873](https://github.com/googleapis/google-cloud-python/pull/6873))
+
+## 1.6.0
+
+11-30-2018 12:45 PST
+
+
+### Implementation Changes
+- Import stdlib ABCs from 'collections.abc' rather than 'collections'.
([#6451](https://github.com/googleapis/google-cloud-python/pull/6451))
+
+### New Features
+- Move google.cloud.iam (core) to google.api_core.iam
([#6740](https://github.com/googleapis/google-cloud-python/pull/6740))
+- Add bidi support to api_core.
([#6191](https://github.com/googleapis/google-cloud-python/pull/6191))
+
+### Documentation
+- Fix typo
([#6532](https://github.com/googleapis/google-cloud-python/pull/6532))
+
+### Internal / Testing Changes
+- blacken api_core and core
([#6668](https://github.com/googleapis/google-cloud-python/pull/6668))
+
+## 1.5.2
+
+11-09-2018 14:22 PST
+
+
+### Implementation Changes
+- Retry transient errors in 'PollingFuture.result'.
([#6305](https://github.com/googleapis/google-cloud-python/pull/6305))
+
+### Dependencies
+- Remove hyphen from named extra in api_core.
([#6468](https://github.com/googleapis/google-cloud-python/pull/6468))
+- Bump minimum 'api_core' version for all GAPIC libs to 1.4.1.
([#6391](https://github.com/googleapis/google-cloud-python/pull/6391))
+- Avoid broken 'google-common-apis 1.5.4' release.
([#6355](https://github.com/googleapis/google-cloud-python/pull/6355))
+
+## 1.5.1
+
+10-29-2018 13:29 PDT
+
+### Implementation Changes
+- Don't URL-encode slashes in gRPC request headers.
([#6310](https://github.com/googleapis/google-cloud-python/pull/6310))
+
+### Internal / Testing Changes
+- Back out changes from
[#6267](https://github.com/googleapis/google-cloud-python/pull/6267) /
`api_core-1.6.0a1` release.
([#6328](https://github.com/googleapis/google-cloud-python/pull/6328))
+
+## 1.5.0
+
+### New Features
+- Add bidi, Bidirection Streaming, to api-core
([#6211](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6211))
+
+### Internal / Testing Changes
+- Use new Nox
([#6175](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6175))
+
+## 1.4.1
+
+### Dependencies
+- Pin minimum protobuf dependency to 3.4.0.
([#6132](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6132))
+
+### Internal / Testing Changes
+- Add type-checking via pytype to api_core.
([#6116](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/6116))
+
+## 1.4.0
+
+### Dependencies
+
+- Add support for gRPC connection management (available when using optional
grpc_gcp dependency)
([#5553](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5553))
([#5904](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5904))
+- Update classifiers to drop Python 3.4 and add Python 3.7
([#5702](https://github.com/GoogleCloudPlatform/google-cloud-python/pull/5702))
+
+## 1.3.0
+
+### New Features
+
+- Add protobuf_helpers.field_mask to calculate a field mask from two messages
(#5320)
+
+## 1.2.1
+
+### Implementation Changes
+- Make client_info work without gRPC installed. (#5075)
+- Rename `x-goog-header-params` to `x-goog-request-params` (#5495)
+
+## 1.2.0
+
+### Implementation Changes
+- Add close method to grpc Channel (#5333)
+
+### Internal / Testing Changes
+- Fix tests after grpcio update (#5333)
+- Add Test runs for Python 3.7 and remove 3.4 (#5295)
+
+## 1.1.2
+
+### Packaging
+- Update setuptools before packaging (#5265)
+
+## 1.1.1
+
+### Internal / Testing Changes
+- Use `install_requires` for platform dependencies instead of `extras_require`
(#4991)
+- Update trove classifer to '5 - Production/Stable'
+
+## 1.1.0
+
+### Interface additions
+
+- Add `datetime_helpers.DatetimeWithNanoSeconds` (#4979)
+
+### Implementation changes
+
+- Use a class to wrap grpc streaming errors instead of monkey-patching (#4995)
+
+## 1.0.0
+
+This is the stable v1.0.0 release of google-api-core for Python. Releases after
+this will not contain breaking changes.
+
+### Interface changes and additions
+
+- Made `api_core.page_iterator.PageIterator.item_to_value` public
+- Added ability to specify retry for `Operation` and `polling.Future`. (#4922)
+
+## 0.1.4
+
+### New Features
+
+- Add `ChannelStub` to `grpc_helpers` for testing gRPC-based clients. (#4705)
+
+### Notable Implementation Changes
+
+- Fix handling of gapic metadata when specified as `None`. (#4701)
+
+## 0.1.3
+
+### Notable Implementation Changes
+
+- Apply scopes to explicitly provided credentials if needed (#4594).
+- Removing `google.api_core.gapic_v1.method.METRICS_METADATA_KEY`. It
+ can be accessed via
+ `google.api_core.gapic_v1.client_info.METRICS_METADATA_KEY` (#4588).
+
+### Dependencies
+
+- Upgrading to latest `grpcio==1.8.2` (#4642). For details, see
+ related gRPC [bug](https://github.com/grpc/grpc/issues/9688)
+ and [fix](https://github.com/grpc/grpc/pull/13665).
+
+PyPI: https://pypi.org/project/google-api-core/0.1.3/
+
+## 0.1.2
+
+- Upgrading `concurrent.futures` backport from `>= 3.0.0`
+ to `>= 3.2.0` (#4521).
+- Moved `datetime`-related helpers from `google.cloud.core` to
+ `google.api_core.datetime_helpers` (#4399).
+- Added missing `client_info` to `gapic_v1/__init__.py`'s
+ `__all__` (#4567).
+- Added helpers for routing headers to `gapic_v1` (#4336).
+
+PyPI: https://pypi.org/project/google-api-core/0.1.2/
+
+## 0.1.1
+
+### Dependencies
+
+- Upgrading `grpcio` dependency from `1.2.0, < 1.6dev` to `>= 1.7.0` (#4280)
+
+PyPI: https://pypi.org/project/google-api-core/0.1.1/
+
+## 0.1.0
+
+Initial release
+
+Prior to being separated, this package was developed in `google-cloud-core`, so
+relevant changes from that package are included here.
+
+- Add google.api.core.gapic_v1.config (#4022)
+- Add google.api.core.helpers.grpc_helpers (#4041)
+- Add google.api.core.gapic_v1.method (#4057)
+- Add wrap_with_paging (#4067)
+- Add grpc_helpers.create_channel (#4069)
+- Add DEFAULT sentinel for gapic_v1.method (#4079)
+- Remove `googleapis-common-protos` from deps in non-`core` packages. (#4098)
+- Add google.api.core.operations_v1 (#4081)
+- Fix test assertion in test_wrap_method_with_overriding_retry_deadline (#4131)
+- Add google.api.core.helpers.general_helpers.wraps (#4166)
+- Update Docs with Python Setup Guide (#4187)
+- Move modules in google.api.core.helpers up one level, delete
google.api.core.helpers. (#4196)
+- Clarify that PollingFuture timeout is in seconds. (#4201)
+- Add api_core package (#4210)
+- Replace usage of google.api.core with google.api_core (#4221)
+- Add google.api_core.gapic_v2.client_info (#4225)
+- Fix how api_core.operation populates exception errors (#4231)
+- Fix bare except (#4250)
+- Fix parsing of API errors with Unicode err message (#4251)
+- Port gax proto helper methods (#4249)
+- Remove gapic_v1.method.wrap_with_paging (#4257)
+- Add final set of protobuf helpers to api_core (#4259)
+
+PyPI: https://pypi.org/project/google-api-core/0.1.0/
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/PKG-INFO
new/google-api-core-1.11.0/PKG-INFO
--- old/google-api-core-1.8.2/PKG-INFO 2019-03-23 03:25:46.000000000 +0100
+++ new/google-api-core-1.11.0/PKG-INFO 2019-05-15 20:00:54.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: google-api-core
-Version: 1.8.2
+Version: 1.11.0
Summary: Google API client core library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
@@ -43,6 +43,6 @@
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-Provides-Extra: grpcgcp
-Provides-Extra: grpc
Provides-Extra: grpcio-gcp
+Provides-Extra: grpc
+Provides-Extra: grpcgcp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/google/api_core/bidi.py
new/google-api-core-1.11.0/google/api_core/bidi.py
--- old/google-api-core-1.8.2/google/api_core/bidi.py 2019-03-23
00:26:34.000000000 +0100
+++ new/google-api-core-1.11.0/google/api_core/bidi.py 2019-05-15
19:22:09.000000000 +0200
@@ -147,7 +147,11 @@
initial_request = example_pb2.StreamingRpcRequest(
setting='example')
- rpc = BidiRpc(stub.StreamingRpc, initial_request=initial_request)
+ rpc = BidiRpc(
+ stub.StreamingRpc,
+ initial_request=initial_request,
+ metadata=[('name', 'value')]
+ )
rpc.open()
@@ -165,11 +169,14 @@
Callable[None, protobuf.Message]]): The initial request to
yield. This is useful if an initial request is needed to start the
stream.
+ metadata (Sequence[Tuple(str, str)]): RPC metadata to include in
+ the request.
"""
- def __init__(self, start_rpc, initial_request=None):
+ def __init__(self, start_rpc, initial_request=None, metadata=None):
self._start_rpc = start_rpc
self._initial_request = initial_request
+ self._rpc_metadata = metadata
self._request_queue = queue.Queue()
self._request_generator = None
self._is_active = False
@@ -200,7 +207,7 @@
request_generator = _RequestQueueGenerator(
self._request_queue, initial_request=self._initial_request
)
- call = self._start_rpc(iter(request_generator))
+ call = self._start_rpc(iter(request_generator),
metadata=self._rpc_metadata)
request_generator.call = call
@@ -288,10 +295,14 @@
initial_request = example_pb2.StreamingRpcRequest(
setting='example')
- rpc = ResumeableBidiRpc(
+ metadata = [('header_name', 'value')]
+
+ rpc = ResumableBidiRpc(
stub.StreamingRpc,
+ should_recover=should_recover,
initial_request=initial_request,
- should_recover=should_recover)
+ metadata=metadata
+ )
rpc.open()
@@ -310,10 +321,12 @@
should_recover (Callable[[Exception], bool]): A function that returns
True if the stream should be recovered. This will be called
whenever an error is encountered on the stream.
+ metadata Sequence[Tuple(str, str)]: RPC metadata to include in
+ the request.
"""
- def __init__(self, start_rpc, should_recover, initial_request=None):
- super(ResumableBidiRpc, self).__init__(start_rpc, initial_request)
+ def __init__(self, start_rpc, should_recover, initial_request=None,
metadata=None):
+ super(ResumableBidiRpc, self).__init__(start_rpc, initial_request,
metadata)
self._should_recover = should_recover
self._operational_lock = threading.RLock()
self._finalized = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/google/api_core/client_info.py
new/google-api-core-1.11.0/google/api_core/client_info.py
--- old/google-api-core-1.8.2/google/api_core/client_info.py 1970-01-01
01:00:00.000000000 +0100
+++ new/google-api-core-1.11.0/google/api_core/client_info.py 2019-05-15
19:25:15.000000000 +0200
@@ -0,0 +1,96 @@
+# Copyright 2017 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+"""Helpers for providing client information.
+
+Client information is used to send information about the calling client,
+such as the library and Python version, to API services.
+"""
+
+import platform
+
+import pkg_resources
+
+_PY_VERSION = platform.python_version()
+_API_CORE_VERSION = pkg_resources.get_distribution("google-api-core").version
+
+try:
+ _GRPC_VERSION = pkg_resources.get_distribution("grpcio").version
+except pkg_resources.DistributionNotFound: # pragma: NO COVER
+ _GRPC_VERSION = None
+
+
+class ClientInfo(object):
+ """Client information used to generate a user-agent for API calls.
+
+ This user-agent information is sent along with API calls to allow the
+ receiving service to do analytics on which versions of Python and Google
+ libraries are being used.
+
+ Args:
+ python_version (str): The Python interpreter version, for example,
+ ``'2.7.13'``.
+ grpc_version (Optional[str]): The gRPC library version.
+ api_core_version (str): The google-api-core library version.
+ gapic_version (Optional[str]): The sversion of gapic-generated client
+ library, if the library was generated by gapic.
+ client_library_version (Optional[str]): The version of the client
+ library, generally used if the client library was not generated
+ by gapic or if additional functionality was built on top of
+ a gapic client library.
+ user_agent (Optional[str]): Prefix to the user agent header. This is
+ used to supply information such as application name or partner
tool.
+ Recommended format: ``application-or-tool-ID/major.minor.version``.
+ """
+
+ def __init__(
+ self,
+ python_version=_PY_VERSION,
+ grpc_version=_GRPC_VERSION,
+ api_core_version=_API_CORE_VERSION,
+ gapic_version=None,
+ client_library_version=None,
+ user_agent=None,
+ ):
+ self.python_version = python_version
+ self.grpc_version = grpc_version
+ self.api_core_version = api_core_version
+ self.gapic_version = gapic_version
+ self.client_library_version = client_library_version
+ self.user_agent = user_agent
+
+ def to_user_agent(self):
+ """Returns the user-agent string for this client info."""
+
+ # Note: the order here is important as the internal metrics system
+ # expects these items to be in specific locations.
+ ua = ""
+
+ if self.user_agent is not None:
+ ua += "{user_agent} "
+
+ ua += "gl-python/{python_version} "
+
+ if self.grpc_version is not None:
+ ua += "grpc/{grpc_version} "
+
+ ua += "gax/{api_core_version} "
+
+ if self.gapic_version is not None:
+ ua += "gapic/{gapic_version} "
+
+ if self.client_library_version is not None:
+ ua += "gccl/{client_library_version} "
+
+ return ua.format(**self.__dict__).strip()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/google/api_core/datetime_helpers.py
new/google-api-core-1.11.0/google/api_core/datetime_helpers.py
--- old/google-api-core-1.8.2/google/api_core/datetime_helpers.py
2018-12-18 01:13:24.000000000 +0100
+++ new/google-api-core-1.11.0/google/api_core/datetime_helpers.py
2019-05-15 19:25:15.000000000 +0200
@@ -222,7 +222,7 @@
"""
if self._nanosecond == 0:
return to_rfc3339(self)
- nanos = str(self._nanosecond).rstrip("0")
+ nanos = str(self._nanosecond).rjust(9, '0').rstrip("0")
return "{}.{}Z".format(self.strftime(_RFC3339_NO_FRACTION), nanos)
@classmethod
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/google/api_core/gapic_v1/client_info.py
new/google-api-core-1.11.0/google/api_core/gapic_v1/client_info.py
--- old/google-api-core-1.8.2/google/api_core/gapic_v1/client_info.py
2018-12-18 01:13:24.000000000 +0100
+++ new/google-api-core-1.11.0/google/api_core/gapic_v1/client_info.py
2019-05-15 19:25:15.000000000 +0200
@@ -18,22 +18,13 @@
such as the library and Python version, to API services.
"""
-import platform
+from google.api_core import client_info
-import pkg_resources
-
-_PY_VERSION = platform.python_version()
-_API_CORE_VERSION = pkg_resources.get_distribution("google-api-core").version
-
-try:
- _GRPC_VERSION = pkg_resources.get_distribution("grpcio").version
-except pkg_resources.DistributionNotFound: # pragma: NO COVER
- _GRPC_VERSION = None
METRICS_METADATA_KEY = "x-goog-api-client"
-class ClientInfo(object):
+class ClientInfo(client_info.ClientInfo):
"""Client information used to generate a user-agent for API calls.
This user-agent information is sent along with API calls to allow the
@@ -51,41 +42,11 @@
library, generally used if the client library was not generated
by gapic or if additional functionality was built on top of
a gapic client library.
+ user_agent (Optional[str]): Prefix to the user agent header. This is
+ used to supply information such as application name or partner
tool.
+ Recommended format: ``application-or-tool-ID/major.minor.version``.
"""
- def __init__(
- self,
- python_version=_PY_VERSION,
- grpc_version=_GRPC_VERSION,
- api_core_version=_API_CORE_VERSION,
- gapic_version=None,
- client_library_version=None,
- ):
- self.python_version = python_version
- self.grpc_version = grpc_version
- self.api_core_version = api_core_version
- self.gapic_version = gapic_version
- self.client_library_version = client_library_version
-
- def to_user_agent(self):
- """Returns the user-agent string for this client info."""
- # Note: the order here is important as the internal metrics system
- # expects these items to be in specific locations.
- ua = "gl-python/{python_version} "
-
- if self.grpc_version is not None:
- ua += "grpc/{grpc_version} "
-
- ua += "gax/{api_core_version} "
-
- if self.gapic_version is not None:
- ua += "gapic/{gapic_version} "
-
- if self.client_library_version is not None:
- ua += "gccl/{client_library_version} "
-
- return ua.format(**self.__dict__).strip()
-
def to_grpc_metadata(self):
"""Returns the gRPC metadata for this client info."""
return (METRICS_METADATA_KEY, self.to_user_agent())
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/google_api_core.egg-info/PKG-INFO
new/google-api-core-1.11.0/google_api_core.egg-info/PKG-INFO
--- old/google-api-core-1.8.2/google_api_core.egg-info/PKG-INFO 2019-03-23
03:25:46.000000000 +0100
+++ new/google-api-core-1.11.0/google_api_core.egg-info/PKG-INFO
2019-05-15 20:00:54.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: google-api-core
-Version: 1.8.2
+Version: 1.11.0
Summary: Google API client core library
Home-page: https://github.com/GoogleCloudPlatform/google-cloud-python
Author: Google LLC
@@ -43,6 +43,6 @@
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Requires-Python: >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*
-Provides-Extra: grpcgcp
-Provides-Extra: grpc
Provides-Extra: grpcio-gcp
+Provides-Extra: grpc
+Provides-Extra: grpcgcp
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/google_api_core.egg-info/SOURCES.txt
new/google-api-core-1.11.0/google_api_core.egg-info/SOURCES.txt
--- old/google-api-core-1.8.2/google_api_core.egg-info/SOURCES.txt
2019-03-23 03:25:46.000000000 +0100
+++ new/google-api-core-1.11.0/google_api_core.egg-info/SOURCES.txt
2019-05-15 20:00:54.000000000 +0200
@@ -1,11 +1,16 @@
+.coveragerc
+.flake8
+CHANGELOG.md
LICENSE
MANIFEST.in
README.rst
+noxfile.py
setup.cfg
setup.py
google/__init__.py
google/api_core/__init__.py
google/api_core/bidi.py
+google/api_core/client_info.py
google/api_core/datetime_helpers.py
google/api_core/exceptions.py
google/api_core/general_helpers.py
@@ -39,6 +44,7 @@
tests/__init__.py
tests/unit/__init__.py
tests/unit/test_bidi.py
+tests/unit/test_client_info.py
tests/unit/test_datetime_helpers.py
tests/unit/test_exceptions.py
tests/unit/test_general_helpers.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/noxfile.py
new/google-api-core-1.11.0/noxfile.py
--- old/google-api-core-1.8.2/noxfile.py 1970-01-01 01:00:00.000000000
+0100
+++ new/google-api-core-1.11.0/noxfile.py 2019-05-15 19:22:09.000000000
+0200
@@ -0,0 +1,105 @@
+# Copyright 2016 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from __future__ import absolute_import
+import os
+
+# https://github.com/google/importlab/issues/25
+import nox # pytype: disable=import-error
+
+
+def default(session):
+ """Default unit test session.
+
+ This is intended to be run **without** an interpreter set, so
+ that the current ``python`` (on the ``PATH``) or the version of
+ Python corresponding to the ``nox`` binary the ``PATH`` can
+ run the tests.
+ """
+ # Install all test dependencies, then install this package in-place.
+ session.install("mock", "pytest", "pytest-cov", "grpcio >= 1.0.2")
+ session.install("-e", ".")
+
+ # Run py.test against the unit tests.
+ session.run(
+ "py.test",
+ "--quiet",
+ "--cov=google.api_core",
+ "--cov=tests.unit",
+ "--cov-append",
+ "--cov-config=.coveragerc",
+ "--cov-report=",
+ "--cov-fail-under=97",
+ os.path.join("tests", "unit"),
+ *session.posargs
+ )
+
+
[email protected](python=["2.7", "3.5", "3.6", "3.7"])
+def unit(session):
+ """Run the unit test suite."""
+ default(session)
+
+
[email protected](python=["2.7", "3.5", "3.6", "3.7"])
+def unit_grpc_gcp(session):
+ """Run the unit test suite with grpcio-gcp installed."""
+
+ # Install grpcio-gcp
+ session.install("grpcio-gcp")
+
+ default(session)
+
+
[email protected](python="3.6")
+def lint(session):
+ """Run linters.
+
+ Returns a failure if the linters find linting errors or sufficiently
+ serious code quality issues.
+ """
+ session.install("flake8", "flake8-import-order")
+ session.install(".")
+ session.run("flake8", "google", "tests")
+
+
[email protected](python="3.6")
+def lint_setup_py(session):
+ """Verify that setup.py is valid (including RST check)."""
+
+ session.install("docutils", "Pygments")
+ session.run("python", "setup.py", "check", "--restructuredtext",
"--strict")
+
+
+# No 2.7 due to https://github.com/google/importlab/issues/26.
+# No 3.7 because pytype supports up to 3.6 only.
[email protected](python="3.6")
+def pytype(session):
+ """Run type-checking."""
+ session.install(
+ ".", "grpcio >= 1.8.2", "grpcio-gcp >= 0.2.2", "pytype >= 2019.3.21"
+ )
+ session.run("pytype")
+
+
[email protected](python="3.6")
+def cover(session):
+ """Run the final coverage report.
+
+ This outputs the coverage report aggregating coverage from the unit
+ test runs (not system test runs), and then erases coverage data.
+ """
+ session.install("coverage", "pytest-cov")
+ session.run("coverage", "report", "--show-missing", "--fail-under=100")
+ session.run("coverage", "erase")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/setup.cfg
new/google-api-core-1.11.0/setup.cfg
--- old/google-api-core-1.8.2/setup.cfg 2019-03-23 03:25:46.000000000 +0100
+++ new/google-api-core-1.11.0/setup.cfg 2019-05-15 20:00:54.000000000
+0200
@@ -7,6 +7,8 @@
google/
exclude =
tests/
+output = pytype_output/
+disable = pyi-error
[egg_info]
tag_build =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/setup.py
new/google-api-core-1.11.0/setup.py
--- old/google-api-core-1.8.2/setup.py 2019-03-23 03:25:16.000000000 +0100
+++ new/google-api-core-1.11.0/setup.py 2019-05-15 19:57:02.000000000 +0200
@@ -22,7 +22,7 @@
name = "google-api-core"
description = "Google API client core library"
-version = "1.8.2"
+version = "1.11.0"
# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/tests/unit/gapic/test_client_info.py
new/google-api-core-1.11.0/tests/unit/gapic/test_client_info.py
--- old/google-api-core-1.8.2/tests/unit/gapic/test_client_info.py
2018-12-18 01:13:24.000000000 +0100
+++ new/google-api-core-1.11.0/tests/unit/gapic/test_client_info.py
2019-05-15 19:25:15.000000000 +0200
@@ -16,56 +16,6 @@
from google.api_core.gapic_v1 import client_info
-def test_constructor_defaults():
- info = client_info.ClientInfo()
-
- assert info.python_version is not None
- assert info.grpc_version is not None
- assert info.api_core_version is not None
- assert info.gapic_version is None
- assert info.client_library_version is None
-
-
-def test_constructor_options():
- info = client_info.ClientInfo(
- python_version="1",
- grpc_version="2",
- api_core_version="3",
- gapic_version="4",
- client_library_version="5",
- )
-
- assert info.python_version == "1"
- assert info.grpc_version == "2"
- assert info.api_core_version == "3"
- assert info.gapic_version == "4"
- assert info.client_library_version == "5"
-
-
-def test_to_user_agent_minimal():
- info = client_info.ClientInfo(
- python_version="1", api_core_version="2", grpc_version=None
- )
-
- user_agent = info.to_user_agent()
-
- assert user_agent == "gl-python/1 gax/2"
-
-
-def test_to_user_agent_full():
- info = client_info.ClientInfo(
- python_version="1",
- grpc_version="2",
- api_core_version="3",
- gapic_version="4",
- client_library_version="5",
- )
-
- user_agent = info.to_user_agent()
-
- assert user_agent == "gl-python/1 grpc/2 gax/3 gapic/4 gccl/5"
-
-
def test_to_grpc_metadata():
info = client_info.ClientInfo()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/tests/unit/test_bidi.py
new/google-api-core-1.11.0/tests/unit/test_bidi.py
--- old/google-api-core-1.8.2/tests/unit/test_bidi.py 2018-12-18
01:13:24.000000000 +0100
+++ new/google-api-core-1.11.0/tests/unit/test_bidi.py 2019-05-15
19:22:09.000000000 +0200
@@ -125,9 +125,10 @@
call = mock.create_autospec(_CallAndFuture, instance=True)
rpc = mock.create_autospec(grpc.StreamStreamMultiCallable, instance=True)
- def rpc_side_effect(request):
+ def rpc_side_effect(request, metadata=None):
call.is_active.return_value = True
call.request = request
+ call.metadata = metadata
return call
rpc.side_effect = rpc_side_effect
@@ -172,6 +173,15 @@
callback.assert_called_once_with(mock.sentinel.future)
+ def test_metadata(self):
+ rpc, call = make_rpc()
+ bidi_rpc = bidi.BidiRpc(rpc, metadata=mock.sentinel.A)
+ assert bidi_rpc._rpc_metadata == mock.sentinel.A
+
+ bidi_rpc.open()
+ assert bidi_rpc.call == call
+ assert bidi_rpc.call.metadata == mock.sentinel.A
+
def test_open(self):
rpc, call = make_rpc()
bidi_rpc = bidi.BidiRpc(rpc)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/google-api-core-1.8.2/tests/unit/test_client_info.py
new/google-api-core-1.11.0/tests/unit/test_client_info.py
--- old/google-api-core-1.8.2/tests/unit/test_client_info.py 1970-01-01
01:00:00.000000000 +0100
+++ new/google-api-core-1.11.0/tests/unit/test_client_info.py 2019-05-15
19:25:15.000000000 +0200
@@ -0,0 +1,69 @@
+# Copyright 2017 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+
+from google.api_core import client_info
+
+
+def test_constructor_defaults():
+ info = client_info.ClientInfo()
+
+ assert info.python_version is not None
+ assert info.grpc_version is not None
+ assert info.api_core_version is not None
+ assert info.gapic_version is None
+ assert info.client_library_version is None
+
+
+def test_constructor_options():
+ info = client_info.ClientInfo(
+ python_version="1",
+ grpc_version="2",
+ api_core_version="3",
+ gapic_version="4",
+ client_library_version="5",
+ user_agent="6"
+ )
+
+ assert info.python_version == "1"
+ assert info.grpc_version == "2"
+ assert info.api_core_version == "3"
+ assert info.gapic_version == "4"
+ assert info.client_library_version == "5"
+ assert info.user_agent == "6"
+
+
+def test_to_user_agent_minimal():
+ info = client_info.ClientInfo(
+ python_version="1", api_core_version="2", grpc_version=None
+ )
+
+ user_agent = info.to_user_agent()
+
+ assert user_agent == "gl-python/1 gax/2"
+
+
+def test_to_user_agent_full():
+ info = client_info.ClientInfo(
+ python_version="1",
+ grpc_version="2",
+ api_core_version="3",
+ gapic_version="4",
+ client_library_version="5",
+ user_agent="app-name/1.0",
+ )
+
+ user_agent = info.to_user_agent()
+
+ assert user_agent == "app-name/1.0 gl-python/1 grpc/2 gax/3 gapic/4 gccl/5"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/google-api-core-1.8.2/tests/unit/test_datetime_helpers.py
new/google-api-core-1.11.0/tests/unit/test_datetime_helpers.py
--- old/google-api-core-1.8.2/tests/unit/test_datetime_helpers.py
2018-12-18 01:13:24.000000000 +0100
+++ new/google-api-core-1.11.0/tests/unit/test_datetime_helpers.py
2019-05-15 19:25:15.000000000 +0200
@@ -204,6 +204,11 @@
assert stamp.rfc3339() == "2016-12-20T21:13:47.123456Z"
@staticmethod
+ def test_rfc3339_wo_nanos_w_leading_zero():
+ stamp = datetime_helpers.DatetimeWithNanoseconds(2016, 12, 20, 21, 13,
47, 1234)
+ assert stamp.rfc3339() == "2016-12-20T21:13:47.001234Z"
+
+ @staticmethod
def test_rfc3339_w_nanos():
stamp = datetime_helpers.DatetimeWithNanoseconds(
2016, 12, 20, 21, 13, 47, nanosecond=123456789
@@ -211,6 +216,13 @@
assert stamp.rfc3339() == "2016-12-20T21:13:47.123456789Z"
@staticmethod
+ def test_rfc3339_w_nanos_w_leading_zero():
+ stamp = datetime_helpers.DatetimeWithNanoseconds(
+ 2016, 12, 20, 21, 13, 47, nanosecond=1234567
+ )
+ assert stamp.rfc3339() == "2016-12-20T21:13:47.001234567Z"
+
+ @staticmethod
def test_rfc3339_w_nanos_no_trailing_zeroes():
stamp = datetime_helpers.DatetimeWithNanoseconds(
2016, 12, 20, 21, 13, 47, nanosecond=100000000
@@ -218,6 +230,13 @@
assert stamp.rfc3339() == "2016-12-20T21:13:47.1Z"
@staticmethod
+ def test_rfc3339_w_nanos_w_leading_zero_and_no_trailing_zeros():
+ stamp = datetime_helpers.DatetimeWithNanoseconds(
+ 2016, 12, 20, 21, 13, 47, nanosecond=1234500
+ )
+ assert stamp.rfc3339() == "2016-12-20T21:13:47.0012345Z"
+
+ @staticmethod
def test_from_rfc3339_w_invalid():
stamp = "2016-12-20T21:13:47"
with pytest.raises(ValueError):