Commit de46c66d authored by Robert Bradshaw's avatar Robert Bradshaw

Dependencies fixes/cleaunup.

parent f45581b1
......@@ -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
......
......@@ -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)
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)
......
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