Red Hat Bugzilla – Bug 536948
RFC: Emit python3-coverage subpackage as part of the python-coverage build
Last modified: 2010-02-05 14:35:14 EST
Description of problem:
I'm working on adding a python 3 stack to Fedora 13, parallel-installable with
the main python 2 stack (see https://fedoraproject.org/wiki/Features/Python3F13 )
There are two approaches I'm experimenting with to packaging modules for python
(a) create an separate specfile/srpm for the python 3 version
(b) extend an existing specfile so that it emits a python3- subpackage as
part of the build.
coverage's upstream appears to be attempting to support both python 2 and python 3 with a single release, so I've attempted approach (b).
I've successfully patched python-coverage.spec so that it will generate a python3-coverage subpackage as part of the main build.
I'm about to attach the patch to the specfile, and the patch I needed to apply during the build.
Note that none of the dependent python3 packages are actually through review and in CVS/koji yet.
Created attachment 369108 [details]
Patch to python-coverage.spec to add a python3- subpackage (no changelog entry yet)
Created attachment 369109 [details]
patch1 from specfile patch, described there. Not yet sent upstream.
With these, I was able to do a local rebuild of the srpm; I tested the /usr/bin/coverage3 (the python3 variant) with a simple .py file and it appears to work as well as /usr/bin/coverage (the python2 variant)
I've reported the patching I had to do with upstream here:
This bug appears to have been reported against 'rawhide' during the Fedora 12 development cycle.
Changing version to '12'.
More information and reason for this action is here:
Created attachment 388353 [details]
Updated specfile patch to add python3- subpackage
Attaching an updated version of the specfile patch, reflecting the latest recommendations on https://fedoraproject.org/wiki/PackagingDrafts/Python3
(Still blocked on python3-setuptools, though)
Upstream does intend for the tarball to support both Python 2 and Python 3 c.f: "The latest version is 3.2, released 5 December 2009. It is supported on Python 2.3 through 3.1." from http://nedbatchelder.com/code/coverage/
Tested with a local build;
$ head -n1 $(which python3-coverage)
so it is indeed invoking python3
$ python3-coverage help
prints the expected list of commands
$ python3-coverage run testcoverage.py
on this trivial code:
print("shouldn't get here")
emitted a ".coverage" file, and
$ python3-coverage html -d fubar
generated a (correct) HTML report.
Verifying the python2 case:
$ head -n1 $(which coverage)
so that executable is still using python2
$ coverage help
etc; I also successfully manage to execute the "run" and "html" commands using the python2 version of the code.
python-setuptools has now been built in dist-f13 with the python3-setuptools subpackage, so I believe we'll be good to go with this as soon as that package reaches the dist-f13-build build tag.
Luke: I'm hoping to get this done by F13 Feature Freeze, and I'm guessing Tom isn't going to be responsive to bz mail; is it OK to apply the patch and rebuild with the new python3 support? I've requested commit access here:
Spot gave me CVS access; I've gone ahead and implemented this.
I noticed a few places in my patch where I wasn't fully following the new Python 3 packaging guidelines, and fixed them. Likewise, I needed to add a runtime dep on python3-setuptools (aka bug 556290); I also needed to add a BuildRequires on 2to3.
CVS diff here:
Successfully built into dist-f13 as python-coverage-3.2-3.fc13: http://koji.fedoraproject.org/koji/taskinfo?taskID=1965558 http://koji.fedoraproject.org/koji/buildinfo?buildID=154636