[Python-ideas] python_modules as default directory for dependencies in distutils

Christian Tismer tismer at stackless.com
Thu Nov 22 21:23:14 CET 2012


On 11/21/12 2:38 PM, Nick Coghlan wrote:
> On Wed, Nov 21, 2012 at 7:50 PM, Philipp Hagemeister <phihag at phihag.de 
> <mailto:phihag at phihag.de>> wrote:
>
>     On 11/21/2012 04:27 AM, Nick Coghlan wrote:
>     > Or install them all in a single directory, add a __main__.py
>     file to that
>     > directory and then just pass that directory name on the command line
>     > instead of a script name. The directory will be added as
>     sys.path[0] and
>     > the __main__.py file will be executed as the main module (If your
>     > additional application dependencies are all pure Python files,
>     you can even
>     > zip up that directory and pass that on the command line instead).
>     I'm well-aware of that approach, but didn't apply it to dependencies,
>     and am still not sure how to. Can you describe how a hypothetical
>     helloworld application with one dependency would look like? And
>     wouldn't
>     one sacrifice the ability to seamlessly import from the application's
>     code itself.
>
>
> One directory containing:
>
>   runthis/
>        __main__.py
>            (with content as described for your main.py)
>        lxml
>        myapp
>
> Execute "python runthis" (via a +x shell script if you prefer). Note 
> the lack of -m: you're executing the directory contents, not a 
> package. You can also bundle it all into a zip file, but that only 
> works if you don't need C extension support (since zipimport can't 
> handle the necessary step of extracting the shared libraries out to 
> separate files so the OS can load them.

Hi Nick,

This would actually be very nice if we could go this far! ;-)
Maybe with some Ramdisk support or something.
A problem might be to handle RPath issues on the fly.
I've actually learnt about this when working on the pyside setup,
was not aware of the problem, before.

Do you think it would make sense for me to put time into this?

cheers - chris

-- 
Christian Tismer             :^)   <mailto:tismer at stackless.com>
Software Consulting          :     Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121     :    *Starship* http://starship.python.net/
14482 Potsdam                :     PGP key -> http://pgp.uni-mainz.de
phone +49 173 24 18 776  fax +49 (30) 700143-0023
PGP 0x57F3BF04       9064 F4E1 D754 C2FF 1619  305B C09C 5A3B 57F3 BF04
       whom do you want to sponsor today?   http://www.stackless.com/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20121122/63be05f7/attachment.html>


More information about the Python-ideas mailing list