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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
cbcec79e
Commit
cbcec79e
authored
Nov 11, 2010
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recompile Cython source files when .pxd override files change
parent
38d27e92
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
setup.py
setup.py
+17
-4
No files found.
setup.py
View file @
cbcec79e
...
@@ -101,8 +101,12 @@ def compile_cython_modules(profile=False):
...
@@ -101,8 +101,12 @@ def compile_cython_modules(profile=False):
pyx_source_file
=
source_file
+
".py"
pyx_source_file
=
source_file
+
".py"
else
:
else
:
pyx_source_file
=
source_file
+
".pyx"
pyx_source_file
=
source_file
+
".pyx"
dep_files
=
[]
if
os
.
path
.
exists
(
source_file
+
'.pxd'
):
dep_files
.
append
(
source_file
+
'.pxd'
)
extensions
.
append
(
extensions
.
append
(
Extension
(
module
,
sources
=
[
pyx_source_file
])
Extension
(
module
,
sources
=
[
pyx_source_file
],
depends
=
dep_files
)
)
)
class
build_ext
(
build_ext_orig
):
class
build_ext
(
build_ext_orig
):
...
@@ -154,9 +158,18 @@ def compile_cython_modules(profile=False):
...
@@ -154,9 +158,18 @@ def compile_cython_modules(profile=False):
else
:
else
:
pyx_source_file
=
source_file
+
".pyx"
pyx_source_file
=
source_file
+
".pyx"
c_source_file
=
source_file
+
".c"
c_source_file
=
source_file
+
".c"
if
not
os
.
path
.
exists
(
c_source_file
)
or
\
source_is_newer
=
False
Utils
.
file_newer_than
(
pyx_source_file
,
if
not
os
.
path
.
exists
(
c_source_file
):
Utils
.
modification_time
(
c_source_file
)):
source_is_newer
=
True
else
:
c_last_modified
=
Utils
.
modification_time
(
c_source_file
)
if
Utils
.
file_newer_than
(
pyx_source_file
,
c_last_modified
):
source_is_newer
=
True
else
:
pxd_source_file
=
source_file
+
".pxd"
if
os
.
path
.
exists
(
pxd_source_file
)
and
Utils
.
file_newer_than
(
pxd_source_file
,
c_last_modified
):
source_is_newer
=
True
if
source_is_newer
:
print
(
"Compiling module %s ..."
%
module
)
print
(
"Compiling module %s ..."
%
module
)
result
=
compile
(
pyx_source_file
)
result
=
compile
(
pyx_source_file
)
c_source_file
=
result
.
c_file
c_source_file
=
result
.
c_file
...
...
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