Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commitd480d97

Browse files
authored
fix: use version.py instead of pkg_resources.get_distribution (#80)
* fix: use version.py instead of pkg_resources.get_distribution
1 parentae658b6 commitd480d97

File tree

4 files changed

+26
-5
lines changed

4 files changed

+26
-5
lines changed

‎google/api_core/__init__.py‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
This package contains common code and utilties used by Google client libraries.
1818
"""
1919

20-
frompkg_resourcesimportget_distribution
20+
fromgoogle.api_coreimportversionasapi_core_version
2121

22-
23-
__version__=get_distribution("google-api-core").version
22+
__version__=api_core_version.__version__

‎google/api_core/client_info.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@
2222

2323
importpkg_resources
2424

25+
fromgoogle.api_coreimportversionasapi_core_version
26+
2527
_PY_VERSION=platform.python_version()
26-
_API_CORE_VERSION=pkg_resources.get_distribution("google-api-core").version
28+
_API_CORE_VERSION=api_core_version.__version__
2729

2830
try:
2931
_GRPC_VERSION=pkg_resources.get_distribution("grpcio").version

‎google/api_core/version.py‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
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.22.3"

‎setup.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@
2222

2323
name="google-api-core"
2424
description="Google API client core library"
25-
version="1.22.3"
25+
26+
version= {}
27+
withopen("google/api_core/version.py")asfp:
28+
exec(fp.read(),version)
29+
version=version['__version__']
30+
2631
# Should be one of:
2732
# 'Development Status :: 3 - Alpha'
2833
# 'Development Status :: 4 - Beta'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp