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

Skip to content

Remove use of deprecated python 3.12 strtobool#7900

Merged
KumoLiu merged 2 commits into
Project-MONAI:devfrom
hjmjohnson:python312-no-distutils
Jul 3, 2024
Merged

Remove use of deprecated python 3.12 strtobool#7900
KumoLiu merged 2 commits into
Project-MONAI:devfrom
hjmjohnson:python312-no-distutils

Conversation

@hjmjohnson

Copy link
Copy Markdown
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.

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]>
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

KumoLiu commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

/build

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

@mingxin-zheng mingxin-zheng left a comment

Copy link
Copy Markdown
Collaborator

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