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
7a98c70e
Commit
7a98c70e
authored
May 16, 2013
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #226 from ohanar/build_dir
fix build_dir copying
parents
b2bd583d
657de8b7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+6
-4
tests/build/build_dir.srctree
tests/build/build_dir.srctree
+6
-0
No files found.
Cython/Build/Dependencies.py
View file @
7a98c70e
...
...
@@ -671,10 +671,12 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
if
build_dir
:
root
=
os
.
path
.
realpath
(
os
.
path
.
abspath
(
find_root_package_dir
(
m
.
sources
[
0
])))
def
copy_to_build_dir
(
filepath
,
root
=
root
):
filepath
=
os
.
path
.
abspath
(
filepath
)
if
os
.
path
.
realpath
(
filepath
).
startswith
(
root
):
mod_dir
=
os
.
path
.
join
(
build_dir
,
os
.
path
.
dirname
(
_relpath
(
filepath
)))
filepath_abs
=
os
.
path
.
realpath
(
os
.
path
.
abspath
(
filepath
))
if
os
.
path
.
isabs
(
filepath
):
filepath
=
filepath_abs
if
filepath_abs
.
startswith
(
root
):
mod_dir
=
os
.
path
.
join
(
build_dir
,
os
.
path
.
dirname
(
_relpath
(
filepath
,
root
)))
if
not
os
.
path
.
isdir
(
mod_dir
):
os
.
makedirs
(
mod_dir
)
shutil
.
copy
(
filepath
,
mod_dir
)
...
...
tests/build/build_dir.srctree
View file @
7a98c70e
PYTHON -c "import os; os.symlink('subdir', 'fake')"
PYTHON setup.py build_ext --inplace
PYTHON -c "import a"
PYTHON -c "import pkg.b"
...
...
@@ -43,12 +44,16 @@ int value2 = 200;
######## pkg/b.pyx ########
cdef extern from "../fake/helper.h":
int value2
cdef extern from "pkg_helper.h":
int value3
cdef extern from "subdir/pkg_helper.h":
int value4
assert value2 == 200
assert value3 == 300
assert value4 == 400
...
...
@@ -72,5 +77,6 @@ assert not os.path.exists("a.c")
assert os.path.exists("scratchB/pkg/b.c")
assert os.path.exists("scratchB/pkg/pkg_helper.h")
assert os.path.exists("scratchB/pkg/subdir/pkg_helper.h")
assert os.path.exists("scratchB/fake/helper.h")
assert not os.path.exists("b.c")
assert not os.path.exists("pkg/b.c")
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