[py-dev] py.test and editors (Re: [issue57] Emacs and py.test tracebacks)

holger krekel holger at merlinux.eu
Wed Aug 13 19:40:47 CEST 2008


Hi Ralf, 

On Wed, Aug 13, 2008 at 19:14 +0200, Ralf Schmitt wrote:
> On Wed, Aug 13, 2008 at 6:32 PM, holger krekel <holger at merlinux.eu> wrote:
> 
> > another thing with setuptools: the way that py.test is
> > installed as a console script modifies the py lib lookup:
> > py/bin/py.test usually looks for a py lib upwards
> > from where you invokve it (the curdir) with the help of _findpy.py.
> 
> sometimes I have the feeling that you're using too much magic...

hum, it's a feature that has been of use to some people.  
let me ask: has it ever hit you badly?

> > this is important at least for pypy and when you are using py.test
> > to work on the py lib itself.   Do you have an idea
> > how to preserve this logic with setuptools?  Specifying
> > a module import path probably does not work because
> > then there is no chance anymore to influence which
> > py lib gets loaded.
> 
> setuptools creates the following py.test script for me:
> 
> #!/home/ralf/py26/bin/python
> # EASY-INSTALL-ENTRY-SCRIPT: 'py==0.9.2-pre-alpha','console_scripts','py.test'
> __requires__ = 'py==0.9.2-pre-alpha'
> import sys
> from pkg_resources import load_entry_point
> 
> sys.exit(
>    load_entry_point('py==0.9.2-pre-alpha', 'console_scripts', 'py.test')()
> )
> 
> I would rather be surprised if it used anything else than py lib
> version 0.9.2.-pre-alpha.

sure, but this is what setuptools creates, it's not what
py/bin/py.test specifies and what gets installed with a
distutils install.  

> Can't you just use the inplace installation? (i.e. eval py/env.py)?
> py/bin/py.test is still there..

i guess i could and probably also the others.  I'll think about it. 

If others like to chime in here, please do so. 

I can also imagine to just use a normal distutils setup.py 
for 0.9.2 based on what you did.  I recently i even had someone
not wanting to use setuptools based installs (for a different
project).  Btw, I actually assumed that python 2.5 came with setuptools 
but that is not the case, has just been discussed at some point, right? 

holger



More information about the Pytest-dev mailing list