File tree Expand file tree Collapse file tree 6 files changed +32
-13
lines changed
packages/google-cloud-datastore Expand file tree Collapse file tree 6 files changed +32
-13
lines changed Original file line number Diff line number Diff line change 5555"""
5656
5757
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__
6259from google .cloud .datastore .batch import Batch
6360from google .cloud .datastore .client import Client
6461from google .cloud .datastore .entity import Entity
Original file line number Diff line number Diff line change 2121from google .cloud ._helpers import _LocalStack
2222from google .cloud ._helpers import _determine_default_project as _base_default_project
2323from google .cloud .client import ClientWithProject
24- from google .cloud .datastore import __version__
24+ from google .cloud .datastore . version import __version__
2525from google .cloud .datastore import helpers
2626from google .cloud .datastore ._http import HTTPDatastoreAPI
2727from 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 1717"""Accesses the google.datastore.admin.v1 DatastoreAdmin API."""
1818
1919import functools
20- import pkg_resources
20+ import os
2121import warnings
2222
2323from google .oauth2 import service_account
4343from google .longrunning import operations_pb2
4444from google .protobuf import empty_pb2
4545
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 )
4652
47- _GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
48- "google-cloud-datastore" ,
49- ).version
53+ _GAPIC_LIBRARY_VERSION = version ["__version__" ]
5054
5155
5256class DatastoreAdminClient (object ):
Original file line number Diff line number Diff line change 3636from google .cloud .datastore_v1 .proto import datastore_pb2_grpc
3737from google .cloud .datastore_v1 .proto import entity_pb2
3838from google .cloud .datastore_v1 .proto import query_pb2
39+ from google .cloud .datastore .version import __version__
3940
4041
41- _GAPIC_LIBRARY_VERSION = pkg_resources .get_distribution (
42- "google-cloud-datastore" ,
43- ).version
42+ _GAPIC_LIBRARY_VERSION = __version__
4443
4544
4645class DatastoreClient (object ):
Original file line number Diff line number Diff line change 2222
2323name = "google-cloud-datastore"
2424description = "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+
2630# Should be one of:
2731# 'Development Status :: 3 - Alpha'
2832# 'Development Status :: 4 - Beta'
You can’t perform that action at this time.
0 commit comments