Changes between Initial Version and Version 1 of Ticket #14087, comment 9


Ignore:
Timestamp:
Mar 1, 2012, 5:11:48 AM (12 years ago)
Author:
Ramiro Morales

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #14087, comment 9

    initial v1  
    22
    33I did a bit more investigation why the init file is being skipped. The skipping of the init file happens when you use the "--single-version-externally-managed" option during install (e.g. python setup.py install --single-version-externally-managed). Pip automatically adds this option by default and as far as I can read it's also used by system package builders (like e.g. Debian or rpms). What setuptools does with this option is to add a .pth file for each part of a namespace module - e.g.:
    4 
     4{{{
    55site-packages/
    6   <namespace pacakge>_app1_<version>-nspkg.pth
    7   <namespace pacakge>_app2_<version>-nspkg.pth
     6  <namespace package>_app1_<version>-nspkg.pth
     7  <namespace package>_app2_<version>-nspkg.pth
    88...
    9   <namespace pacakge>/app1
    10   <namespace pacakge>/app2
    11 
     9  <namespace package>/app1
     10  <namespace package>/app2
     11}}}
    1212The pth files contains a bit of python which will be loaded by the '''site''' module when you start python. This piece of code in the pth file will add <namespace pacakge> as a builtin module and set the modules __path__ variable. So while find_module will not be able to locate the module, the module will already be loaded and available in sys.modules.
    1313
Back to Top