[py-dev] revised proposal for py.test/tool install

schmir at gmail.com schmir at gmail.com
Wed Dec 23 14:04:37 CET 2009


holger krekel <holger at merlinux.eu> writes:

>
> Just had a chat on #distutils with Tarek - we are not sure it's generally
> useful.  After all, the general solution for the need for different
> interpreter contexts is to use virtualenv or PEP370 and most installed

But your solution does not work for virtualenv (when using the same
version of python).

> scripts have no need for the version-differentiations (easy_install/pip
> and py.test are exceptions because they want to run in whatever
> global or local context, that's part of their purpose). 
>

pip is no exception, just like easy_install and py.test are no
exceptions. and just like py.which, which is no exception (hint: you'll
probably also want to version that one)

I use a pip script installed in ~/bin for different virtualenvs. there
is no need to install the same pip version in different virtualenvs, nor
is there a need to version the pip binary. This works for me cause it
chooses the right python interpreter for me when I run it (i.e. I use
"#! /usr/bin/env python" as a shebang).

scons also uses an install scheme, where the scons script contains the
above shebang and works with whatever python is first on PATH.

btw. I've also ran py.test with the *wrong* python interpreter multiple
times. versioning the py.test script would not have helped me a single
time. 

spurred by this discussion I'm now creating a single file py.test script
which includes the whole py library. This would allow people to drop
that script in ~/bin/ and run it with any virtualenv they are using
*without* installing the py lib first (well strictly speaking it is
installed as a single file). What do you think about that?

regards,
- ralf



More information about the Pytest-dev mailing list