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
11df8495
Commit
11df8495
authored
May 25, 2012
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cython cache compression
parent
909fe12e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+8
-4
No files found.
Cython/Build/Dependencies.py
View file @
11df8495
...
@@ -4,7 +4,8 @@ import cython
...
@@ -4,7 +4,8 @@ import cython
from
Cython
import
__version__
from
Cython
import
__version__
from
glob
import
glob
from
glob
import
glob
import
re
,
os
,
shutil
,
sys
import
re
,
os
,
sys
import
gzip
try
:
try
:
import
hashlib
import
hashlib
...
@@ -594,12 +595,15 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
...
@@ -594,12 +595,15 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
except
:
except
:
if
not
os
.
path
.
exists
(
options
.
cache
):
if
not
os
.
path
.
exists
(
options
.
cache
):
raise
raise
fingerprint_file
=
os
.
path
.
join
(
options
.
cache
,
fingerprint
+
'-'
+
os
.
path
.
basename
(
c_file
))
# Cython-generated c files are highly compressible.
# (E.g. a compression ratio of about 10 for Sage).
fingerprint_file
=
os
.
path
.
join
(
options
.
cache
,
fingerprint
+
'-'
+
os
.
path
.
basename
(
c_file
)
+
'.gz'
)
if
os
.
path
.
exists
(
fingerprint_file
):
if
os
.
path
.
exists
(
fingerprint_file
):
if
not
quiet
:
if
not
quiet
:
print
(
"Found compiled %s in cache"
%
pyx_file
)
print
(
"Found compiled %s in cache"
%
pyx_file
)
os
.
utime
(
fingerprint_file
,
None
)
os
.
utime
(
fingerprint_file
,
None
)
shutil
.
copy
(
fingerprint_file
,
c_file
)
open
(
c_file
,
'wb'
).
write
(
gzip
.
open
(
fingerprint_file
).
read
()
)
return
return
if
not
quiet
:
if
not
quiet
:
print
(
"Cythonizing %s"
%
pyx_file
)
print
(
"Cythonizing %s"
%
pyx_file
)
...
@@ -618,7 +622,7 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
...
@@ -618,7 +622,7 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
if
any_failures
:
if
any_failures
:
raise
CompileError
(
None
,
pyx_file
)
raise
CompileError
(
None
,
pyx_file
)
if
fingerprint
:
if
fingerprint
:
shutil
.
copy
(
c_file
,
fingerprint_file
)
gzip
.
open
(
fingerprint_file
,
'wb'
).
write
(
open
(
c_file
).
read
()
)
def
cythonize_one_helper
(
m
):
def
cythonize_one_helper
(
m
):
return
cythonize_one
(
*
m
[
1
:])
return
cythonize_one
(
*
m
[
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