Bug 536948

Summary: RFC: Emit python3-coverage subpackage as part of the python-coverage build
Product: [Fedora] Fedora Reporter: Dave Malcolm <dmalcolm>
Component: python-coverageAssignee: Tom "spot" Callaway <tcallawa>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 12CC: lmacken, tcallawa
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-02-05 19:35:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 531895    
Bug Blocks: 530636    
Attachments:
Description Flags
Patch to python-coverage.spec to add a python3- subpackage (no changelog entry yet)
none
patch1 from specfile patch, described there. Not yet sent upstream.
none
Updated specfile patch to add python3- subpackage none

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
3:
  (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:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

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)
  #!/usr/bin/python3
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)
  #!/usr/bin/python
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:
https://admin.fedoraproject.org/pkgdb/packages/name/python-coverage

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:
http://cvs.fedoraproject.org/viewvc/rpms/python-coverage/devel/python-coverage.spec?r1=1.7&r2=1.8

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