We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47bcb65 commit 9ddab38Copy full SHA for 9ddab38
guardrails/hub/install.py
@@ -3,7 +3,7 @@
3
from string import Template
4
from typing import Callable, cast, List
5
6
-import pkg_resources
+import importlib.metadata
7
8
from guardrails.hub.validator_package_service import (
9
ValidatorPackageService,
@@ -149,7 +149,7 @@ def install(
149
installed_version_message = ""
150
with contextlib.suppress(Exception):
151
package_name = ValidatorPackageService.get_normalized_package_name(validator_id)
152
- installed_version = pkg_resources.get_distribution(package_name).version
+ installed_version = importlib.metadata.version(package_name)
153
if installed_version:
154
installed_version_message = f" version {installed_version}"
155
0 commit comments