[Distutils] Re: [Python-Dev] PEP 250: Summary of comments

M.-A. Lemburg mal@lemburg.com
Wed, 18 Jul 2001 17:00:41 +0200

"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]
    '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/