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
0d107a8a
Commit
0d107a8a
authored
Aug 31, 2013
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
allow explicitly excluding certain modules from the command line
parent
f0aa55e1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
Tools/cystdlib.py
Tools/cystdlib.py
+12
-5
No files found.
Tools/cystdlib.py
View file @
0d107a8a
...
...
@@ -22,7 +22,7 @@ from Cython.Compiler import Options
Options
.
error_on_unknown_names
=
False
Options
.
error_on_uninitialized
=
False
excludes
=
[
'**/test/**/*.py'
,
'**/tests/**/*.py'
,
'**/__init__.py'
]
exclude
_pattern
s
=
[
'**/test/**/*.py'
,
'**/tests/**/*.py'
,
'**/__init__.py'
]
broken
=
[
'idlelib/MultiCall.py'
,
'email/utils.py'
,
...
...
@@ -79,12 +79,13 @@ special_directives = [
del
special_directives
[:]
# currently unused
def
build_extensions
(
includes
=
'**/*.py'
,
excludes
=
excludes
+
broken
,
excludes
=
None
,
special_directives
=
special_directives
,
language_level
=
sys
.
version_info
[
0
],
parallel
=
None
):
if
isinstance
(
includes
,
str
):
includes
=
[
includes
]
excludes
=
list
(
excludes
or
())
+
exclude_patterns
+
broken
all_groups
=
(
special_directives
or
[])
+
[(
includes
,
{})]
extensions
=
[]
...
...
@@ -98,13 +99,14 @@ def build_extensions(includes='**/*.py',
d
.
update
(
directives
)
extensions
.
extend
(
cythonize
(
modules
,
cythonize
(
modules
,
exclude
=
exclude_now
,
exclude_failures
=
True
,
language_level
=
language_level
,
compiler_directives
=
d
,
nthreads
=
parallel
,
))
))
return
extensions
...
...
@@ -137,6 +139,9 @@ def parse_args():
'-j'
,
'--jobs'
,
dest
=
'parallel_jobs'
,
metavar
=
'N'
,
type
=
int
,
default
=
1
,
help
=
'run builds in N parallel jobs (default: 1)'
)
parser
.
add_option
(
'-x'
,
'--exclude'
,
dest
=
'excludes'
,
metavar
=
'PATTERN'
,
action
=
"append"
,
help
=
'exclude modules/packages matching PATTERN'
)
options
,
args
=
parser
.
parse_args
()
if
not
args
:
args
=
[
'./Lib'
]
...
...
@@ -164,7 +169,9 @@ if __name__ == '__main__':
print
(
"Not building in parallel"
)
parallel_jobs
=
0
extensions
=
build_extensions
(
parallel
=
parallel_jobs
)
extensions
=
build_extensions
(
parallel
=
parallel_jobs
,
excludes
=
options
.
excludes
)
sys_args
=
[
'build_ext'
,
'-i'
]
if
pool
is
not
None
:
results
=
pool
.
map
(
_build
,
[(
sys_args
,
ext
)
for
ext
in
extensions
])
...
...
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