Python 3 version of setup.py fails in tarball due to missing scripts subdir, but appears not to be necessary

Issue #29 resolved
David Malcolm created an issue

Background: I'm attempting to package coverage for python 3 for Fedora

Issue: setup.py has this conditional: {{{ if sys.hexversion < 0x03000000: # In Py 2.x, use setuptools. # etc else: # No setuptools yet for Py 3.x, so do without. from distutils.core import setup, Extension console_script = 'coverage3'

more_setup_args = dict(
    scripts = [
        'scripts/coverage',
        ],
    )

}}}

Upon attempting to build coverage-3.1 from tarball using python 3.1.1, this code fails in build_scripts with an error: 'scripts/coverage' does not exist

Looking at the coverage-3.1.tar.gz tarball, the "scripts" subdirectory isn't present.

I'm using Python 3.1.1 and notwithstanding the comment about "# No setuptools yet for Py 3.x, so do without.", the python 2 branch of the setup.py code seems to work fine with distribute-0.6.6 - assuming I invoke python3's 2to3 upon the source tree.

FWIW I patched this, and the result is a working python3-coverage RPM. See https://bugzilla.redhat.com/show_bug.cgi?id=536948 and the patch here: https://bugzilla.redhat.com/attachment.cgi?id=369109

The patch to setup.py removes most of the 2 vs 3 variation, to simply use the python2 code for both.

It also contains a fixup of console_script to vary, so that my /usr/bin/coverage is for python 2, and /usr/bin/coverage3 is for python 3 (so that both stacks are installable in parallel); you probably don't want that part of it in your version.

Hope this is helpful

Dave

Comments (2)

  1. Former user Account Deleted

    Just came to say "me too".

    You forgot to throw scripts into your MANIFEST.in file? =)

  2. Ned Batchelder repo owner

    Fixed in e778c30a34f2 . Now I'm using Distribute on Py3.x, and classic setuptools on 2.x.

    Please let me know if you find problems with this approach, I feel like I'm on the bleeding edge here...

  3. Log in to comment