Skip to content

Replaced package "pkg_resources" with "packaging"#7953

Merged
KumoLiu merged 39 commits intoProject-MONAI:devfrom
K-Rilla:dev
Aug 9, 2024
Merged

Replaced package "pkg_resources" with "packaging"#7953
KumoLiu merged 39 commits intoProject-MONAI:devfrom
K-Rilla:dev

Conversation

@K-Rilla
Copy link
Copy Markdown
Contributor

@K-Rilla K-Rilla commented Jul 26, 2024

Fixes #7559 .

Description

Replaced "pkg_resources" references with "packaging" in MONAI/monai/utils/module.py & setup.py
Changes were made in functions "pytorch_after", "version_leq", "version_geq".

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).

@KumoLiu
Copy link
Copy Markdown
Contributor

KumoLiu commented Jul 26, 2024

please also include the packaging in the "requirements-min.txt" to avoid the test error. Thanks!
https://github.com/Project-MONAI/MONAI/blob/dev/requirements-min.txt

K-Rilla and others added 11 commits July 27, 2024 10:37
Signed-off-by Kelvin R <[email protected]>
DCO Remediation Commit for saelra <[email protected]>

I, saelra <[email protected]>, hereby add my Signed-off-by to this commit: 77207ad

Signed-off-by: saelra <[email protected]>
I, saelra <[email protected]>, hereby add my Signed-off-by to this commit: 77207ad

Signed-off-by: saelra <[email protected]>
I, Kelvin R <[email protected]>, hereby add my Signed-off-by to this commit: 9656e43
I, Kelvin R <[email protected]>, hereby add my Signed-off-by to this commit: 598f70d
I, Kelvin R <[email protected]>, hereby add my Signed-off-by to this commit: df38261
I, Kelvin R <[email protected]>, hereby add my Signed-off-by to this commit: e0c4d21

Signed-off-by: Kelvin R <[email protected]>
Signed-off-by: Kelvin R <[email protected]>
@KumoLiu
Copy link
Copy Markdown
Contributor

KumoLiu commented Jul 29, 2024

Hi @K-Rilla, please take a look at the comments, I guess you misunderstand several points. Feel free ask if you met any issue. Thanks!

@KumoLiu
Copy link
Copy Markdown
Contributor

KumoLiu commented Aug 2, 2024

Please help take a look at the ci error. Thanks.

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/runner/work/MONAI/MONAI/monai/__init__.py", line 40, in <module>
    from .utils.module import load_submodules  # noqa: E402
  File "/home/runner/work/MONAI/MONAI/monai/utils/__init__.py", line 20, in <module>
    from .enums import (
  File "/home/runner/work/MONAI/MONAI/monai/utils/enums.py", line 617, in <module>
    @deprecated(since="1.2", removed="1.4", msg_suffix="please use `AlgoKeys` instead.")
  File "/home/runner/work/MONAI/MONAI/monai/utils/deprecate_utils.py", line 73, in deprecated
    if since is not None and removed is not None and not version_leq(since, removed):
  File "/home/runner/work/MONAI/MONAI/monai/utils/module.py", line 570, in version_leq
    except pkging.version.Version.InvalidVersion:
AttributeError: module 'packaging' has no attribute 'version'

@ericspod
Copy link
Copy Markdown
Member

ericspod commented Aug 7, 2024

From the CI issue with building the wheel, packaging may be needed in places like here where setup-related things are installed with pip.

@KumoLiu
Copy link
Copy Markdown
Contributor

KumoLiu commented Aug 9, 2024

/build

1 similar comment
@KumoLiu
Copy link
Copy Markdown
Contributor

KumoLiu commented Aug 9, 2024

/build

@KumoLiu KumoLiu enabled auto-merge (squash) August 9, 2024 08:54
@KumoLiu KumoLiu merged commit 6be7b13 into Project-MONAI:dev Aug 9, 2024
rcremese pushed a commit to rcremese/MONAI that referenced this pull request Sep 2, 2024
Fixes Project-MONAI#7559 .

### Description  
Replaced "pkg_resources" references with "packaging" in
MONAI/monai/utils/module.py & setup.py
Changes were made in functions "pytorch_after", "version_leq",
"version_geq".

### Types of changes
- Non-breaking change (fix or new feature that would not break existing
functionality).

---------

Signed-off-by: dedeepyasai <[email protected]>
Signed-off-by: saelra <[email protected]>
Signed-off-by: Kelvin R <[email protected]>
Signed-off-by: ken-ni <[email protected]>
Signed-off-by: Dureti <[email protected]>
Signed-off-by: YunLiu <[email protected]>
Co-authored-by: saelra <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dedeepyasai <[email protected]>
Co-authored-by: YunLiu <[email protected]>
Co-authored-by: Ratanachat Saelee <[email protected]>
Co-authored-by: ken-ni <[email protected]>
Co-authored-by: Dureti <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DeprecationWarning: pkg_resources is deprecated as an API in utils/module.py

7 participants