summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-31 11:38:46 +0100
committerBenjamin Schubert <ben.c.schubert@gmail.com>2019-05-31 14:33:37 +0100
commit54b93af2c5505f6c36f2c025c498b312c9bdf81a (patch)
tree40327052a8dd42fe80a09a74550862c62671e232 /setup.py
parentfd91071fd2666f54f6beb967d6762415525e3e56 (diff)
downloadbuildstream-54b93af2c5505f6c36f2c025c498b312c9bdf81a.tar.gz
Setup.py: Disable linetrace by default and only enable when using coverage
It turns out that enabling 'linetrace', does have a runtime cost even if not enabled in distutils. Therefore disabling it by default. In order to run coverage, we therefore need to retranspile the .pyx files with ENABLE_CYTHON_TRACE set.
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/setup.py b/setup.py
index a57e65b56..ad87932fb 100755
--- a/setup.py
+++ b/setup.py
@@ -324,8 +324,10 @@ def assert_cython_required():
raise SystemExit(1)
+ENABLE_CYTHON_TRACE = os.environ.get("BST_CYTHON_TRACE", "0")
+
extension_macros = [
- ("CYTHON_TRACE", os.environ.get("BST_CYTHON_TRACE", 0))
+ ("CYTHON_TRACE", ENABLE_CYTHON_TRACE)
]
@@ -458,9 +460,8 @@ setup(name='BuildStream',
# Version of python to use
# https://cython.readthedocs.io/en/latest/src/userguide/source_files_and_compilation.html#arguments
"language_level": "3",
- # Enable line tracing, this is needed in order to generate coverage.
- # This is not enabled unless the CYTHON_TRACE macro for distutils is defined.
- "linetrace": True,
+ # Enable line tracing when requested only, this is needed in order to generate coverage.
+ "linetrace": bool(ENABLE_CYTHON_TRACE),
"profile": os.environ.get("BST_CYTHON_PROFILE", False),
}
),