From c0e698837a6e57483cf72e71da1d707e8e898b65 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 2 Oct 2020 14:41:34 -0700 Subject: [PATCH 1/5] fix: use version.py instead of pkg_resources.get_distribution --- google/api_core/client_info.py | 4 +++- google/api_core/version.py | 1 + setup.py | 7 ++++++- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 google/api_core/version.py diff --git a/google/api_core/client_info.py b/google/api_core/client_info.py index b196b7a9..6c04d5de 100644 --- a/google/api_core/client_info.py +++ b/google/api_core/client_info.py @@ -22,8 +22,10 @@ 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 00000000..c55fafc8 --- /dev/null +++ b/google/api_core/version.py @@ -0,0 +1 @@ +__version__ = "1.22.3" \ No newline at end of file diff --git a/setup.py b/setup.py index e1189664..a35121e0 100644 --- a/setup.py +++ b/setup.py @@ -22,7 +22,12 @@ name = "google-api-core" description = "Google API client core library" -version = "1.22.3" + +version = {} +with open("google/api_core/version.py") as fp: + exec(fp.read(), version) +version = version['__version__'] + # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' From a3d2669cac81fc5a36afdba4c73af983795352eb Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 2 Oct 2020 16:32:09 -0700 Subject: [PATCH 2/5] fix: license header --- google/api_core/version.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/google/api_core/version.py b/google/api_core/version.py index c55fafc8..bd2e14a6 100644 --- a/google/api_core/version.py +++ b/google/api_core/version.py @@ -1 +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" \ No newline at end of file From 777bb5fbb071518fa119c47f834ee48d9c027bf1 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Fri, 2 Oct 2020 16:48:37 -0700 Subject: [PATCH 3/5] fix: replace another version import for api_core in api_core --- google/api_core/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/google/api_core/__init__.py b/google/api_core/__init__.py index c762e183..b9bc8587 100644 --- a/google/api_core/__init__.py +++ b/google/api_core/__init__.py @@ -19,5 +19,6 @@ 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__ From 38d955161207ad150095f570e303f446192a72c0 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Mon, 5 Oct 2020 10:09:44 -0700 Subject: [PATCH 4/5] chore: lint --- google/api_core/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/google/api_core/version.py b/google/api_core/version.py index bd2e14a6..f49e5331 100644 --- a/google/api_core/version.py +++ b/google/api_core/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "1.22.3" \ No newline at end of file +__version__ = "1.22.3" From c5b3fab21d93799b6ba93c2c56327bc5d36ef9a7 Mon Sep 17 00:00:00 2001 From: Chris Wilcox Date: Mon, 5 Oct 2020 11:00:16 -0700 Subject: [PATCH 5/5] chore: lint --- google/api_core/__init__.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/google/api_core/__init__.py b/google/api_core/__init__.py index b9bc8587..605dd8be 100644 --- a/google/api_core/__init__.py +++ b/google/api_core/__init__.py @@ -17,8 +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__ = api_core_version.__version__