Skip to content
Permalink
Browse files
fix: use version.py instead of pkg_resources.get_distribution (#307)
* fix: use version.py instead of pkg_resources.get_distribution

* fix: nit
  • Loading branch information
HemangChothani committed Oct 12, 2020
1 parent 35627d1 commit b8f502b14f21d1815697e4d57cf1225dfb4a7c5e
Showing with 23 additions and 3 deletions.
  1. +2 −2 google/cloud/bigquery/__init__.py
  2. +15 −0 google/cloud/bigquery/version.py
  3. +6 −1 setup.py
@@ -28,9 +28,9 @@
"""


from pkg_resources import get_distribution
from google.cloud.bigquery import version as bigquery_version

__version__ = get_distribution("google-cloud-bigquery").version
__version__ = bigquery_version.__version__

from google.cloud.bigquery.client import Client
from google.cloud.bigquery.dataset import AccessEntry
@@ -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__ = "2.1.0"
@@ -22,7 +22,7 @@

name = "google-cloud-bigquery"
description = "Google BigQuery API client library"
version = "2.1.0"

# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
@@ -83,6 +83,11 @@
with io.open(readme_filename, encoding="utf-8") as readme_file:
readme = readme_file.read()

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

# Only include packages under the 'google' namespace. Do not include tests,
# benchmarks, etc.
packages = [

0 comments on commit b8f502b

Please sign in to comment.