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

Remove use of deprecated python 3.12 strtobool #7900

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

hjmjohnson
Copy link
Contributor

distutils is not available in python 3.12, so a substitute is needed for the strtobool code.

Fixes #7899

Description

Replace distutils strtobool with local _strtobool version.

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.

@hjmjohnson hjmjohnson force-pushed the python312-no-distutils branch 3 times, most recently from 44f555a to 4f76238 Compare July 2, 2024 14:52
distutils is not available in python 3.12, so a substitute is needed
for the strtobool code.

Use same resolution as implemented by the ITK project.

Signed-off-by: Hans Johnson <[email protected]>
@hjmjohnson hjmjohnson force-pushed the python312-no-distutils branch from 4f76238 to 87862f0 Compare July 2, 2024 15:22
Due to the removal of the long-deprecated pkgutil.ImpImporter class
a newer version of setuptools that provides this capability.
for Python 3.12.

This resolves:

monai.utils.module.OptionalImportError: Please install mlflow
before using MLFlowHandler. (module 'pkgutil' has no attribute 'ImpImporter').

Signed-off-by: Hans Johnson <[email protected]>
@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 3, 2024

/build

@KumoLiu KumoLiu requested review from ericspod and Nic-Ma July 3, 2024 07:46
Copy link
Contributor

@mingxin-zheng mingxin-zheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@KumoLiu KumoLiu merged commit 58106a6 into Project-MONAI:dev Jul 3, 2024
28 checks passed
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.

distutils is removed in python 3.12+
3 participants