From fbc6a789ed025ac114c36c414b418ca6dd3c5a38 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 17 Mar 2012 23:31:49 -0400 Subject: Don't try to compile the C extension under pypy. #166. --- CHANGES.txt | 4 ++++ setup.py | 13 ++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index d3ddf14..1925d79 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -14,7 +14,11 @@ Version 3.5.2b1 - Now the exit status of your product code is properly used as the process status when running ``python -m coverage run ...``. Thanks, JT Olds. +- When installing into pypy, we no longer attempt (and fail) to compile + the C tracer function, closing `issue 166`_. + .. _issue 155: https://bitbucket.org/ned/coveragepy/issue/155/cant-use-coverage-run-m-unittest-discover +.. _issue 166: https://bitbucket.org/ned/coveragepy/issue/166/dont-try-to-compile-c-extension-on-pypy Version 3.5.1 --- 23 September 2011 diff --git a/setup.py b/setup.py index d6e92c1..bc4a45c 100644 --- a/setup.py +++ b/setup.py @@ -102,8 +102,19 @@ setup_args = dict( url = __url__, ) -# Jython can't compile C extensions +# There are a few reasons we might not be able to compile the C extension. + +compile_extension = True + if not sys.platform.startswith('java'): + # Jython can't compile C extensions + compile_extension = False + +if hasattr(sys, "pypy_version_info"): + # Pypy can't compile C extensions + compile_extension = False + +if compile_extension: setup_args.update(dict( ext_modules = [ Extension("coverage.tracer", sources=["coverage/tracer.c"]) -- cgit v1.2.1