New submission from Filipe Laíns <[email protected]>:
As part of the distutils migration we plan to add a mechanism to let Python
distributors to add site install schemes.
Currently, Python distributors are patching distutils to add custom install
schemes for their packages. I think most of the reasoning boils down to them
wanting to stop Python installers, such as pip, to modify/interfere with their
packages.
With the distutils deprecation, and it becoming a 3rd party module, Python
distributors can no longer patch it. Because of this, we made distutils use the
sysconfig module instead, which fixes the issue at the moment -- Python
distributors can now patch sysconfig itself -- but is not a long term solution.
To prevent Python distributors from having to patch implementation details, and
have things break unexpectedly, we aim to introduce a system that distributors
can use for this purpose.
The idea is that they have a config file, which they can pass to configure, and
in that config file they can specify some extra install schemes. These install
schemes will get added in sysconfig, and will be loaded in the site module
initialization.
In practice, it will look something like this:
config.py
```
EXTRA_SITE_INSTALL_SCHEMES = {
'posix_prefix': {
'stdlib': '{installed_base}/{platlibdir}/python{py_version_short}',
'platstdlib': '{platbase}/{platlibdir}/python{py_version_short}',
'purelib': '{base}/lib/python{py_version_short}/vendor-packages',
'platlib':
'{platbase}/{platlibdir}/python{py_version_short}/vendor-packages',
'include':
'{installed_base}/include/python{py_version_short}{abiflags}',
'platinclude':
'{installed_platbase}/include/python{py_version_short}{abiflags}',
'scripts': '{base}/bin',
'data': '{base}',
},
}
```
./configure --with-vendor-config=config.py
----------
components: Library (Lib)
messages: 392326
nosy: FFY00, jaraco
priority: normal
pull_requests: 24414
severity: normal
status: open
title: Introduce mechanism to allow Python distributors to add custom site
install schemes
type: enhancement
versions: Python 3.10
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue43976>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com