Skip to content
Permalink
Browse files
fix: use version.py for versioning, avoid issues with discovering ver…
…sion via get_distribution (#288)



Co-authored-by: Tres Seaver <tseaver@palladion.com>
  • Loading branch information
crwilcox and tseaver committed Oct 6, 2020
1 parent 6cc4a41 commit fcd1c4f7c947eb95d6937783fd69670a570f145e
Showing with 21 additions and 6 deletions.
  1. +1 −5 google/cloud/storage/__init__.py
  2. +15 −0 google/cloud/storage/version.py
  3. +5 −1 setup.py
@@ -31,11 +31,7 @@
machine).
"""


from pkg_resources import get_distribution

__version__ = get_distribution("google-cloud-storage").version

from google.cloud.storage.version import __version__
from google.cloud.storage.batch import Batch
from google.cloud.storage.blob import Blob
from google.cloud.storage.bucket import Bucket
@@ -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.31.2"
@@ -22,7 +22,6 @@

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

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

version = {}
with open(os.path.join(package_root, "google/cloud/storage/version.py")) as fp:
exec(fp.read(), version)
version = version["__version__"]

readme_filename = os.path.join(package_root, "README.rst")
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

0 comments on commit fcd1c4f

Please sign in to comment.