[Distutils] `develop' doesn't appends my package's directory to sys.path

Phillip J. Eby pje at telecommunity.com
Sat Jul 19 00:27:02 CEST 2008

I would suggest setting DISTUTILS_DEBUG=yes in your environment when 
running both, and compare the other environment contents.  My guess 
is that you are either running a different Python executable or have 
a different HOME -- which might change what setup.cfg is being used, 
and thus the target install directory.

Notice in particular that the run for your wrapper script says that 
it is already present in easy-install.pth, while the other run does 
not.  This suggests that the target installation path is different.

Personally, however, I don't see the point of your script running 
"build" or "develop" prior to "test"; running "test" will both do a 
build and put the package on sys.path for the duration of the test 
run, so the preceding commands are redundant.  Also, if for some 
reason you *did* need to run all three in sequence, you could just do 
"setup.py build develop test" and save a lot of excess overhead and repetition.

At 10:07 PM 7/18/2008 +0200, Gustavo Narea wrote:
>Hello, everyone.
>I have an script which is supposed to run my test suite periodically, and the
>routine is basically this:
>  1.- It checkouts my app's source from the repository, and stores it in a
>different directory on every checkout.
>  2.- It runs setuptools build.
>  3.- It runs setuptools develop.
>  4.- It runs my test suite (via setuptools unittest).
>But setuptools' develop doesn't append my project's path to sys.path; I don't
>know what is going on, but I'm absolutely sure about that. Here is part of
>the verbose output of the script (it's actually not an script per se; I'm
>using an Ant like app, part of the Bitten continuous integration system):
> > [DEBUG   ] Executing <function exec_ at 0x83ccdf4> with arguments:
> > {'executable': './setup.py', 'args': 'develop'}
> > [DEBUG   ] Executing  ['./setup.py', 'develop']
>And because my package is not accessible, its modules are not accessible
> > ImportError: No module named build.lib.animador.config
>Then, from the Python interpreter, I check sys.path and I find that my
>package's path is not included. But if I manually run `setup.py develop', and
>then open the Python interpreter again, the path is included.
>Here's the output of my script http://paste.turbogears.org/paste/3255 and
>here's the full output of `setup.py develop'
>Also, here's my repository https://svn.gnulinuxmatters.org:81/animador/trunk/
>and here you can browse the source code:
>I hope someone can help me out; I have spent days trying to fix this.
>Thanks in advance.
>Gustavo Narea.
>General Secretary. GNU/Linux Matters.
>Distutils-SIG maillist  -  Distutils-SIG at python.org

More information about the Distutils-SIG mailing list