PEP 250: Summary of comments
Having waited a few days to let the dust settle, I believe that the following is the current state of affairs: 1. The change to site.py, to include site-packages in sys.path, is in. 2. The change to distutils.sysconfig to change to site-packages, is in. 3. The Windows Installer still needs changes: a) site.py should change to export a "sys.extinstallpath" which points to site-packages b) the Windows Installer should use this, rather than the registry I see no great issue with 3a - it should be a pretty trivial change. Can someone with access to the sources make it? I attach a suggested patch. Item 3b is the key point - it's pretty critical that the Windows Installer change to use the new directory, otherwise, most of the work is a waste. I can't do much about this, as I haven't even seen the source yet. Can someone do something about this? On point 3a, sys.extinstallpath should be set for all platforms, but I have to admit that I don't know what to do for non-Windows platforms. The best I can suggest is that we do something like if os.sep == '/': sys.extinstallpath = os.path.join(sys.prefix, "lib", "python" + sys.version[:3], "site-packages") else: sys.extinstallpath = os.path.join(sys.prefix, "lib", "site-packages") which matches the sys.path setting for Unix - but I couldn't really offer this as a patch, as I don't understand the issues around site-packages vs site-python on Unix. All I could say is that it's better than leaving sys.extinstallpath unset on some platforms. To summarise the summary: 1. The patch to site.py to expose sys.extinstallpath should be made, at least for Windows. 2. The Windows Installer needs to be updated to use sys.extinstallpath for Python 2.2 and greater. 3. If the Mac people want, the same can be done for Mac. 4. If the Unix people have a consensus, that should go in too (affects site.py, bdist_rpm, at least). As a side benefit, if this goes in, bdist_wininst will start working for Pythons which don't use the registry (such as the PythonLabs ones). Sadly, I note that I've just missed the 2.2a1 release. Is anyone likely to be able to do anything about this prior to 2.2a2? (If someone sends me a pointer to the wininst sources, I'll look into what's involved in a patch, assuming no-one else has adequate time). Paul. PS As documentation of sys.extinstallpath, I'd suggest something like: sys.extinstallpath: The directory into which Python extensions should be installed. This is merely a recommendation - Python will pick up extensions which are located anywhere along sys.path. However, extension installers should use this directory by default. The distutils package (and installers built with it) will use this directory (XXX - currently not trie for bdist_rpm, I guess). Patch for site.py (point 3a - Windows only, from Thomas Heller) --- \Applications\Python\lib\site.py.orig Tue Jun 26 10:07:06 2001 +++ \Applications\Python\lib\site.py Wed Jul 18 14:43:54 2001 @@ -148,6 +148,9 @@ if os.path.isdir(sitedir): addsitedir(sitedir) +if os.sep == '\\': # != '/' if you want to do all except Unix like this... + sys.extinstallpath = os.path.join(sys.prefix, "lib", "site-packages") + # Define new built-ins 'quit' and 'exit'. # These are simply strings that display a hint on how to exit. if os.sep == ':':
Moore, Paul writes:
On point 3a, sys.extinstallpath should be set for all platforms, but I have to admit that I don't know what to do for non-Windows platforms. The best I can suggest is that we do something like
if os.sep == '/': sys.extinstallpath = os.path.join(sys.prefix, "lib", "python" + sys.version[:3], "site-packages") else: sys.extinstallpath = os.path.join(sys.prefix, "lib", "site-packages")
There's one aspect that doesn't appear to have been addressed for Unix: there are two reasonable values for extinstallpath. In multi-architecture installations, where the Python portions of the library are shared among architectures, there are two site-packages directories: $prefix/lib/pythonX.Y/site-packages/ and $exec_prefix/lib/pythonX.Y/site-packages/ When $prefix and $exec_prefix are the same, this isn't an issue, but for this is a problem for multi-platform installations. -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
"Fred L. Drake, Jr." wrote:
Moore, Paul writes:
On point 3a, sys.extinstallpath should be set for all platforms, but I have to admit that I don't know what to do for non-Windows platforms. The best I can suggest is that we do something like
if os.sep == '/': sys.extinstallpath = os.path.join(sys.prefix, "lib", "python" + sys.version[:3], "site-packages") else: sys.extinstallpath = os.path.join(sys.prefix, "lib", "site-packages")
There's one aspect that doesn't appear to have been addressed for Unix: there are two reasonable values for extinstallpath. In multi-architecture installations, where the Python portions of the library are shared among architectures, there are two site-packages directories:
$prefix/lib/pythonX.Y/site-packages/
and
$exec_prefix/lib/pythonX.Y/site-packages/
When $prefix and $exec_prefix are the same, this isn't an issue, but for this is a problem for multi-platform installations.
I don't think this is an issue since distutils already knows that extension package live in .../site-package on Unix. The Windows install and unix_home are the only ones which copy the files into non-standard dirs (Unix seems to be the only target which supports multi-platform installs out-of-the-box): [taken from distutils.commands.install] """ INSTALL_SCHEMES = { 'unix_prefix': { 'purelib': '$base/lib/python$py_version_short/site-packages', 'platlib': '$platbase/lib/python$py_version_short/site-packages', 'headers': '$base/include/python$py_version_short/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'unix_home': { 'purelib': '$base/lib/python', 'platlib': '$base/lib/python', 'headers': '$base/include/python/$dist_name', 'scripts': '$base/bin', 'data' : '$base', }, 'nt': { 'purelib': '$base', 'platlib': '$base', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', }, 'mac': { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', } } """ Paul, note that your patches don't even touch install.py -- are your sure that the patch to sysconfig.py suffices to have distutils install the extensions into site-packages on Windows ? (I believe that install.py would have to be told about sys.extinstallpath too and that it should fallback to the defaults given in the install schemes if it is not set.) -- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
M.-A. Lemburg writes:
I don't think this is an issue since distutils already knows that extension package live in .../site-package on Unix.
Frankly, I'm not convinced that there's a need for extinstallpath. Why not define INSTALL_SCHEMES like this: if sys.version < "2.2": WINDOWS_SCHEME = { 'purelib': '$base', 'platlib': '$base', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', } else: WINDOWS_SCHEME = { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', } INSTALL_SCHEMES = { 'nt': WINDOWS_SCHEME, ... } -Fred -- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
"Fred L. Drake, Jr." wrote:
M.-A. Lemburg writes:
I don't think this is an issue since distutils already knows that extension package live in .../site-package on Unix.
Frankly, I'm not convinced that there's a need for extinstallpath.
Uhm... that's what I implied (or at least tried to imply) with my reply ;-)
Why not define INSTALL_SCHEMES like this:
if sys.version < "2.2": WINDOWS_SCHEME = { 'purelib': '$base', 'platlib': '$base', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', } else: WINDOWS_SCHEME = { 'purelib': '$base/Lib/site-packages', 'platlib': '$base/Lib/site-packages', 'headers': '$base/Include/$dist_name', 'scripts': '$base/Scripts', 'data' : '$base', }
INSTALL_SCHEMES = { 'nt': WINDOWS_SCHEME, ... }
-Fred
-- Fred L. Drake, Jr. <fdrake at acm.org> PythonLabs at Digital Creations
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org http://mail.python.org/mailman/listinfo/distutils-sig
-- Marc-Andre Lemburg CEO eGenix.com Software GmbH ______________________________________________________________________ Consulting & Company: http://www.egenix.com/ Python Software: http://www.lemburg.com/python/
participants (3)
-
Fred L. Drake, Jr.
-
M.-A. Lemburg
-
Moore, Paul