Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced package "pkg_resources" with "packaging" #7953

Merged
merged 39 commits into from
Aug 9, 2024

Conversation

K-Rilla
Copy link
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
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

monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
Signed-off-by: dedeepyasai <dedeepyasai.sai@gmail.com>
K-Rilla and others added 11 commits July 27, 2024 10:37
Signed-off-by Kelvin R <kelvinrbNsc@gmail.com>
DCO Remediation Commit for saelra <rasaelee@gmail.com>

I, saelra <rasaelee@gmail.com>, hereby add my Signed-off-by to this commit: 77207ad

Signed-off-by: saelra <rasaelee@gmail.com>
I, saelra <rasaelee@gmail.com>, hereby add my Signed-off-by to this commit: 77207ad

Signed-off-by: saelra <rasaelee@gmail.com>
I, Kelvin R <kelvinrbNsc@gmail.com>, hereby add my Signed-off-by to this commit: 9656e43
I, Kelvin R <kelvinrbNsc@gmail.com>, hereby add my Signed-off-by to this commit: 598f70d
I, Kelvin R <kelvinrbNsc@gmail.com>, hereby add my Signed-off-by to this commit: df38261
I, Kelvin R <kelvinrbNsc@gmail.com>, hereby add my Signed-off-by to this commit: e0c4d21

Signed-off-by: Kelvin R <kelvinrbNsc@gmail.com>
Signed-off-by: Kelvin R <kelvinrbNsc@gmail.com>
@KumoLiu
Copy link
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!

monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
monai/utils/module.py Outdated Show resolved Hide resolved
requirements-dev.txt Outdated Show resolved Hide resolved
@KumoLiu
Copy link
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'

Saelra and others added 10 commits August 3, 2024 10:16
…xt file

Signed-off-by: DuretiShemsi <shemsidureti@gmail.com>
…y.github.com>

I, Dureti <98233210+DuretiShemsi@users.noreply.github.com>, hereby add my Signed-off-by to this commit: fe1a415

Signed-off-by: Dureti <98233210+DuretiShemsi@users.noreply.github.com>
Signed-off-by: Dureti <98233210+DuretiShemsi@users.noreply.github.com>
Signed-off-by: Dureti <98233210+DuretiShemsi@users.noreply.github.com>
Signed-off-by: Kelvin R <kelvinrbNsc@gmail.com>
@ericspod
Copy link
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.

ken-ni and others added 8 commits August 8, 2024 17:13
Signed-off-by: ken-ni <kennett.vera@gmail.com>
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
This reverts commit f8689c8.
…hub.com>

I, YunLiu <55491388+KumoLiu@users.noreply.github.com>, hereby add my Signed-off-by to this commit: e3c3490

Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
@KumoLiu
Copy link
Contributor

KumoLiu commented Aug 9, 2024

/build

1 similar comment
@KumoLiu
Copy link
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
28 checks passed
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 <dedeepyasai.sai@gmail.com>
Signed-off-by: saelra <rasaelee@gmail.com>
Signed-off-by: Kelvin R <kelvinrbNsc@gmail.com>
Signed-off-by: ken-ni <kennett.vera@gmail.com>
Signed-off-by: Dureti <98233210+DuretiShemsi@users.noreply.github.com>
Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Co-authored-by: saelra <rasaelee@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: dedeepyasai <dedeepyasai.sai@gmail.com>
Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
Co-authored-by: Ratanachat Saelee <146144408+Saelra@users.noreply.github.com>
Co-authored-by: ken-ni <kennett.vera@gmail.com>
Co-authored-by: Dureti <98233210+DuretiShemsi@users.noreply.github.com>
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