Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Runtime pyrex -> cython option renaming

  • Loading branch information...
commit 50bd1a47df03637d15e1be45a39f8d915febda9c 1 parent 6b3cc5a
@robertwb robertwb authored
Showing with 39 additions and 3 deletions.
  1. +13 −2 Cython/Distutils/build_ext.py
  2. +26 −1 Cython/Distutils/extension.py
View
15 Cython/Distutils/build_ext.py
@@ -103,8 +103,6 @@ class build_ext(_build_ext.build_ext):
"compiler directive overrides"),
('pyrex-gdb', None,
"generate debug information for cygdb"),
- ('pyrex-compile-time-env', None,
- "cython compile time environment"),
])
boolean_options.extend([
@@ -128,6 +126,19 @@ def initialize_options(self):
self.cython_gdb = False
self.no_c_in_traceback = 0
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):
_build_ext.build_ext.finalize_options(self)
View
27 Cython/Distutils/extension.py
@@ -40,7 +40,7 @@ class Extension(_Extension.Extension):
# When adding arguments to this constructor, be sure to update
# user_options.extend in build_ext.py.
- def __init__ (self, name, sources,
+ def __init__(self, name, sources,
include_dirs = None,
define_macros = None,
undef_macros = None,
@@ -65,6 +65,31 @@ def __init__ (self, name, sources,
no_c_in_traceback = False,
cython_compile_time_env = None,
**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,
include_dirs = include_dirs,
Please sign in to comment.
Something went wrong with that request. Please try again.