[Warning] Replace distutils.spawn.find_executable with shutil.which
The package distutils is deprecated and slated for removal in Python 3.12. We are using the function find_executable that belongs to that package. We should instead be using which from the package shutil.
Therefore we should make the change from
from distutils.spawn import find_executable
to
from shutil import which
https://github.com/aws/sagemaker-python-sdk/blob/98bbea65e4c8021ee37fb3609f4aad943c64d771/src/sagemaker/local/image.py#L33
And the change from
if find_executable("docker-compose") is None:
to
if which("docker-compose") is None:
https://github.com/aws/sagemaker-python-sdk/blob/98bbea65e4c8021ee37fb3609f4aad943c64d771/src/sagemaker/local/image.py#L90
I think this can be considered closed with #4837 @santigandolfo?
This is resolved as of this PR - https://github.com/aws/sagemaker-python-sdk/pull/4837