Commit 10faf93a authored by Christoph Groth's avatar Christoph Groth
Browse files

setup.py: remove obsolete --cython-trace option

The CYTHON_TRACE macro can be now set in the build.conf file.
parent 16f4d000
......@@ -8,8 +8,9 @@ stages:
build package:
stage: build
script:
- ./setup.py build --cython-trace
- ./setup.py build_ext --cython-trace -i
- echo -e "[DEFAULT]\ndefine_macros = CYTHON_TRACE=1" >build.conf
- ./setup.py build
- ./setup.py build_ext -i
artifacts:
untracked: true
expire_in: 1 hour
......
......@@ -92,10 +92,12 @@ complete list, see its `documentation
<https://docs.python.org/3/distutils/apiref.html#distutils.core.Extension>`_).
The corresponding values are whitespace-separated lists of strings.
Example ``build.conf`` for compiling Kwant with enabled C assertions::
Example ``build.conf`` for compiling Kwant with C assertions and Cython's line
trace feature::
[DEFAULT]
undef_macros = NDEBUG
define_macros = CYTHON_TRACE=1
Kwant must be linked against LAPACK & BLAS, and, optionally, MUMPS. The main
application of build configuration is adopting the build process to the various
......
......@@ -47,7 +47,6 @@ README_END_BEFORE = 'See also in this directory:'
STATIC_VERSION_PATH = ('kwant', '_kwant_version.py')
REQUIRED_CYTHON_VERSION = (0, 22)
CYTHON_OPTION = '--cython'
CYTHON_TRACE_OPTION = '--cython-trace'
TUT_DIR = 'tutorial'
TUT_GLOB = 'doc/source/tutorial/*.py'
TUT_HIDDEN_PREFIX = '#HIDDEN'
......@@ -118,13 +117,6 @@ def configure_extensions(exts, aliases=(), build_summary=None):
"""
global config_file_present
#### Add cython tracing macro
if trace_cython:
for name, kwargs in exts.items():
macros = kwargs.get('define_macros', [])
macros.append(('CYTHON_TRACE', '1'))
kwargs['define_macros'] = macros
#### Read build configuration file.
configs = configparser.ConfigParser()
try:
......@@ -213,7 +205,7 @@ def init_cython():
This function modifies `sys.argv`.
"""
global cythonize, cython_help, trace_cython
global cythonize, cython_help
try:
sys.argv.remove(CYTHON_OPTION)
......@@ -221,16 +213,6 @@ def init_cython():
except ValueError:
cythonize = version_is_from_git
try:
sys.argv.remove(CYTHON_TRACE_OPTION)
trace_cython = True
if not cythonize:
print('Error: --cython-trace provided, but Cython will not be run.',
file=sys.stderr)
exit(1)
except ValueError:
trace_cython = False
if cythonize:
try:
import Cython
......@@ -495,7 +477,7 @@ def maybe_cythonize(exts):
return cythonize([Extension(name, **kwargs)
for name, kwargs in exts.items()],
language_level=3,
compiler_directives={'linetrace': trace_cython})
compiler_directives={'linetrace': True})
# Cython is not going to be run: replace pyx extension by that of
# the shipped translated file.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment