Skip to content

Commit

Permalink
fix: use version.py instead of pkg_resources.get_distribution (#184)
Browse files Browse the repository at this point in the history
* fix: use version.py instead of pkg_resources.get_distribution

* Update version number in version.py

* Update copyright year

* lint

---------

Co-authored-by: Anthonios Partheniou <partheniou@google.com>
  • Loading branch information
bricker and parthea authored Nov 15, 2023
1 parent d8d1119 commit 2a7b9d0
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
4 changes: 2 additions & 2 deletions google/cloud/runtimeconfig/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"""Google Cloud Runtime Configurator API package."""


from pkg_resources import get_distribution
from google.cloud.runtimeconfig import version as runtimeconfig_version

__version__ = get_distribution("google-cloud-runtimeconfig").version
__version__ = runtimeconfig_version.__version__

from google.cloud.runtimeconfig.client import Client

Expand Down
15 changes: 15 additions & 0 deletions google/cloud/runtimeconfig/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Copyright 2023 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__ = "0.33.3"
8 changes: 7 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,13 @@

name = "google-cloud-runtimeconfig"
description = "Google Cloud RuntimeConfig API client library"
version = "0.33.3"

version = {}
with open("google/cloud/runtimeconfig/version.py") as fp:
exec(fp.read(), version)
version = version["__version__"]


# Should be one of:
# 'Development Status :: 3 - Alpha'
# 'Development Status :: 4 - Beta'
Expand Down

0 comments on commit 2a7b9d0

Please sign in to comment.