[Distutils] A prefix option?
ianb at colorstudy.com
Fri Feb 10 20:11:19 CET 2006
Phillip J. Eby wrote:
> Unfortunately, due to differences in path processing on Windows and 'nix,
> the above procedure appears to only work correctly on Windows. On 'nix,
> the current dir and/or script dir aren't on sys.path soon enough. *sigh*.
Would it help to use the -S option with the Python interpreter? You get
into the nuisance of #! inconsistencies if you want to pass in an
option, but maybe that's workable still. On Windows... well, I don't
know what you .exe wrapper does on Windows, but maybe you can
effectively do the same thing there. Then you could invoke 'import
site' when and how you want.
Also there's the idea that Jim had of generating shell scripts instead
of Python files, and the shell script sets PYTHONPATH. Again, if you
already have this kind of control on Windows with the .exe wrapper, then
you can make full use of the same thing on Posix.
The other thing to think about with this is how this interacts with
distutils/easy_install installations. I'd like it to be easy to make
installation work seemlessly; just like when you invoke a script in such
a isolated setup, it will then import from that setup, if you invoke
easy_install from such a setup it should install into the appropriate
location. Or there should be another option that controls that, instead
of just using -d -- using this other option would do more checks and be
more picky, because it would imply you are expecting a very specific
(and confirmable) layout.
Ian Bicking / ianb at colorstudy.com / http://blog.ianbicking.org
More information about the Distutils-SIG