Skip to content

Commit

Permalink
[Docs] Improve documentation about migration from distutils (#3171)
Browse files Browse the repository at this point in the history
  • Loading branch information
abravalheri committed Mar 13, 2022
2 parents ba25a5f + 19609c0 commit a2e8ef9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions docs/conf.py
Expand Up @@ -200,6 +200,7 @@

intersphinx_mapping['pip'] = 'https://pip.pypa.io/en/latest', None
intersphinx_mapping['PyPUG'] = ('https://packaging.python.org/en/latest/', None)
intersphinx_mapping['packaging'] = ('https://packaging.pypa.io/en/latest/', None)
intersphinx_mapping['importlib-resources'] = (
'https://importlib-resources.readthedocs.io/en/latest', None
)
12 changes: 7 additions & 5 deletions docs/deprecated/distutils-legacy.rst
Expand Up @@ -3,11 +3,10 @@ Porting from Distutils

Setuptools and the PyPA have a `stated goal <https://github.com/pypa/packaging-problems/issues/127>`_ to make Setuptools the reference API for distutils.

Since the 49.1.2 release, Setuptools includes a local, vendored copy of distutils (from late copies of CPython) that is disabled by default. To enable the use of this copy of distutils when invoking setuptools, set the enviroment variable:
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:

SETUPTOOLS_USE_DISTUTILS=local
SETUPTOOLS_USE_DISTUTILS=stdlib

This behavior is planned to become the default.

Prefer Setuptools
-----------------
Expand All @@ -20,12 +19,15 @@ As Distutils is deprecated, any usage of functions or objects from distutils is

``distutils.command.{build_clib,build_ext,build_py,sdist}`` → ``setuptools.command.*``

``distutils.log`` → (no replacement yet)
``distutils.log`` → :mod:`logging` (standard library)

``distutils.version.*`` → ``packaging.version.*``
``distutils.version.*`` → :doc:`packaging.version.* <packaging:version>`

``distutils.errors.*`` → ``setuptools.errors.*`` [#errors]_


Migration advice is also provided by :pep:`PEP 632 <632#migration-advice>`.

If a project relies on uses of ``distutils`` that do not have a suitable replacement above, please search the `Setuptools issue tracker <https://github.com/pypa/setuptools/issues/>`_ 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.


Expand Down

0 comments on commit a2e8ef9

Please sign in to comment.