Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
e9194f7f
Commit
e9194f7f
authored
Aug 11, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get rid of some absolute file paths in the source files
parent
7d61c778
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+12
-1
No files found.
CHANGES.rst
View file @
e9194f7f
...
...
@@ -32,6 +32,9 @@ Bugs fixed
* Bazel integration failed to compile ``.py`` files.
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)
=================
...
...
Cython/Build/Dependencies.py
View file @
e9194f7f
...
...
@@ -76,6 +76,15 @@ else:
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
):
if
'{'
in
pattern
:
m
=
re
.
match
(
'(.*){([^}]+)}(.*)'
,
pattern
)
...
...
@@ -617,8 +626,10 @@ class DependencyTree(object):
info
=
self
.
parse_dependencies
(
filename
)[
3
]
kwds
=
info
.
values
cimports
,
externs
,
incdirs
=
self
.
cimports_externs_incdirs
(
filename
)
basedir
=
os
.
getcwd
()
# Add dependencies on "cdef extern from ..." files
if
externs
:
externs
=
_make_relative
(
externs
,
basedir
)
if
'depends'
in
kwds
:
kwds
[
'depends'
]
=
list
(
set
(
kwds
[
'depends'
]).
union
(
externs
))
else
:
...
...
@@ -627,7 +638,7 @@ class DependencyTree(object):
# "cdef extern from ..." files
if
incdirs
:
include_dirs
=
list
(
kwds
.
get
(
'include_dirs'
,
[]))
for
inc
in
incdirs
:
for
inc
in
_make_relative
(
incdirs
,
basedir
)
:
if
inc
not
in
include_dirs
:
include_dirs
.
append
(
inc
)
kwds
[
'include_dirs'
]
=
include_dirs
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment