summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-08-01 08:16:39 -0400
committerNed Batchelder <ned@nedbatchelder.com>2015-08-01 08:16:39 -0400
commit3cd29c61baf03e62b759ec2fd6d8409423b407c6 (patch)
tree2928d1daacb73ed5b40de9e827698540c98af9f5 /setup.py
parente0fb42b64f2bfc21adff690af72a7ff5360407c8 (diff)
downloadpython-coveragepy-git-3cd29c61baf03e62b759ec2fd6d8409423b407c6.tar.gz
Clean up in setup.py
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py47
1 files changed, 25 insertions, 22 deletions
diff --git a/setup.py b/setup.py
index e8892f77..9c35f318 100644
--- a/setup.py
+++ b/setup.py
@@ -35,17 +35,6 @@ New in 3.2: Branch coverage!
# This file is used unchanged under all versions of Python, 2.x and 3.x.
-classifiers = """\
-Environment :: Console
-Intended Audience :: Developers
-License :: OSI Approved :: Apache Software License
-Operating System :: OS Independent
-Programming Language :: Python :: 2
-Programming Language :: Python :: 3
-Topic :: Software Development :: Quality Assurance
-Topic :: Software Development :: Testing
-"""
-
# Pull in the tools we need.
import os, sys
@@ -57,6 +46,17 @@ from distutils import errors # pylint: disable=no-name-in
# Get or massage our metadata. We exec coverage/version.py so we can avoid
# importing the product code into setup.py.
+classifiers = """\
+Environment :: Console
+Intended Audience :: Developers
+License :: OSI Approved :: Apache Software License
+Operating System :: OS Independent
+Programming Language :: Python :: 2
+Programming Language :: Python :: 3
+Topic :: Software Development :: Quality Assurance
+Topic :: Software Development :: Testing
+"""
+
doc = __doc__ # __doc__ will be overwritten by version.py.
__version__ = __url__ = "" # Keep pylint happy.
@@ -81,7 +81,7 @@ scripts = [
'coverage = coverage.cmdline:main',
'coverage%d = coverage.cmdline:main' % sys.version_info[:1],
'coverage-%d.%d = coverage.cmdline:main' % sys.version_info[:2],
- ]
+]
# Create the keyword arguments for setup()
@@ -91,13 +91,13 @@ setup_args = dict(
packages = [
'coverage',
- ],
+ ],
package_data = {
'coverage': [
'htmlfiles/*.*',
- ]
- },
+ ]
+ },
entry_points = {'console_scripts': scripts},
@@ -112,7 +112,7 @@ setup_args = dict(
license = 'Apache 2.0',
classifiers = classifier_list,
url = __url__,
- )
+)
# A replacement for the build_ext command which raises a single exception
# if the build fails, so we can fallback nicely.
@@ -127,11 +127,13 @@ if sys.platform == 'win32':
# find the compiler
ext_errors += (IOError,)
+
class BuildFailed(Exception):
"""Raise this to indicate the C extension wouldn't build."""
def __init__(self):
Exception.__init__(self)
- self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
+ self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
+
class ve_build_ext(build_ext):
"""Build C extensions, but fail with a straightforward exception."""
@@ -153,7 +155,7 @@ class ve_build_ext(build_ext):
raise BuildFailed()
except ValueError as err:
# this can happen on Windows 64 bit, see Python issue 7511
- if "'path'" in str(err): # works with both py 2/3
+ if "'path'" in str(err): # works with both py 2/3
raise BuildFailed()
raise
@@ -174,18 +176,19 @@ if compile_extension:
setup_args.update(dict(
ext_modules = [
Extension("coverage.tracer", sources=["coverage/tracer.c"])
- ],
+ ],
cmdclass = {
'build_ext': ve_build_ext,
- },
- ))
+ },
+ ))
# Py3.x-specific details.
if sys.version_info >= (3, 0):
setup_args.update(dict(
use_2to3 = False,
- ))
+ ))
+
def main():
"""Actually invoke setup() with the arguments we built above."""