aboutsummaryrefslogtreecommitdiff
path: root/google
diff options
context:
space:
mode:
authorChristopher Wilcox <crwilcox@google.com>2020-10-05 12:06:00 -0700
committerGitHub <noreply@github.com>2020-10-05 12:06:00 -0700
commitd480d97e41cd6705325b3b649360553a83c23f47 (patch)
treee348cbbb556decedbe7c66b1377b6a6cc209882b /google
parentae658b63f91088f9674a3e4ddb0dafb0865641a4 (diff)
downloadpython-api-core-d480d97e41cd6705325b3b649360553a83c23f47.tar.gz
fix: use version.py instead of pkg_resources.get_distribution (#80)
* fix: use version.py instead of pkg_resources.get_distribution
Diffstat (limited to 'google')
-rw-r--r--google/api_core/__init__.py5
-rw-r--r--google/api_core/client_info.py4
-rw-r--r--google/api_core/version.py15
3 files changed, 20 insertions, 4 deletions
diff --git a/google/api_core/__init__.py b/google/api_core/__init__.py
index c762e18..605dd8b 100644
--- a/google/api_core/__init__.py
+++ b/google/api_core/__init__.py
@@ -17,7 +17,6 @@
This package contains common code and utilties used by Google client libraries.
"""
-from pkg_resources import get_distribution
+from google.api_core import version as api_core_version
-
-__version__ = get_distribution("google-api-core").version
+__version__ = api_core_version.__version__
diff --git a/google/api_core/client_info.py b/google/api_core/client_info.py
index b196b7a..6c04d5d 100644
--- a/google/api_core/client_info.py
+++ b/google/api_core/client_info.py
@@ -22,8 +22,10 @@ import platform
import pkg_resources
+from google.api_core import version as api_core_version
+
_PY_VERSION = platform.python_version()
-_API_CORE_VERSION = pkg_resources.get_distribution("google-api-core").version
+_API_CORE_VERSION = api_core_version.__version__
try:
_GRPC_VERSION = pkg_resources.get_distribution("grpcio").version
diff --git a/google/api_core/version.py b/google/api_core/version.py
new file mode 100644
index 0000000..f49e533
--- /dev/null
+++ b/google/api_core/version.py
@@ -0,0 +1,15 @@
+# Copyright 2020 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.
+
+__version__ = "1.22.3"