Commit de46c66d authored by Robert Bradshaw's avatar Robert Bradshaw

Dependencies fixes/cleaunup.

parent f45581b1
...@@ -56,8 +56,8 @@ distutils_settings = { ...@@ -56,8 +56,8 @@ distutils_settings = {
'runtime_library_dirs': transitive_list, 'runtime_library_dirs': transitive_list,
'include_dirs': transitive_list, 'include_dirs': transitive_list,
'extra_objects': list, 'extra_objects': list,
'extra_compile_args': list, 'extra_compile_args': transitive_list,
'extra_link_args': list, 'extra_link_args': transitive_list,
'export_symbols': list, 'export_symbols': list,
'depends': transitive_list, 'depends': transitive_list,
'language': transitive_str, 'language': transitive_str,
...@@ -97,7 +97,7 @@ class DistutilsInfo(object): ...@@ -97,7 +97,7 @@ class DistutilsInfo(object):
elif exn is not None: elif exn is not None:
for key in distutils_settings: for key in distutils_settings:
if key in ('name', 'sources'): if key in ('name', 'sources'):
pass continue
value = getattr(exn, key, None) value = getattr(exn, key, None)
if value: if value:
self.values[key] = value self.values[key] = value
...@@ -429,10 +429,15 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None): ...@@ -429,10 +429,15 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None):
else: else:
module_name = name module_name = name
if module_name not in seen: 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( module_list.append(exn_type(
name=module_name, name=module_name,
sources=[file], sources=[file],
**deps.distutils_info(file, aliases, base).values)) **kwds))
m = module_list[-1]
seen.add(name) seen.add(name)
return module_list return module_list
......
...@@ -85,6 +85,7 @@ def cython_inline(code, ...@@ -85,6 +85,7 @@ def cython_inline(code,
get_type=unsafe_type, get_type=unsafe_type,
lib_dir=os.path.expanduser('~/.cython/inline'), lib_dir=os.path.expanduser('~/.cython/inline'),
cython_include_dirs=['.'], cython_include_dirs=['.'],
force=False,
locals=None, locals=None,
globals=None, globals=None,
**kwds): **kwds):
...@@ -120,8 +121,12 @@ def cython_inline(code, ...@@ -120,8 +121,12 @@ def cython_inline(code,
os.makedirs(lib_dir) os.makedirs(lib_dir)
if lib_dir not in sys.path: if lib_dir not in sys.path:
sys.path.append(lib_dir) sys.path.append(lib_dir)
if force:
raise ImportError
else:
__import__(module_name) __import__(module_name)
except ImportError: except ImportError:
cflags = []
c_include_dirs = [] c_include_dirs = []
cimports = [] cimports = []
qualified = re.compile(r'([.\w]+)[.]') qualified = re.compile(r'([.\w]+)[.]')
...@@ -133,6 +138,7 @@ def cython_inline(code, ...@@ -133,6 +138,7 @@ def cython_inline(code,
if m.groups()[0] == 'numpy': if m.groups()[0] == 'numpy':
import numpy import numpy
c_include_dirs.append(numpy.get_include()) c_include_dirs.append(numpy.get_include())
cflags.append('-Wno-unused')
module_body, func_body = extract_func_code(code) module_body, func_body = extract_func_code(code)
params = ', '.join(['%s %s' % a for a in arg_sigs]) params = ', '.join(['%s %s' % a for a in arg_sigs])
module_code = """ module_code = """
...@@ -148,7 +154,8 @@ def __invoke(%(params)s): ...@@ -148,7 +154,8 @@ def __invoke(%(params)s):
extension = Extension( extension = Extension(
name = module_name, name = module_name,
sources = [pyx_file], sources = [pyx_file],
include_dirs = c_include_dirs) include_dirs = c_include_dirs,
extra_compile_args = cflags)
build_extension = build_ext(Distribution()) build_extension = build_ext(Distribution())
build_extension.finalize_options() build_extension.finalize_options()
build_extension.extensions = cythonize([extension], ctx=ctx) build_extension.extensions = cythonize([extension], ctx=ctx)
......
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