Porting from Distutils#
Setuptools and the PyPA have a stated goal to make Setuptools the reference API for distutils.
Since the 60.0.0 release, Setuptools includes a local, vendored copy of distutils (from late copies of CPython) that is enabled by default. To disable the use of this copy of distutils when invoking setuptools, set the enviroment variable:
As Distutils is deprecated, any usage of functions or objects from distutils is similarly discouraged, and Setuptools aims to replace or deprecate all such uses. This section describes the recommended replacements.
logging (standard library)
distutils.version.* → packaging.version.*
Migration advice is also provided by PEP 632.
If a project relies on uses of
distutils that do not have a suitable replacement above, please search the Setuptools issue tracker and file a request, describing the use-case so that Setuptools’ maintainers can investigate. Please provide enough detail to help the maintainers understand how distutils is used, what value it provides, and why that behavior should be supported.
Please notice errors related to the command line usage of
setup.py, such as
DistutilsArgError, are intentionally not exposed by setuptools, since this is considered a deprecated practice.