FOSSEE / eSim

This repository contain source code for new flow of FreeEDA now know as eSim
GNU General Public License v3.0
84 stars 75 forks source link

Removed distutils dependency #281

Closed avinashlalotra closed 1 month ago

avinashlalotra commented 1 month ago

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.