From: Robert Bradshaw Date: Sat, 11 Dec 2010 09:27:22 +0000 (-0800) Subject: Dependencies fixes/cleaunup. X-Git-Tag: 0.14.rc0~5 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=de46c66d32e7c860b697762b7f0c6e7a629fd0e8;p=cython.git Dependencies fixes/cleaunup. --- diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py index a2ff4bfb..04844bdc 100644 --- a/Cython/Build/Dependencies.py +++ b/Cython/Build/Dependencies.py @@ -56,8 +56,8 @@ distutils_settings = { 'runtime_library_dirs': transitive_list, 'include_dirs': transitive_list, 'extra_objects': list, - 'extra_compile_args': list, - 'extra_link_args': list, + 'extra_compile_args': transitive_list, + 'extra_link_args': transitive_list, 'export_symbols': list, 'depends': transitive_list, 'language': transitive_str, @@ -97,7 +97,7 @@ class DistutilsInfo(object): elif exn is not None: for key in distutils_settings: if key in ('name', 'sources'): - pass + continue value = getattr(exn, key, None) if value: self.values[key] = value @@ -429,10 +429,15 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None): else: module_name = name if module_name not in seen: + kwds = deps.distutils_info(file, aliases, base).values + for key, value in base.values.items(): + if key not in kwds: + kwds[key] = value module_list.append(exn_type( name=module_name, sources=[file], - **deps.distutils_info(file, aliases, base).values)) + **kwds)) + m = module_list[-1] seen.add(name) return module_list diff --git a/Cython/Build/Inline.py b/Cython/Build/Inline.py index abbcfb42..61cbf98e 100644 --- a/Cython/Build/Inline.py +++ b/Cython/Build/Inline.py @@ -85,6 +85,7 @@ def cython_inline(code, get_type=unsafe_type, lib_dir=os.path.expanduser('~/.cython/inline'), cython_include_dirs=['.'], + force=False, locals=None, globals=None, **kwds): @@ -120,8 +121,12 @@ def cython_inline(code, os.makedirs(lib_dir) if lib_dir not in sys.path: sys.path.append(lib_dir) - __import__(module_name) + if force: + raise ImportError + else: + __import__(module_name) except ImportError: + cflags = [] c_include_dirs = [] cimports = [] qualified = re.compile(r'([.\w]+)[.]') @@ -133,6 +138,7 @@ def cython_inline(code, if m.groups()[0] == 'numpy': import numpy c_include_dirs.append(numpy.get_include()) + cflags.append('-Wno-unused') module_body, func_body = extract_func_code(code) params = ', '.join(['%s %s' % a for a in arg_sigs]) module_code = """ @@ -148,7 +154,8 @@ def __invoke(%(params)s): extension = Extension( name = module_name, sources = [pyx_file], - include_dirs = c_include_dirs) + include_dirs = c_include_dirs, + extra_compile_args = cflags) build_extension = build_ext(Distribution()) build_extension.finalize_options() build_extension.extensions = cythonize([extension], ctx=ctx)