Skip to content

Commit 2a7b9d0

Browse files
brickerparthea
andauthored
fix: use version.py instead of pkg_resources.get_distribution (#184)
* 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 <[email protected]>
1 parent d8d1119 commit 2a7b9d0

File tree

3 files changed

+24
-3
lines changed

3 files changed

+24
-3
lines changed

google/cloud/runtimeconfig/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"""Google Cloud Runtime Configurator API package."""
1616

1717

18-
from pkg_resources import get_distribution
18+
from google.cloud.runtimeconfig import version as runtimeconfig_version
1919

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

2222
from google.cloud.runtimeconfig.client import Client
2323

google/cloud/runtimeconfig/version.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Copyright 2023 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
__version__ = "0.33.3"

setup.py

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

2323
name = "google-cloud-runtimeconfig"
2424
description = "Google Cloud RuntimeConfig API client library"
25-
version = "0.33.3"
25+
26+
version = {}
27+
with open("google/cloud/runtimeconfig/version.py") as fp:
28+
exec(fp.read(), version)
29+
version = version["__version__"]
30+
31+
2632
# Should be one of:
2733
# 'Development Status :: 3 - Alpha'
2834
# 'Development Status :: 4 - Beta'

0 commit comments

Comments
 (0)