Skip to content

Commit

Permalink
Removed comments from pkg_resources
Browse files Browse the repository at this point in the history
  • Loading branch information
K-Rilla committed Jul 26, 2024
1 parent 94195e9 commit 9656e43
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 5 deletions.
3 changes: 0 additions & 3 deletions monai/utils/module.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,6 @@ def version_leq(lhs: str, rhs: str) -> bool:

lhs, rhs = str(lhs), str(rhs)
pkging, has_ver = optional_import("packaging", name="packaging")
# pkging, has_ver = optional_import("pkg_resources", name="packaging")
if has_ver:
try:
return cast(bool, version(lhs) <= version(rhs))
Expand Down Expand Up @@ -599,7 +598,6 @@ def version_geq(lhs: str, rhs: str) -> bool:
"""
lhs, rhs = str(lhs), str(rhs)
pkging, has_ver = optional_import("packaging", name="packaging")
# pkging, has_ver = optional_import("pkg_resources", name="packaging")
if has_ver:
try:
return cast(bool, version(lhs) >= version(rhs))
Expand Down Expand Up @@ -640,7 +638,6 @@ def pytorch_after(major: int, minor: int, patch: int = 0, current_ver_string: st
_env_var = os.environ.get("PYTORCH_VER", "")
current_ver_string = _env_var if _env_var else torch.__version__
ver, has_ver = optional_import("packaging.version", name="parse")
# ver, has_ver = optional_import("pkg_resources", name="parse_version")
if has_ver:
return ver(".".join((f"{major}", f"{minor}", f"{patch}"))) <= ver(f"{current_ver_string}") # type: ignore
parts = f"{current_ver_string}".split("+", 1)[0].split(".", 3)
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import sys
import warnings

# import pkg_resources
from packaging import version
from setuptools import find_packages, setup

Expand All @@ -41,7 +40,6 @@

BUILD_CUDA = FORCE_CUDA or (torch.cuda.is_available() and (CUDA_HOME is not None))

# _pt_version = pkg_resources.parse_version(torch.__version__).release
_pt_version = version.parse(torch.__version__).release
if _pt_version is None or len(_pt_version) < 3:
raise AssertionError("unknown torch version")
Expand Down

0 comments on commit 9656e43

Please sign in to comment.