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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
4c21a8f1
Commit
4c21a8f1
authored
Nov 14, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clean up some code
parent
06f75b80
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
1 deletion
+17
-1
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+17
-1
No files found.
Cython/Build/Dependencies.py
View file @
4c21a8f1
...
...
@@ -64,6 +64,7 @@ else:
return
filename
basestring
=
str
def
extended_iglob
(
pattern
):
if
'{'
in
pattern
:
m
=
re
.
match
(
'(.*){([^}]+)}(.*)'
,
pattern
)
...
...
@@ -118,6 +119,7 @@ def file_hash(filename):
f
.
close
()
return
m
.
hexdigest
()
def
parse_list
(
s
):
"""
>>> parse_list("a b c")
...
...
@@ -143,6 +145,7 @@ def parse_list(s):
return
literal
return
[
unquote
(
item
)
for
item
in
s
.
split
(
delimiter
)
if
item
.
strip
()]
transitive_str
=
object
()
transitive_list
=
object
()
...
...
@@ -163,6 +166,7 @@ distutils_settings = {
'language'
:
transitive_str
,
}
@
cython
.
locals
(
start
=
cython
.
Py_ssize_t
,
end
=
cython
.
Py_ssize_t
)
def
line_iter
(
source
):
if
isinstance
(
source
,
basestring
):
...
...
@@ -178,6 +182,7 @@ def line_iter(source):
for
line
in
source
:
yield
line
class
DistutilsInfo
(
object
):
def
__init__
(
self
,
source
=
None
,
exn
=
None
):
...
...
@@ -254,6 +259,7 @@ class DistutilsInfo(object):
value
=
getattr
(
extension
,
key
)
+
list
(
value
)
setattr
(
extension
,
key
,
value
)
@
cython
.
locals
(
start
=
cython
.
Py_ssize_t
,
q
=
cython
.
Py_ssize_t
,
single_q
=
cython
.
Py_ssize_t
,
double_q
=
cython
.
Py_ssize_t
,
hash_mark
=
cython
.
Py_ssize_t
,
end
=
cython
.
Py_ssize_t
,
...
...
@@ -349,9 +355,11 @@ dependency_regex = re.compile(r"(?:^from +([0-9a-zA-Z_.]+) +cimport)|"
r"(?:^cdef +extern +from +['\"]([^'\"]+)['\"])|"
r"(?:^include +['\"]([^'\"]+)['\"])"
,
re
.
M
)
def
normalize_existing
(
base_path
,
rel_paths
):
return
normalize_existing0
(
os
.
path
.
dirname
(
base_path
),
tuple
(
set
(
rel_paths
)))
@
cached_function
def
normalize_existing0
(
base_dir
,
rel_paths
):
normalized
=
[]
...
...
@@ -363,6 +371,7 @@ def normalize_existing0(base_dir, rel_paths):
normalized
.
append
(
rel
)
return
normalized
def
resolve_depends
(
depends
,
include_dirs
):
include_dirs
=
tuple
(
include_dirs
)
resolved
=
[]
...
...
@@ -372,6 +381,7 @@ def resolve_depends(depends, include_dirs):
resolved
.
append
(
path
)
return
resolved
@
cached_function
def
resolve_depend
(
depend
,
include_dirs
):
if
depend
[
0
]
==
'<'
and
depend
[
-
1
]
==
'>'
:
...
...
@@ -382,6 +392,7 @@ def resolve_depend(depend, include_dirs):
return
os
.
path
.
normpath
(
path
)
return
None
@
cached_function
def
package
(
filename
):
dir
=
os
.
path
.
dirname
(
os
.
path
.
abspath
(
str
(
filename
)))
...
...
@@ -390,6 +401,7 @@ def package(filename):
else
:
return
()
@
cached_function
def
fully_qualified_name
(
filename
):
module
=
os
.
path
.
splitext
(
os
.
path
.
basename
(
filename
))[
0
]
...
...
@@ -600,7 +612,9 @@ class DependencyTree(object):
finally
:
del
stack
[
node
]
_dep_tree
=
None
def
create_dependency_tree
(
ctx
=
None
,
quiet
=
False
):
global
_dep_tree
if
_dep_tree
is
None
:
...
...
@@ -937,7 +951,9 @@ if os.environ.get('XML_RESULTS'):
output
.
close
()
return
with_record
else
:
record_results
=
lambda
x
:
x
def
record_results
(
func
):
return
func
# TODO: Share context? Issue: pyx processing leaks into pxd module
@
record_results
...
...
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