Commit 90fa8d7c authored by Stefan Behnel's avatar Stefan Behnel

Merge branch 'release'

parents a6605cb7 e9194f7f
...@@ -65,6 +65,9 @@ Bugs fixed ...@@ -65,6 +65,9 @@ Bugs fixed
* Bazel integration failed to compile ``.py`` files. * Bazel integration failed to compile ``.py`` files.
Patch by Guro Bokum (Github issue #1784). Patch by Guro Bokum (Github issue #1784).
* Some include directories and dependencies were referenced with their absolute paths
in the generated files despite lying within the project directory.
0.26 (2017-07-19) 0.26 (2017-07-19)
================= =================
......
...@@ -76,6 +76,15 @@ else: ...@@ -76,6 +76,15 @@ else:
basestring = str basestring = str
def _make_relative(file_paths, base=None):
if not base:
base = os.getcwd()
if base[-1] != os.path.sep:
base += os.path.sep
return [_relpath(path, base) if path.startswith(base) else path
for path in file_paths]
def extended_iglob(pattern): def extended_iglob(pattern):
if '{' in pattern: if '{' in pattern:
m = re.match('(.*){([^}]+)}(.*)', pattern) m = re.match('(.*){([^}]+)}(.*)', pattern)
...@@ -617,8 +626,10 @@ class DependencyTree(object): ...@@ -617,8 +626,10 @@ class DependencyTree(object):
info = self.parse_dependencies(filename)[3] info = self.parse_dependencies(filename)[3]
kwds = info.values kwds = info.values
cimports, externs, incdirs = self.cimports_externs_incdirs(filename) cimports, externs, incdirs = self.cimports_externs_incdirs(filename)
basedir = os.getcwd()
# Add dependencies on "cdef extern from ..." files # Add dependencies on "cdef extern from ..." files
if externs: if externs:
externs = _make_relative(externs, basedir)
if 'depends' in kwds: if 'depends' in kwds:
kwds['depends'] = list(set(kwds['depends']).union(externs)) kwds['depends'] = list(set(kwds['depends']).union(externs))
else: else:
...@@ -627,7 +638,7 @@ class DependencyTree(object): ...@@ -627,7 +638,7 @@ class DependencyTree(object):
# "cdef extern from ..." files # "cdef extern from ..." files
if incdirs: if incdirs:
include_dirs = list(kwds.get('include_dirs', [])) include_dirs = list(kwds.get('include_dirs', []))
for inc in incdirs: for inc in _make_relative(incdirs, basedir):
if inc not in include_dirs: if inc not in include_dirs:
include_dirs.append(inc) include_dirs.append(inc)
kwds['include_dirs'] = include_dirs kwds['include_dirs'] = include_dirs
......
...@@ -368,9 +368,12 @@ Cython code. Here is the list of currently supported directives: ...@@ -368,9 +368,12 @@ Cython code. Here is the list of currently supported directives:
``binding`` (True / False) ``binding`` (True / False)
Controls whether free functions behave more like Python's CFunctions Controls whether free functions behave more like Python's CFunctions
(e.g. :func:`len`) or, when set to True, more like Python's functions (e.g. :func:`len`) or, when set to True, more like Python's functions.
(which, among other things, bind to an instance when looked up as a When enabled, functions will bind to an instance when looked up as a
class attribute). class attribute (hence the name) and will emulate the attributes
of Python functions, including introspections like argument names and
annotations.
Default is False.
``boundscheck`` (True / False) ``boundscheck`` (True / False)
If set to False, Cython is free to assume that indexing operations If set to False, Cython is free to assume that indexing operations
......
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