From 6e2f6769f41da27cfa50193b4a9accd59b9a1017 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Mon, 30 Nov 2009 06:58:57 -0500 Subject: Use Distribute for 3.x, stick with setuptools for 2.x --- setup.py | 45 ++++++++++++++++++--------------------------- 1 file changed, 18 insertions(+), 27 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 4a5aba1..dfb4aed 100644 --- a/setup.py +++ b/setup.py @@ -29,34 +29,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', - ] - }, - - # 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.hexversion > 0x03000000: + 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. @@ -94,6 +78,15 @@ setup( Extension("coverage.tracer", sources=["coverage/tracer.c"]) ], + entry_points = { + 'console_scripts': [ + 'coverage = coverage:main', + ] + }, + + # We need to get HTML assets from our htmlfiles dir. + zip_safe = False, + author = 'Ned Batchelder', author_email = 'ned@nedbatchelder.com', description = doclines[0], @@ -102,6 +95,4 @@ setup( license = 'BSD', classifiers = classifier_list, url = __url__, - - **more_setup_args ) -- cgit v1.2.1