Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Replaced package "pkg_resources" with "packaging"#7953

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

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

Conversation

@K-Rilla

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

Copy link
Copy Markdown
Contributor

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

KumoLiu commented Jul 26, 2024

Copy link
Copy Markdown
Contributor

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

Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
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

KumoLiu commented Jul 29, 2024

Copy link
Copy Markdown
Contributor

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!

Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
Comment thread monai/utils/module.py Outdated
Comment thread requirements-dev.txt Outdated
@KumoLiu

KumoLiu commented Aug 2, 2024

Copy link
Copy Markdown
Contributor

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'

Comment thread monai/utils/module.py
@ericspod

ericspod commented Aug 7, 2024

Copy link
Copy Markdown
Member

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

KumoLiu commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

/build

1 similar comment
@KumoLiu

KumoLiu commented Aug 9, 2024

Copy link
Copy Markdown
Contributor

/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