diff options
author | David Robillard <d@drobilla.net> | 2019-03-17 17:31:04 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-03-17 18:14:27 +0100 |
commit | 045e70df64bc881c2d1dc55028407117abd03099 (patch) | |
tree | 791b8e4d4bb680e938beb3a877e08c58f21dc3b8 /waflib/extras/cython.py | |
parent | 86f05e18c1e708fd0f72f3668f1e7446dbb4c69d (diff) | |
parent | ffe3509181a565237f8bb5930ba3f37bfe721fb9 (diff) | |
download | raul-045e70df64bc881c2d1dc55028407117abd03099.tar.gz raul-045e70df64bc881c2d1dc55028407117abd03099.tar.bz2 raul-045e70df64bc881c2d1dc55028407117abd03099.zip |
Update autowaf and adapt to new API
Diffstat (limited to 'waflib/extras/cython.py')
-rw-r--r-- | waflib/extras/cython.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/waflib/extras/cython.py b/waflib/extras/cython.py index 481d6f4..591c274 100644 --- a/waflib/extras/cython.py +++ b/waflib/extras/cython.py @@ -8,8 +8,9 @@ from waflib.TaskGen import extension cy_api_pat = re.compile(r'\s*?cdef\s*?(public|api)\w*') re_cyt = re.compile(r""" - (?:from\s+(\w+)\s+)? # optionally match "from foo" and capture foo - c?import\s(\w+|[*]) # require "import bar" and capture bar + ^\s* # must begin with some whitespace characters + (?:from\s+(\w+)(?:\.\w+)*\s+)? # optionally match "from foo(.baz)" and capture foo + c?import\s(\w+|[*]) # require "import bar" and capture bar """, re.M | re.VERBOSE) @extension('.pyx') @@ -85,12 +86,12 @@ class cython(Task.Task): node = self.inputs[0] txt = node.read() - mods = [] + mods = set() for m in re_cyt.finditer(txt): if m.group(1): # matches "from foo import bar" - mods.append(m.group(1)) + mods.add(m.group(1)) else: - mods.append(m.group(2)) + mods.add(m.group(2)) Logs.debug('cython: mods %r', mods) incs = getattr(self.generator, 'cython_includes', []) @@ -99,7 +100,7 @@ class cython(Task.Task): found = [] missing = [] - for x in mods: + for x in sorted(mods): for y in incs: k = y.find_resource(x + '.pxd') if k: |