File tree 6 files changed +32
-13
lines changed
6 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 55
55
"""
56
56
57
57
58
- from pkg_resources import get_distribution
59
-
60
- __version__ = get_distribution ("google-cloud-datastore" ).version
61
-
58
+ from google .cloud .datastore .version import __version__
62
59
from google .cloud .datastore .batch import Batch
63
60
from google .cloud .datastore .client import Client
64
61
from google .cloud .datastore .entity import Entity
Original file line number Diff line number Diff line change 21
21
from google .cloud ._helpers import _LocalStack
22
22
from google .cloud ._helpers import _determine_default_project as _base_default_project
23
23
from google .cloud .client import ClientWithProject
24
- from google .cloud .datastore import __version__
24
+ from google .cloud .datastore . version import __version__
25
25
from google .cloud .datastore import helpers
26
26
from google .cloud .datastore ._http import HTTPDatastoreAPI
27
27
from google .cloud .datastore .batch import Batch
Original file line number Diff line number Diff line change
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ __version__ = "1.15.1"
Original file line number Diff line number Diff line change 17
17
"""Accesses the google.datastore.admin.v1 DatastoreAdmin API."""
18
18
19
19
import functools
20
- import pkg_resources
20
+ import os
21
21
import warnings
22
22
23
23
from google .oauth2 import service_account
43
43
from google .longrunning import operations_pb2
44
44
from google .protobuf import empty_pb2
45
45
46
+ # To avoid importing datastore into admin (which would result in a
47
+ # circular dependency), We exec to get the version via a dict.
48
+ dir_path = os .path .abspath (os .path .dirname (__file__ ))
49
+ version = {}
50
+ with open (os .path .join (dir_path , "../../datastore/version.py" )) as fp :
51
+ exec (fp .read (), version )
46
52
47
- _GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
48
- "google-cloud-datastore" ,
49
- ).version
53
+ _GAPIC_LIBRARY_VERSION = version ["__version__" ]
50
54
51
55
52
56
class DatastoreAdminClient (object ):
Original file line number Diff line number Diff line change 36
36
from google .cloud .datastore_v1 .proto import datastore_pb2_grpc
37
37
from google .cloud .datastore_v1 .proto import entity_pb2
38
38
from google .cloud .datastore_v1 .proto import query_pb2
39
+ from google .cloud .datastore .version import __version__
39
40
40
41
41
- _GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
42
- "google-cloud-datastore" ,
43
- ).version
42
+ _GAPIC_LIBRARY_VERSION = __version__
44
43
45
44
46
45
class DatastoreClient (object ):
Original file line number Diff line number Diff line change 22
22
23
23
name = "google-cloud-datastore"
24
24
description = "Google Cloud Datastore API client library"
25
- version = "1.15.1"
25
+ version = {}
26
+ with open ("google/cloud/datastore/version.py" ) as fp :
27
+ exec (fp .read (), version )
28
+ version = version ["__version__" ]
29
+
26
30
# Should be one of:
27
31
# 'Development Status :: 3 - Alpha'
28
32
# 'Development Status :: 4 - Beta'
You can’t perform that action at this time.
0 commit comments