Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
gevent
Commits
8fd32a78
Commit
8fd32a78
authored
Jul 03, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup.py: run cython if core.c does not exist
parent
75c24b62
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
12 deletions
+16
-12
setup.py
setup.py
+16
-12
No files found.
setup.py
View file @
8fd32a78
...
...
@@ -40,19 +40,23 @@ class my_build_ext(build_ext.build_ext):
def
compile_cython
(
self
):
sources
=
glob
.
glob
(
'gevent/*.pyx'
)
+
sorted
(
glob
.
glob
(
'gevent/*.pxi'
))
if
not
sources
:
print
>>
sys
.
stderr
,
'Could not find gevent.core sources'
return
core_c_mtime
=
os
.
stat
(
'gevent/core.c'
).
st_mtime
changed
=
[
filename
for
filename
in
sources
if
(
os
.
stat
(
filename
).
st_mtime
-
core_c_mtime
)
>
1
]
if
changed
:
if
not
os
.
path
.
exists
(
'gevent/core.c'
):
print
>>
sys
.
stderr
,
'Could not find gevent/core.c'
if
os
.
path
.
exists
(
'gevent/core.c'
):
core_c_mtime
=
os
.
stat
(
'gevent/core.c'
).
st_mtime
changed
=
[
filename
for
filename
in
sources
if
(
os
.
stat
(
filename
).
st_mtime
-
core_c_mtime
)
>
1
]
if
not
changed
:
return
print
>>
sys
.
stderr
,
'Running cython (changed: %s)'
%
', '
.
join
(
changed
)
cython_result
=
os
.
system
(
'cython gevent/core.pyx'
)
if
cython_result
:
if
os
.
system
(
'cython -V 2> %s'
%
os
.
devnull
):
# there's no cython in the system
print
>>
sys
.
stderr
,
'No cython found, cannot rebuild core.c'
return
sys
.
exit
(
1
)
else
:
print
>>
sys
.
stderr
,
'Running cython'
cython_result
=
os
.
system
(
'cython gevent/core.pyx'
)
if
cython_result
:
if
os
.
system
(
'cython -V 2> %s'
%
os
.
devnull
):
# there's no cython in the system
print
>>
sys
.
stderr
,
'No cython found, cannot rebuild core.c'
return
sys
.
exit
(
1
)
def
build_extension
(
self
,
ext
):
self
.
compile_cython
()
...
...
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