[TIP] coverage.py with Py2 and Py3
Sean Robinson
seankrobinson at gmail.com
Mon Apr 11 06:35:18 PDT 2011
On Sat, Apr 9, 2011 at 10:34 AM, Arfrever Frehtes Taifersar Arahesis
<arfrever.fta at gmail.com> wrote:
> 2011-04-09 16:39:40 Sean Robinson napisał(a):
>> How can I install coverage.py for use in both Py2 and Py3? I
>> installed coverage.py for Py2, but it looks like installing it in Py3,
>> also, will overwrite the script launcher to use Py3. Is there a way
>> to use coverage.py in both, serially?
>
> In Gentoo, we are automatically renaming target scripts to e.g. /usr/bin/coverage-2.7 and
> /usr/bin/coverage-3.2 and generating a wrapper script /usr/bin/coverage, which executes
> a target script for active version of Python (/usr/bin/python). Users can directly call
> coverage-2.7 or coverage-3.2 without changing active version of Python.
>
This is similar to what I ended up doing. I wrote a SlackBuild
which builds a Python version specific Slackware package for coverage
with custom launcher scripts. This gives me a coverage-py2.6-3.4.tgz
and coverage-py3.1-3.4.tgz. This should make upgrading Python or
coverage easier for me while allowing me to run test coverage under
both Python interpreters.
I like the Gentoo idea of a generic wrapper script, I'll have to
steal that to include in my SlackBuild. 8-)
--
Sean Robinson
WiFi Radar - http://wifi-radar.berlios.de
Python WiFi - http://pythonwifi.wikispot.org
pymnl - http://pymnl.wikispot.org
More information about the testing-in-python
mailing list