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

Gustavo Narea gustavo at gnulinuxmatters.org
Sat Jul 19 19:32:48 CEST 2008


Hello, Phillip.

I don't really understand why, but if I don't run "build" my script works.

However I need "develop" because the Ant-like tool runs my test suite on a 
different folder for every svn revision. If I remove "build", I get an import 
error because my modules are not accessible.

Thanks for your help!

Cheers.

On Saturday 19 July 2008 00:27:02 Phillip J. Eby wrote:
> 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
> >
> >either:
> > > 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'
> >http://paste.turbogears.org/paste/3256
> >
> >Also, here's my repository
> > https://svn.gnulinuxmatters.org:81/animador/trunk/ and here you can
> > browse the source code:
> >https://tracker.gnulinuxmatters.org/browser/animador/trunk
> >
> >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.
> >http://www.gnulinuxmatters.org/
> >
> >
> >_______________________________________________
> >Distutils-SIG maillist  -  Distutils-SIG at python.org
> >http://mail.python.org/mailman/listinfo/distutils-sig


-- 
Gustavo Narea.
General Secretary. GNU/Linux Matters.
http://www.gnulinuxmatters.org/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20080719/52dacf9a/attachment.pgp>


More information about the Distutils-SIG mailing list