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
cec82f45
Commit
cec82f45
authored
5 years ago
by
Egor Dranischnikow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
extract create_args_parser(), add hook parse_args_raw and add unit-tests
parent
652f061d
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
278 additions
and
2 deletions
+278
-2
Cython/Build/Cythonize.py
Cython/Build/Cythonize.py
+10
-2
Cython/Build/Tests/TestCythonizeArgsParser.py
Cython/Build/Tests/TestCythonizeArgsParser.py
+268
-0
No files found.
Cython/Build/Cythonize.py
View file @
cec82f45
...
...
@@ -148,7 +148,7 @@ def run_distutils(args):
shutil
.
rmtree
(
temp_dir
)
def
parse_args
(
args
):
def
create_args_parser
(
):
from
optparse
import
OptionParser
parser
=
OptionParser
(
usage
=
'%prog [options] [sources and packages]+'
)
...
...
@@ -196,8 +196,16 @@ def parse_args(args):
help
=
'compile as much as possible, ignore compilation failures'
)
parser
.
add_option
(
'--no-docstrings'
,
dest
=
'no_docstrings'
,
action
=
'store_true'
,
help
=
'strip docstrings'
)
return
parser
def
parse_args_raw
(
parser
,
args
):
return
parser
.
parse_args
(
args
)
options
,
args
=
parser
.
parse_args
(
args
)
def
parse_args
(
args
):
parser
=
create_args_parser
()
options
,
args
=
parse_args_raw
(
parser
,
args
)
if
not
args
:
parser
.
error
(
"no source files provided"
)
if
options
.
build_inplace
:
...
...
This diff is collapsed.
Click to expand it.
Cython/Build/Tests/TestCythonizeArgsParser.py
0 → 100644
View file @
cec82f45
This diff is collapsed.
Click to expand it.
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