[Distutils] How to make easy_install handle platlibs?
P.J. Eby
pje at telecommunity.com
Sun Apr 12 21:40:51 CEST 2009
At 12:36 AM 4/12/2009 -0700, Buck Golemon wrote:
>On Fri, Apr 10, 2009 at 9:15 PM, P.J. Eby
><<mailto:pje at telecommunity.com>pje at telecommunity.com> wrote:
>At 08:53 PM 4/10/2009 -0700, Buck wrote:
>I see the kernel version and architecture, but this is insufficient;
>RedHat 4 and RedHat 5 both use a 2.6 kernel, but the difference in
>provided libraries are sufficient to make many (most?) "impure"
>libraries stop working ( numpy, python-ldap, and hashlib for
>examples).
>
>easy_install apparently knows when packages are platform-dependant,
>and the necessary directory is sys.exec_prefix (or maybe better:
>distutils.sysconfig.get_python_lib(plat_specific=1) ), so this seems
>like an easy change. Would a patch be accepted?
>
>
>It would be a pretty major patch, since the distutils logic that's
>used for determining the installation directory is applied long
>before easy_install even knows what it's installing (and therefore,
>whether it's platform dependent).
>
>It would probably be a lot easier to improve the platform string
>generation and comparison logic, as has been done for OS X.
>
>If the distutils logic is used, then why does numpy install to the
>platlib folder using distutils, but into the nonplatlib folder using
>easy_install?
Please read what I wrote after the word "distutils", i.e.:
"""the distutils logic that's used for determining the installation
directory is applied long before easy_install even knows what it's
installing"""
That is, the installation directory is determined *before* any
packages are examined, so there is no way to know whether prefix or
exec-prefix should be used. So prefix is used to determine the
default installation location.
Currently, there's only a way to specify one installation location.
>Your tone seems to suggest that such an effort might be accepted upstream.
I'm suggesting that fixing the platform strings would be more
beneficial (i.e. benefit other use cases besides this one), and would
probably be a LOT easier to implement as a patch, because the changes
would be limited to the internals of a few well-defined, isolated functions.
Of course, if you happen to find some sane way to get easy_install to
do what you want, I'll certainly take a look at it. I'm just hard
pressed to imagine how you'd go about doing it without major
refactoring that would be very difficult to verify was done correctly.
More information about the Distutils-SIG
mailing list