On Wed, Mar 27, 2013 at 1:13 PM, Amaury Forgeot d'Arc <amaur...@gmail.com>wrote:

> 2013/3/27 Vinay Sajip <vinay_sa...@yahoo.co.uk>
>
>> When you mount a wheel, its absolute path name is added to
>> sys.path, allowing the Python code in it to be imported.
>>
>
> Better: just put the wheel path to sys.path
>     sys.path.append('/tmp/simplejson-3.1.2-cp27-none-linux_x86_64.whl')
> and let a sys.path_hook entry do the job.
>
> Such a WheelImporter could even inherit from zipimporter, plus the magic
> required for C extensions.
>

I implemented just such a path hook ---- zipimporter plus the magic
required for C extensions --- as a challenge to myself to learn more about
the Python import mechanisms.

See https://github.com/bfroehle/pydzipimport.

Cheers,
Brad
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to