diff options
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 81 |
1 files changed, 41 insertions, 40 deletions
@@ -12,6 +12,8 @@ Documentation is at `nedbatchelder.com <%s>`_. Code repository and issue tracker are at `bitbucket.org <http://bitbucket.org/ned/coveragepy>`_. New in 3.2: Branch coverage! + +New in 3.3: .coveragerc files """ # This file is used unchanged under all versions of Python, 2.x and 3.x. @@ -21,7 +23,8 @@ Environment :: Console Intended Audience :: Developers License :: OSI Approved :: BSD License Operating System :: OS Independent -Programming Language :: Python +Programming Language :: Python :: 2 +Programming Language :: Python :: 3 Topic :: Software Development :: Quality Assurance Topic :: Software Development :: Testing """ @@ -29,40 +32,18 @@ Topic :: Software Development :: Testing # Pull in the tools we need. import sys -if sys.hexversion < 0x03000000: - # In Py 2.x, use setuptools. - from ez_setup import use_setuptools - use_setuptools() - - from setuptools import setup - from distutils.core import Extension - - more_setup_args = dict( - entry_points = { - 'console_scripts': [ - 'coverage = coverage:main', - ], - 'pytest11': [ - 'coverage = coverage.testplugin', - ], - 'nose.plugins.0.10': [ - 'coverage = coverage.noseplugin:Coverage', - ], - }, - - # We need to get HTML assets from our htmlfiles dir. - zip_safe = False, - ) +# Distribute is a new fork of setuptools. It's supported on Py3.x, so we use +# it there, but stick with classic setuptools on Py2.x until Distribute becomes +# more accepted. +if sys.version_info >= (3, 0): + from distribute_setup import use_setuptools else: - # No setuptools yet for Py 3.x, so do without. - from distutils.core import setup, Extension + from ez_setup import use_setuptools - more_setup_args = dict( - scripts = [ - 'scripts/coverage', - ], - ) +use_setuptools() +from setuptools import setup +from distutils.core import Extension # Get or massage our metadata. @@ -82,7 +63,7 @@ classifier_list.append("Development Status :: " + devstat) # Set it up! -setup( +setup_args = dict( name = 'coverage', version = __version__, @@ -96,11 +77,23 @@ setup( ] }, - ext_modules = [ - Extension("coverage.tracer", sources=["coverage/tracer.c"]) - ], - - author = 'Ned Batchelder', + entry_points = { + 'console_scripts': [ + 'coverage = coverage:main', + ], + 'pytest11': [ + 'coverage = coverage.testplugin', + ], + 'nose.plugins.0.10': [ + 'coverage = coverage.noseplugin:Coverage', + ], + }, + + + # We need to get HTML assets from our htmlfiles dir. + zip_safe = False, + + author = 'Ned Batchelder and others', author_email = 'ned@nedbatchelder.com', description = doclines[0], long_description = '\n'.join(doclines[2:]), @@ -108,6 +101,14 @@ setup( license = 'BSD', classifiers = classifier_list, url = __url__, - - **more_setup_args ) + +# Is there a duck-typing way to know we can't compile extensions? +if not sys.platform.startswith('java'): + setup_args.update(dict( + ext_modules = [ + Extension("coverage.tracer", sources=["coverage/tracer.c"]) + ], + )) + +setup(**setup_args) |