Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 386b6df

Browse filesBrowse files
dhermeslukesneeringer
authored andcommitted
Adding GCCL header for HTTP APIs. (#3046)
1 parent 5444267 commit 386b6df
Copy full SHA for 386b6df

File tree

Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+6
-4
lines changed
Open diff view settings
Collapse file

‎packages/google-cloud-datastore/google/cloud/datastore/__init__.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-datastore/google/cloud/datastore/__init__.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@
5454
"""
5555

5656

57+
from pkg_resources import get_distribution
58+
__version__ = get_distribution('google-cloud-datastore').version
59+
5760
from google.cloud.datastore.batch import Batch
5861
from google.cloud.datastore.client import Client
5962
from google.cloud.datastore.entity import Entity
Collapse file

‎packages/google-cloud-datastore/google/cloud/datastore/_http.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-datastore/google/cloud/datastore/_http.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
"""Connections to Google Cloud Datastore API servers."""
1616

1717
import os
18-
from pkg_resources import get_distribution
1918

2019
from google.rpc import status_pb2
2120

@@ -24,6 +23,8 @@
2423
from google.cloud.environment_vars import GCD_HOST
2524
from google.cloud import exceptions
2625
from google.cloud.grpc.datastore.v1 import datastore_pb2 as _datastore_pb2
26+
27+
from google.cloud.datastore import __version__
2728
try:
2829
from google.cloud.datastore._gax import _DatastoreAPIOverGRPC
2930
_HAVE_GRPC = True
@@ -37,9 +38,7 @@
3738

3839
_DISABLE_GRPC = os.getenv(DISABLE_GRPC, False)
3940
_USE_GRPC = _HAVE_GRPC and not _DISABLE_GRPC
40-
_DATASTORE_DIST = get_distribution('google-cloud-datastore')
41-
_CLIENT_INFO = connection_module.CLIENT_INFO_TEMPLATE.format(
42-
_DATASTORE_DIST.version)
41+
_CLIENT_INFO = connection_module.CLIENT_INFO_TEMPLATE.format(__version__)
4342

4443

4544
class _DatastoreAPIOverHttp(object):

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.