Skip to content

Commit 967f4ad

Browse files
committed
updated packaging in setup, utils
Signed-off-by: dedeepyasai <dedeepyasai.sai@gmail.com>
1 parent ab3ae73 commit 967f4ad

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

docs/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,4 @@ onnxruntime; python_version <= '3.10'
4141
zarr
4242
huggingface_hub
4343
pyamg>=5.0.0
44+
packaging

monai/utils/module.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import torch
3131

3232
import importlib.metadata
33-
from packaging import version
3433

3534

3635
# bundle config system flags
@@ -567,10 +566,10 @@ def version_leq(lhs: str, rhs: str) -> bool:
567566
"""
568567

569568
lhs, rhs = str(lhs), str(rhs)
570-
pkging, has_ver = optional_import("packaging", name="packaging")
569+
pkging, has_ver = optional_import("packaging")
571570
if has_ver:
572571
try:
573-
return cast(bool, version(lhs) <= version(rhs))
572+
return cast(bool, pkging.version.Version(lhs) <= pkging.version.Version(rhs))
574573
except version.InvalidVersion:
575574
return True
576575

@@ -594,10 +593,10 @@ def version_geq(lhs: str, rhs: str) -> bool:
594593
595594
"""
596595
lhs, rhs = str(lhs), str(rhs)
597-
pkging, has_ver = optional_import("packaging", name="packaging")
596+
pkging, has_ver = optional_import("packaging")
598597
if has_ver:
599598
try:
600-
return cast(bool, version(lhs) >= version(rhs))
599+
return cast(bool, pkging.version.Version(lhs) >= pkging.version.Version(rhs))
601600
except version.InvalidVersion:
602601
return True
603602

requirements-dev.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ nvidia-ml-py
5959
huggingface_hub
6060
pyamg>=5.0.0
6161
git+https://github.com/Project-MONAI/GenerativeModels.git@7428fce193771e9564f29b91d29e523dd1b6b4cd
62+
packaging

requirements-min.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ setuptools>=50.3.0,<66.0.0,!=60.6.0 ; python_version < "3.12"
44
setuptools>=70.2.0; python_version >= "3.12"
55
coverage>=5.5
66
parameterized
7+
packaging

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ pyyaml =
137137
pyyaml
138138
fire =
139139
fire
140+
packaging =
141+
packaging
140142
jsonschema =
141143
jsonschema
142144
pynrrd =

0 commit comments

Comments
 (0)