Skip to content

Commit

Permalink
refactor: migrate from pkg_resources to importlib.metadata (#374)
Browse files Browse the repository at this point in the history
Signed-off-by: Eric Avdey <[email protected]>
Co-authored-by: Chad Wilson <[email protected]>
  • Loading branch information
eiri and chadlwilson authored Jul 30, 2024
1 parent 0322c99 commit d14d93b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions check_and_install_getgauge.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from subprocess import check_output

import pkg_resources
from importlib.metadata import version, PackageNotFoundError


def get_version():
Expand All @@ -29,10 +29,10 @@ def assert_versions():
expected_gauge_version = python_plugin_version

try:
getgauge_version = pkg_resources.get_distribution('getgauge').version
getgauge_version = version('getgauge')
if getgauge_version != expected_gauge_version:
install_getgauge("getgauge=="+expected_gauge_version)
except pkg_resources.DistributionNotFound:
except PackageNotFoundError:
install_getgauge("getgauge=="+expected_gauge_version)


Expand Down
2 changes: 1 addition & 1 deletion python.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "python",
"version": "0.4.5",
"version": "0.4.6",
"description": "Python support for gauge",
"run": {
"windows": [
Expand Down

0 comments on commit d14d93b

Please sign in to comment.