Bug 536948 - RFC: Emit python3-coverage subpackage as part of the python-coverage build
Summary: RFC: Emit python3-coverage subpackage as part of the python-coverage build
Alias: None
Product: Fedora
Classification: Fedora
Component: python-coverage
Version: 12
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
Depends On: 531895
Blocks: Python3F13
TreeView+ depends on / blocked
Reported: 2009-11-11 21:22 UTC by Dave Malcolm
Modified: 2010-02-05 19:35 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2010-02-05 19:35:14 UTC
Type: ---

Attachments (Terms of Use)
Patch to python-coverage.spec to add a python3- subpackage (no changelog entry yet) (3.40 KB, patch)
2009-11-11 21:24 UTC, Dave Malcolm
no flags Details | Diff
patch1 from specfile patch, described there. Not yet sent upstream. (1.61 KB, patch)
2009-11-11 21:25 UTC, Dave Malcolm
no flags Details | Diff
Updated specfile patch to add python3- subpackage (3.06 KB, patch)
2010-02-02 17:16 UTC, Dave Malcolm
no flags Details | Diff

Description Dave Malcolm 2009-11-11 21:22:20 UTC
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.

See https://fedoraproject.org/wiki/PackagingDrafts/Python3

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.

Comment 1 Dave Malcolm 2009-11-11 21:24:22 UTC
Created attachment 369108 [details]
Patch to python-coverage.spec to add a python3- subpackage (no changelog entry yet)

Comment 2 Dave Malcolm 2009-11-11 21:25:25 UTC
Created attachment 369109 [details]
patch1 from specfile patch, described there.  Not yet sent upstream.

Comment 3 Dave Malcolm 2009-11-11 21:44:55 UTC
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)

Comment 5 Bug Zapper 2009-11-16 15:27:20 UTC
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:

Comment 6 Dave Malcolm 2010-02-02 17:16:55 UTC
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:
    if True:
        print('got here')

    if False:
        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.

Comment 7 Dave Malcolm 2010-02-05 00:10:45 UTC
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:

Comment 8 Dave Malcolm 2010-02-05 19:35:14 UTC
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

Note You need to log in before you can comment on or make changes to this bug.