[Distutils] setup.py develop un-egg-spected result

Oliver Schoenborn oliver.schoenborn at utoronto.ca
Tue Mar 25 15:39:31 CET 2008


I have a problem with "setup.py develop" installation.

I have the following folder tree:

pubsub
    \- setup.py
    \- extern
       \- module0.py
    \- core
       \- __init__.py
       \- module1.py
       \- module2.py
       \- ...

I want my setup.py to install modules from pubsub/extern (such as  
module0.py) into site-packages, and to install the 'core' package in  
site-packages as pubsubcore:

setup(
     ...
     py_modules   = ['module0'],
     packages     = ['pubsubcore'],
     package_dir  = {'': 'extern', 'pubsubcore':'core'},
     scripts      = [],
     ...
)

For sdist, bdist, bdist_egg etc, it works: the output shows module0 is  
in the "root" of the distribution, together with a package named  
"pubsubcore" which contains what is in 'pubsub/core'.

HOWEVER, and here is the problem: when I do "setup.py develop" (this  
is on WinXP with Python 2.4.4 and the latest stable setuptools), only  
the contents of 'extern' get 'installed':

C:\Documents and Settings\schoenb\My Documents\pubsub>setup.py develop
running develop
running egg_info
writing external\PyPubSub.egg-info\PKG-INFO
writing top-level names to external\PyPubSub.egg-info\top_level.txt
writing dependency_links to external\PyPubSub.egg-info\dependency_links.txt
writing manifest file 'external\PyPubSub.egg-info\SOURCES.txt'
running build_ext
Creating c:\python24\lib\site-packages\PyPubSub.egg-link (link to external)
Adding PyPubSub 3.0a6 to easy-install.pth file
Installed c:\documents and settings\schoenb\my documents\pubsub\extern
Processing dependencies for PyPubSub==3.0a6

The above allows me, as the developer, to do "import module0" but not  
"import pubsubcore". Indeed, looking at  
\python24\lib\site-packages\easy-install.pth, there is only one new  
line added, pointing to c:\documents and settings\schoenb\my  
documents\pubsub\extern. There should be a second line added for the  
package, ie

c:\documents and settings\schoenb\my documents\pubsub

so that I (developer) can do "import pubsubcore", just as any user  
would be able to if I had done a full install. When I add the above  
line manually to the .pth file the "developer" installation works as  
expected.

What am I doing wrong? Thanks,

Oliver




More information about the Distutils-SIG mailing list