Commit 50bd1a47 authored by Robert Bradshaw's avatar Robert Bradshaw

Runtime pyrex -> cython option renaming

parent 6b3cc5a8
...@@ -103,8 +103,6 @@ class build_ext(_build_ext.build_ext): ...@@ -103,8 +103,6 @@ class build_ext(_build_ext.build_ext):
"compiler directive overrides"), "compiler directive overrides"),
('pyrex-gdb', None, ('pyrex-gdb', None,
"generate debug information for cygdb"), "generate debug information for cygdb"),
('pyrex-compile-time-env', None,
"cython compile time environment"),
]) ])
boolean_options.extend([ boolean_options.extend([
...@@ -128,6 +126,19 @@ class build_ext(_build_ext.build_ext): ...@@ -128,6 +126,19 @@ class build_ext(_build_ext.build_ext):
self.cython_gdb = False self.cython_gdb = False
self.no_c_in_traceback = 0 self.no_c_in_traceback = 0
self.cython_compile_time_env = None self.cython_compile_time_env = None
def __getattr__(self, name):
if name[:6] == 'pyrex_':
return getattr(self, 'cython_' + name[6:])
else:
return _build_ext.build_ext.__getattr__(self, name)
def __setattr__(self, name, value):
if name[:6] == 'pyrex_':
return setattr(self, 'cython_' + name[6:], value)
else:
# _build_ext.build_ext.__setattr__(self, name, value)
self.__dict__[name] = value
def finalize_options (self): def finalize_options (self):
_build_ext.build_ext.finalize_options(self) _build_ext.build_ext.finalize_options(self)
......
...@@ -40,7 +40,7 @@ class Extension(_Extension.Extension): ...@@ -40,7 +40,7 @@ class Extension(_Extension.Extension):
# When adding arguments to this constructor, be sure to update # When adding arguments to this constructor, be sure to update
# user_options.extend in build_ext.py. # user_options.extend in build_ext.py.
def __init__ (self, name, sources, def __init__(self, name, sources,
include_dirs = None, include_dirs = None,
define_macros = None, define_macros = None,
undef_macros = None, undef_macros = None,
...@@ -65,6 +65,31 @@ class Extension(_Extension.Extension): ...@@ -65,6 +65,31 @@ class Extension(_Extension.Extension):
no_c_in_traceback = False, no_c_in_traceback = False,
cython_compile_time_env = None, cython_compile_time_env = None,
**kw): **kw):
# Translate pyrex_X to cython_X for backwards compatibility.
had_pyrex_options = False
for key in kw.keys():
if key.startswith('pyrex_'):
had_pyrex_options = True
kw['cython' + key[5:]] = kw.pop(key)
if had_pyrex_options:
Extension.__init__(self, name, sources,
include_dirs = include_dirs,
define_macros = define_macros,
undef_macros = undef_macros,
library_dirs = library_dirs,
libraries = libraries,
runtime_library_dirs = runtime_library_dirs,
extra_objects = extra_objects,
extra_compile_args = extra_compile_args,
extra_link_args = extra_link_args,
export_symbols = export_symbols,
#swig_opts = swig_opts,
depends = depends,
language = language,
no_c_in_traceback = no_c_in_traceback,
**kw)
return
_Extension.Extension.__init__(self, name, sources, _Extension.Extension.__init__(self, name, sources,
include_dirs = include_dirs, include_dirs = include_dirs,
......
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