[Python-Dev] PEP 250: Summary of comments
Wed, 18 Jul 2001 14:57:06 +0100
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
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.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).
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.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 == ':':