aboutsummaryrefslogtreecommitdiffstats
path: root/waflib/extras/cython.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-03-17 17:31:04 +0100
committerDavid Robillard <d@drobilla.net>2019-03-17 18:14:27 +0100
commite76724d58c39a52e3f47dbff40c011c54d9a0fdb (patch)
tree62c22e362068f8ab6e7e3a4597c65a7e55841943 /waflib/extras/cython.py
parent4044751b2b7c59b9f6943a0e951aa1fd7c3a2616 (diff)
parentc7034f97a9a966bb6c04e296fdae714e80237986 (diff)
downloadblop.lv2-master.tar.gz
blop.lv2-master.tar.bz2
blop.lv2-master.zip
Update autowaf and adapt to new APIHEADmaster
Diffstat (limited to 'waflib/extras/cython.py')
-rw-r--r--waflib/extras/cython.py13
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: