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
Boxiang Sun
cython
Commits
a5c06ead
Commit
a5c06ead
authored
Aug 31, 2011
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Incorporate William Stein's cythonize() suggestions.
parent
9cb4f067
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+6
-4
No files found.
Cython/Build/Dependencies.py
View file @
a5c06ead
...
@@ -438,7 +438,7 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None):
...
@@ -438,7 +438,7 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None):
return
module_list
return
module_list
# This is the user-exposed entry point.
# This is the user-exposed entry point.
def
cythonize
(
module_list
,
exclude
=
[],
nthreads
=
0
,
aliases
=
None
,
quiet
=
False
,
**
options
):
def
cythonize
(
module_list
,
exclude
=
[],
nthreads
=
0
,
aliases
=
None
,
quiet
=
False
,
force
=
False
,
**
options
):
if
'include_path'
not
in
options
:
if
'include_path'
not
in
options
:
options
[
'include_path'
]
=
[
'.'
]
options
[
'include_path'
]
=
[
'.'
]
c_options
=
CompilationOptions
(
**
options
)
c_options
=
CompilationOptions
(
**
options
)
...
@@ -474,7 +474,7 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, **
...
@@ -474,7 +474,7 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, **
else
:
else
:
dep_timestamp
,
dep
=
deps
.
newest_dependency
(
source
)
dep_timestamp
,
dep
=
deps
.
newest_dependency
(
source
)
priority
=
2
-
(
dep
in
deps
.
immediate_dependencies
(
source
))
priority
=
2
-
(
dep
in
deps
.
immediate_dependencies
(
source
))
if
c_timestamp
<
dep_timestamp
:
if
force
or
c_timestamp
<
dep_timestamp
:
if
not
quiet
:
if
not
quiet
:
if
source
==
dep
:
if
source
==
dep
:
print
(
"Compiling %s because it changed."
%
source
)
print
(
"Compiling %s because it changed."
%
source
)
...
@@ -497,14 +497,16 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, **
...
@@ -497,14 +497,16 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, **
nthreads
=
0
nthreads
=
0
if
not
nthreads
:
if
not
nthreads
:
for
priority
,
pyx_file
,
c_file
,
options
in
to_compile
:
for
priority
,
pyx_file
,
c_file
,
options
in
to_compile
:
cythonize_one
(
pyx_file
,
c_file
,
options
)
cythonize_one
(
pyx_file
,
c_file
,
quiet
,
options
)
return
module_list
return
module_list
# TODO: Share context? Issue: pyx processing leaks into pxd module
# TODO: Share context? Issue: pyx processing leaks into pxd module
def
cythonize_one
(
pyx_file
,
c_file
,
options
=
None
):
def
cythonize_one
(
pyx_file
,
c_file
,
quiet
,
options
=
None
):
from
Cython.Compiler.Main
import
compile
,
default_options
from
Cython.Compiler.Main
import
compile
,
default_options
from
Cython.Compiler.Errors
import
CompileError
,
PyrexError
from
Cython.Compiler.Errors
import
CompileError
,
PyrexError
if
not
quiet
:
print
"Cythonizing %s"
%
pyx_file
if
options
is
None
:
if
options
is
None
:
options
=
CompilationOptions
(
default_options
)
options
=
CompilationOptions
(
default_options
)
options
.
output_file
=
c_file
options
.
output_file
=
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