Skip to content

Commit d14d93b

Browse files
eirichadlwilson
andauthored
refactor: migrate from pkg_resources to importlib.metadata (#374)
Signed-off-by: Eric Avdey <eiri@eiri.ca> Co-authored-by: Chad Wilson <chadw@thoughtworks.com>
1 parent 0322c99 commit d14d93b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

check_and_install_getgauge.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import sys
33
from subprocess import check_output
44

5-
import pkg_resources
5+
from importlib.metadata import version, PackageNotFoundError
66

77

88
def get_version():
@@ -29,10 +29,10 @@ def assert_versions():
2929
expected_gauge_version = python_plugin_version
3030

3131
try:
32-
getgauge_version = pkg_resources.get_distribution('getgauge').version
32+
getgauge_version = version('getgauge')
3333
if getgauge_version != expected_gauge_version:
3434
install_getgauge("getgauge=="+expected_gauge_version)
35-
except pkg_resources.DistributionNotFound:
35+
except PackageNotFoundError:
3636
install_getgauge("getgauge=="+expected_gauge_version)
3737

3838

python.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"id": "python",
3-
"version": "0.4.5",
3+
"version": "0.4.6",
44
"description": "Python support for gauge",
55
"run": {
66
"windows": [

0 commit comments

Comments
 (0)