From f6ebfe308bc715dca44d89f16a06f01d3162d715 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Thu, 9 Jul 2009 09:20:54 -0400 Subject: Py3k: no setuptools, so setup.py has to adapt. --- setup.py | 39 +++++++++++++++++++++++++-------------- 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'setup.py') diff --git a/setup.py b/setup.py index 79948da..212dc9f 100644 --- a/setup.py +++ b/setup.py @@ -22,20 +22,36 @@ Topic :: Software Development :: Testing """ # Pull in the tools we need. +import sys -from ez_setup import use_setuptools -use_setuptools() +if sys.hexversion < 0x03000000: + from ez_setup import use_setuptools + use_setuptools() + + from setuptools import setup, find_packages + from distutils.core import Extension + + setuptools_args = dict( + entry_points = { + 'console_scripts': [ + 'coverage = coverage:main', + ] + }, + + zip_safe = False, # we need to get HTML assets from our htmlfiles dir. + ) +else: + from distutils.core import setup, Extension + setuptools_args = {} -from setuptools import setup, find_packages -from distutils.core import Extension # Get or massage our metadata. from coverage import __version__ -doclines = __doc__.split("\n") +doclines = __doc__.split('\n') -classifier_list = filter(None, classifiers.split("\n")) +classifier_list = [c for c in classifiers.split("\n") if c] if 'a' in __version__: devstat = "3 - Alpha" @@ -61,23 +77,18 @@ setup( ] }, - entry_points={ - 'console_scripts': [ - 'coverage = coverage:main', - ] - }, ext_modules = [ Extension("coverage.tracer", sources=["coverage/tracer.c"]) ], - zip_safe = False, # we need to get HTML assets from our htmlfiles dir. - author = 'Ned Batchelder', author_email = 'ned@nedbatchelder.com', description = doclines[0], - long_description = "\n".join(doclines[2:]), + long_description = '\n'.join(doclines[2:]), keywords = 'code coverage testing', license = 'BSD', classifiers = classifier_list, url = 'http://nedbatchelder.com/code/coverage', + + **setuptools_args ) -- cgit v1.2.1