Skip to content

Commit c0e6988

Browse files
committed
fix: use version.py instead of pkg_resources.get_distribution
1 parent ae658b6 commit c0e6988

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

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
import pkg_resources
2424

25+
from google.api_core import version as api_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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__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+
with open("google/api_core/version.py") as fp:
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)