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
e5a2a7bd
Commit
e5a2a7bd
authored
Jul 30, 2007
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract FQ module name from distutils
parent
2026e80b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+6
-4
Cython/Distutils/build_ext.py
Cython/Distutils/build_ext.py
+8
-4
No files found.
Cython/Compiler/Main.py
View file @
e5a2a7bd
...
...
@@ -153,7 +153,7 @@ class Context:
name
,
_
=
os
.
path
.
splitext
(
tail
)
return
name
def
compile
(
self
,
source
,
options
=
None
):
def
compile
(
self
,
source
,
options
=
None
,
full_module_name
=
None
):
# Compile a Pyrex implementation file in this context
# and return a CompilationResult.
if
not
options
:
...
...
@@ -161,7 +161,8 @@ class Context:
result
=
CompilationResult
()
cwd
=
os
.
getcwd
()
full_module_name
,
_
=
os
.
path
.
splitext
(
source
.
replace
(
'/'
,
'.'
))
if
full_module_name
is
None
:
full_module_name
,
_
=
os
.
path
.
splitext
(
source
.
replace
(
'/'
,
'.'
))
source
=
os
.
path
.
join
(
cwd
,
source
)
...
...
@@ -263,7 +264,8 @@ class CompilationResult:
self
.
extension_file
=
None
def
compile
(
source
,
options
=
None
,
c_compile
=
0
,
c_link
=
0
):
def
compile
(
source
,
options
=
None
,
c_compile
=
0
,
c_link
=
0
,
full_module_name
=
None
):
"""
compile(source, options = default_options)
...
...
@@ -278,7 +280,7 @@ def compile(source, options = None, c_compile = 0, c_link = 0):
if
c_link
:
options
.
obj_only
=
0
context
=
Context
(
options
.
include_path
)
return
context
.
compile
(
source
,
options
)
return
context
.
compile
(
source
,
options
,
full_module_name
)
#------------------------------------------------------------------------
#
...
...
Cython/Distutils/build_ext.py
View file @
e5a2a7bd
...
...
@@ -37,8 +37,12 @@ class build_ext (distutils.command.build_ext.build_ext):
if
not
self
.
extensions
:
return
if
extension
is
not
None
:
module_name
=
extension
.
name
else
:
module_name
=
None
# collect the names of the source (.pyx) files
pyx_sources
=
[]
pyx_sources
=
[
source
for
source
in
sources
if
source
.
endswith
(
'.pyx'
)]
other_sources
=
[
source
for
source
in
sources
if
not
source
.
endswith
(
'.pyx'
)]
...
...
@@ -50,14 +54,14 @@ class build_ext (distutils.command.build_ext.build_ext):
source
=
pyx
target
=
replace_suffix
(
source
,
suffix
)
if
newer
(
source
,
target
)
or
self
.
force
:
self
.
cython_compile
(
source
)
self
.
cython_compile
(
source
,
module_name
)
return
[
replace_suffix
(
src
,
suffix
)
for
src
in
pyx_sources
]
+
other_sources
def
cython_compile
(
self
,
source
):
def
cython_compile
(
self
,
source
,
module_name
):
options
=
CompilationOptions
(
default_options
,
include_path
=
self
.
include_dirs
)
result
=
compile
(
source
,
options
)
result
=
compile
(
source
,
options
,
full_module_name
=
module_name
)
if
result
.
num_errors
<>
0
:
sys
.
exit
(
1
)
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