Skip to content

Commit e9fb6f3

Browse files
committed
fix: create version.py for package versioning
1 parent 798e227 commit e9fb6f3

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

google/cloud/storage/__init__.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,7 @@
3131
machine).
3232
"""
3333

34-
import pkg_resources
35-
36-
try:
37-
__version__ = pkg_resources.get_distribution("google-cloud-storage").version
38-
except pkg_resources.DistributionNotFound:
39-
__version__ = None
40-
34+
from google.cloud.storage import __version__
4135
from google.cloud.storage.batch import Batch
4236
from google.cloud.storage.blob import Blob
4337
from google.cloud.storage.bucket import Bucket

setup.py

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

2323
name = "google-cloud-storage"
2424
description = "Google Cloud Storage API client library"
25-
version = "1.31.2"
2625
# Should be one of:
2726
# 'Development Status :: 3 - Alpha'
2827
# 'Development Status :: 4 - Beta'
@@ -41,6 +40,11 @@
4140

4241
package_root = os.path.abspath(os.path.dirname(__file__))
4342

43+
version = {}
44+
with open("google/cloud/datastore/version.py") as fp:
45+
exec(fp.read(), version)
46+
version = version["__version__"]
47+
4448
readme_filename = os.path.join(package_root, "README.rst")
4549
with io.open(readme_filename, encoding="utf-8") as readme_file:
4650
readme = readme_file.read()

0 commit comments

Comments
 (0)