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
Gwenaël Samain
cython
Commits
de46c66d
Commit
de46c66d
authored
Dec 11, 2010
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dependencies fixes/cleaunup.
parent
f45581b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
+18
-6
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+9
-4
Cython/Build/Inline.py
Cython/Build/Inline.py
+9
-2
No files found.
Cython/Build/Dependencies.py
View file @
de46c66d
...
@@ -56,8 +56,8 @@ distutils_settings = {
...
@@ -56,8 +56,8 @@ distutils_settings = {
'runtime_library_dirs'
:
transitive_list
,
'runtime_library_dirs'
:
transitive_list
,
'include_dirs'
:
transitive_list
,
'include_dirs'
:
transitive_list
,
'extra_objects'
:
list
,
'extra_objects'
:
list
,
'extra_compile_args'
:
list
,
'extra_compile_args'
:
transitive_
list
,
'extra_link_args'
:
list
,
'extra_link_args'
:
transitive_
list
,
'export_symbols'
:
list
,
'export_symbols'
:
list
,
'depends'
:
transitive_list
,
'depends'
:
transitive_list
,
'language'
:
transitive_str
,
'language'
:
transitive_str
,
...
@@ -97,7 +97,7 @@ class DistutilsInfo(object):
...
@@ -97,7 +97,7 @@ class DistutilsInfo(object):
elif
exn
is
not
None
:
elif
exn
is
not
None
:
for
key
in
distutils_settings
:
for
key
in
distutils_settings
:
if
key
in
(
'name'
,
'sources'
):
if
key
in
(
'name'
,
'sources'
):
pass
continue
value
=
getattr
(
exn
,
key
,
None
)
value
=
getattr
(
exn
,
key
,
None
)
if
value
:
if
value
:
self
.
values
[
key
]
=
value
self
.
values
[
key
]
=
value
...
@@ -429,10 +429,15 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None):
...
@@ -429,10 +429,15 @@ def create_extension_list(patterns, exclude=[], ctx=None, aliases=None):
else
:
else
:
module_name
=
name
module_name
=
name
if
module_name
not
in
seen
:
if
module_name
not
in
seen
:
kwds
=
deps
.
distutils_info
(
file
,
aliases
,
base
).
values
for
key
,
value
in
base
.
values
.
items
():
if
key
not
in
kwds
:
kwds
[
key
]
=
value
module_list
.
append
(
exn_type
(
module_list
.
append
(
exn_type
(
name
=
module_name
,
name
=
module_name
,
sources
=
[
file
],
sources
=
[
file
],
**
deps
.
distutils_info
(
file
,
aliases
,
base
).
values
))
**
kwds
))
m
=
module_list
[
-
1
]
seen
.
add
(
name
)
seen
.
add
(
name
)
return
module_list
return
module_list
...
...
Cython/Build/Inline.py
View file @
de46c66d
...
@@ -85,6 +85,7 @@ def cython_inline(code,
...
@@ -85,6 +85,7 @@ def cython_inline(code,
get_type
=
unsafe_type
,
get_type
=
unsafe_type
,
lib_dir
=
os
.
path
.
expanduser
(
'~/.cython/inline'
),
lib_dir
=
os
.
path
.
expanduser
(
'~/.cython/inline'
),
cython_include_dirs
=
[
'.'
],
cython_include_dirs
=
[
'.'
],
force
=
False
,
locals
=
None
,
locals
=
None
,
globals
=
None
,
globals
=
None
,
**
kwds
):
**
kwds
):
...
@@ -120,8 +121,12 @@ def cython_inline(code,
...
@@ -120,8 +121,12 @@ def cython_inline(code,
os
.
makedirs
(
lib_dir
)
os
.
makedirs
(
lib_dir
)
if
lib_dir
not
in
sys
.
path
:
if
lib_dir
not
in
sys
.
path
:
sys
.
path
.
append
(
lib_dir
)
sys
.
path
.
append
(
lib_dir
)
__import__
(
module_name
)
if
force
:
raise
ImportError
else
:
__import__
(
module_name
)
except
ImportError
:
except
ImportError
:
cflags
=
[]
c_include_dirs
=
[]
c_include_dirs
=
[]
cimports
=
[]
cimports
=
[]
qualified
=
re
.
compile
(
r'([.\
w]+)[.]
')
qualified
=
re
.
compile
(
r'([.\
w]+)[.]
')
...
@@ -133,6 +138,7 @@ def cython_inline(code,
...
@@ -133,6 +138,7 @@ def cython_inline(code,
if m.groups()[0] == '
numpy
':
if m.groups()[0] == '
numpy
':
import numpy
import numpy
c_include_dirs.append(numpy.get_include())
c_include_dirs.append(numpy.get_include())
cflags.append('
-
Wno
-
unused
')
module_body, func_body = extract_func_code(code)
module_body, func_body = extract_func_code(code)
params = '
,
'.join(['
%
s
%
s
' % a for a in arg_sigs])
params = '
,
'.join(['
%
s
%
s
' % a for a in arg_sigs])
module_code = """
module_code = """
...
@@ -148,7 +154,8 @@ def __invoke(%(params)s):
...
@@ -148,7 +154,8 @@ def __invoke(%(params)s):
extension = Extension(
extension = Extension(
name = module_name,
name = module_name,
sources = [pyx_file],
sources = [pyx_file],
include_dirs = c_include_dirs)
include_dirs = c_include_dirs,
extra_compile_args = cflags)
build_extension = build_ext(Distribution())
build_extension = build_ext(Distribution())
build_extension.finalize_options()
build_extension.finalize_options()
build_extension.extensions = cythonize([extension], ctx=ctx)
build_extension.extensions = cythonize([extension], ctx=ctx)
...
...
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