Skip to content

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 <hans-johnson@uiowa.edu>
@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 <hans-johnson@uiowa.edu>
@KumoLiu
Copy link
Contributor

KumoLiu commented Jul 3, 2024

/build

@KumoLiu KumoLiu requested review from Nic-Ma and ericspod 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

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