summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-12-23 17:41:49 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-12-23 17:41:49 -0500
commit1a6010d34f65c5d6cf56d0d41678bbf620c27416 (patch)
tree69b0eff538ac1834042b7bc733fb6f7ef2508321 /setup.py
parent92aad6e705c99fa662e1f03eaf00871ba0b19874 (diff)
downloadpython-coveragepy-1a6010d34f65c5d6cf56d0d41678bbf620c27416.tar.gz
Last tweaking of setup.py
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/setup.py b/setup.py
index 62db5e7..c1a90cf 100644
--- a/setup.py
+++ b/setup.py
@@ -40,17 +40,15 @@ Topic :: Software Development :: Testing
import os, sys
from setuptools import setup
-from distutils.core import Extension # pylint: disable=E0611,F0401
-from distutils.command import build_ext # pylint: disable=E0611,F0401
-from distutils.errors import CCompilerError # pylint: disable=E0611,F0401,C0301
-from distutils.errors import DistutilsExecError # pylint: disable=E0611,F0401,C0301
-from distutils.errors import DistutilsPlatformError # pylint: disable=E0611,F0401,C0301
+from distutils.core import Extension # pylint: disable=E0611,F0401
+from distutils.command.build_ext import build_ext # pylint: disable=E0611,F0401,C0301
+from distutils import errors # pylint: disable=E0611,F0401
# Get or massage our metadata. We exec coverage/version.py so we can avoid
# importing the product code into setup.py.
doc = __doc__ # __doc__ will be overwritten by version.py.
-__version__ = __url__ = "" # keep pylint happy.
+__version__ = __url__ = "" # Keep pylint happy.
cov_ver_py = os.path.join(os.path.split(__file__)[0], "coverage/version.py")
version_file = open(cov_ver_py)
@@ -112,7 +110,11 @@ setup_args = dict(
# A replacement for the build_ext command which raises a single exception
# if the build fails, so we can fallback nicely.
-ext_errors = (CCompilerError, DistutilsExecError, DistutilsPlatformError)
+ext_errors = (
+ errors.CCompilerError,
+ errors.DistutilsExecError,
+ errors.DistutilsPlatformError,
+)
if sys.platform == 'win32' and sys.version_info > (2, 6):
# 2.6's distutils.msvc9compiler can raise an IOError when failing to
# find the compiler
@@ -124,20 +126,20 @@ class BuildFailed(Exception):
Exception.__init__(self)
self.cause = sys.exc_info()[1] # work around py 2/3 different syntax
-class ve_build_ext(build_ext.build_ext):
+class ve_build_ext(build_ext):
"""Build C extensions, but fail with a straightforward exception."""
def run(self):
"""Wrap `run` with `BuildFailed`."""
try:
- build_ext.build_ext.run(self)
- except DistutilsPlatformError:
+ build_ext.run(self)
+ except errors.DistutilsPlatformError:
raise BuildFailed()
def build_extension(self, ext):
"""Wrap `build_extension` with `BuildFailed`."""
try:
- build_ext.build_ext.build_extension(self, ext)
+ build_ext.build_extension(self, ext)
except ext_errors:
raise BuildFailed()
except ValueError:
@@ -173,7 +175,7 @@ if compile_extension:
if sys.version_info >= (3, 0):
setup_args.update(dict(
- use_2to3=False,
+ use_2to3 = False,
))
def main():