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
Kirill Smelkov
cython
Commits
3713fea7
Commit
3713fea7
authored
Jun 11, 2018
by
Jerome Kieffer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cythonize so that the variable are actually passed to the compiler
parent
c828e80a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
Cython/Build/Cythonize.py
Cython/Build/Cythonize.py
+17
-6
No files found.
Cython/Build/Cythonize.py
View file @
3713fea7
...
...
@@ -52,6 +52,13 @@ def parse_options(option, name, value, parser):
setattr
(
parser
.
values
,
dest
,
options
)
def
parse_compile_time_env
(
option
,
name
,
value
,
parser
):
dest
=
option
.
dest
old_env
=
dict
(
getattr
(
parser
.
values
,
dest
,
{}))
directives
=
Options
.
parse_compile_time_env
(
value
,
current_settings
=
old_env
)
setattr
(
parser
.
values
,
dest
,
directives
)
def
find_package_base
(
path
):
base_dir
,
package_path
=
os
.
path
.
split
(
path
)
while
os
.
path
.
isfile
(
os
.
path
.
join
(
base_dir
,
'__init__.py'
)):
...
...
@@ -85,6 +92,7 @@ def cython_compile(path_pattern, options):
exclude_failures
=
options
.
keep_going
,
exclude
=
options
.
excludes
,
compiler_directives
=
options
.
directives
,
compile_time_env
=
options
.
compile_time_env
,
force
=
options
.
force
,
quiet
=
options
.
quiet
,
**
options
.
options
)
...
...
@@ -136,14 +144,17 @@ def parse_args(args):
from
optparse
import
OptionParser
parser
=
OptionParser
(
usage
=
'%prog [options] [sources and packages]+'
)
parser
.
add_option
(
'-X'
,
'--directive'
,
metavar
=
'NAME=VALUE,...'
,
dest
=
'directives'
,
type
=
str
,
action
=
'callback'
,
callback
=
parse_directives
,
default
=
{},
parser
.
add_option
(
'-X'
,
'--directive'
,
metavar
=
'NAME=VALUE,...'
,
dest
=
'directives'
,
default
=
{},
type
=
"str"
,
action
=
'callback'
,
callback
=
parse_directives
,
help
=
'set a compiler directive'
)
parser
.
add_option
(
'-E'
,
'--compile-time-env'
,
metavar
=
'NAME=VALUE,...'
,
dest
=
'compile_time_env'
,
type
=
str
,
action
=
'callback'
,
callback
=
Options
.
parse_compile_time_env
,
default
=
{},
parser
.
add_option
(
'-E'
,
'--compile-time-env'
,
metavar
=
'NAME=VALUE,...'
,
dest
=
'compile_time_env'
,
default
=
{},
type
=
"str"
,
action
=
'callback'
,
callback
=
parse_compile_time_env
,
help
=
'set a compile time environment variables'
)
parser
.
add_option
(
'-s'
,
'--option'
,
metavar
=
'NAME=VALUE'
,
dest
=
'options'
,
type
=
str
,
action
=
'callback'
,
callback
=
parse_options
,
default
=
{},
parser
.
add_option
(
'-s'
,
'--option'
,
metavar
=
'NAME=VALUE'
,
dest
=
'options'
,
default
=
{},
type
=
"str"
,
action
=
'callback'
,
callback
=
parse_options
,
help
=
'set a cythonize option'
)
parser
.
add_option
(
'-3'
,
dest
=
'python3_mode'
,
action
=
'store_true'
,
help
=
'use Python 3 syntax mode by default'
)
...
...
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