Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
shutil can be used in place of distutils .
Related Issues
issue 277
Purpose
To completely remove dependency on the deprecated distutils API and ensure the eSim project is aligned with modern Python practices by using shutil.which for executable checks.
Approach
The distutils library has been deprecated in newer Python versions, and while previous updates have transitioned to using setuptools, one file still incorrectly references distutils. This PR addresses the issue by:
Removing distutils Dependency
: Eliminates the use of distutils.spawn.find_executable in the codebase.Updating to Modern Practice
: Replaces distutils checks with shutil.which, which is the recommended approach for checking executable paths.Installation Script Update: We can then remove the distutils installation command from the installation script, ensuring there are no lingering dependencies on the deprecated library.
#Verification:
A search using grep confirmed that distutils is only used in the updated file. Please review and verify if there are any other instances of distutils in the codebase to ensure complete removal.
This change modernizes the codebase and aligns it with current best practices, avoiding issues related to deprecated libraries.