cpython/Lib/distutils/command
Lumír 'Frenzy' Balhar 341e8a939a
bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549)
With this patch, `distutils.command.install.INSTALL_SCHEMES` are loaded from
`sysconfig._INSTALL_SCHEMES`.

The distutils module is deprecated and will be removed in 3.12 (PEP 632).
This change makes the `sysconfig._INSTALL_SCHEMES` the single point of truth
for install schemes while keeping `distutils.command.install.INSTALL_SCHEMES`
exactly the same. If we, during the transition to the sysconfig, change
something, this makes sure that it also propagates to distutils until the
module gets removed.

Moreover, as discussed [on Discourse], Linux distros need to patch
distutils/sysconfig to make sure the packages will land in proper locations.
This patch makes it easier because it leaves only one location where install
schemes are defined which is much easier to patch/adjust.

[on Discourse]: https://discuss.python.org/t/pep-632-deprecate-distutils-module/5134

The implementation is slightly different than the plan but I think it's the
easiest way how to do it and it also makes the downstream patch simple,
flexible and easy to maintain.

It's also necessary to implement this before setuptools starts bundling
the distutils module so the default install schemes stay in the standard library.

The removed code from sysconfig does not seem to have any negative effect
because, honestly, it seems that nothing actually uses the install schemes
from sysconfig at all. There were many big changes in these modules where
they were trying to include packaging in stdlib and then reverted that.
Also, the test of distutils install command does not count with the different
locations which is good evidence that the reason to have this piece of code
is no longer valid.


https://bugs.python.org/issue41282
2021-04-14 17:12:34 +02:00
..
__init__.py bpo-42802: Remove distutils bdist_wininst command (GH-24043) 2021-01-09 00:35:01 +01:00
bdist.py bpo-42802: Remove distutils bdist_wininst command (GH-24043) 2021-01-09 00:35:01 +01:00
bdist_dumb.py bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) 2018-11-05 16:20:25 +02:00
bdist_msi.py bpo-42802: Remove distutils bdist_wininst command (GH-24043) 2021-01-09 00:35:01 +01:00
bdist_rpm.py bpo-40443: Remove unused imports in distutils (GH-19802) 2020-04-30 11:28:09 +02:00
build.py bpo-28552: Fix distutils.sysconfig for empty sys.executable (GH-12875) 2019-04-25 11:59:34 +02:00
build_clib.py
build_ext.py bpo-39432: Implement PEP-489 algorithm for non-ascii "PyInit_*" symbol names in distutils (GH-18150) 2020-02-04 07:24:30 -08:00
build_py.py bpo-41043: Escape literal part of the path for glob(). (GH-20994) 2020-06-20 11:10:31 +03:00
build_scripts.py #27364: fix "incorrect" uses of escape character in the stdlib. 2016-09-08 13:59:53 -04:00
check.py bpo-40443: Remove unused imports in distutils (GH-19802) 2020-04-30 11:28:09 +02:00
clean.py
command_template
config.py bpo-11191: skip unsupported test_distutils case for AIX with xlc (GH-8709) 2018-12-29 00:03:17 +10:00
install.py bpo-41282: (PEP 632) Load install schemes from sysconfig (GH-24549) 2021-04-14 17:12:34 +02:00
install_data.py
install_egg_info.py Issue #25985: sys.version_info is now used instead of sys.version 2016-02-11 13:10:36 +02:00
install_headers.py
install_lib.py
install_scripts.py
register.py Closes #27904: Improved logging statements to defer formatting until needed. 2016-08-31 08:22:29 +01:00
sdist.py bpo-22831: Use "with" to avoid possible fd leaks in distutils. (GH-10921) 2018-12-20 19:00:14 +02:00
upload.py bpo-40698: Improve distutils upload hash digests (GH-20260) 2020-05-20 07:37:25 -07:00