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
7434e1b3
Commit
7434e1b3
authored
Jun 27, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix and clean up compressed source file caching
parent
045a3255
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
3 deletions
+20
-3
Cython/Build/Dependencies.py
Cython/Build/Dependencies.py
+20
-3
No files found.
Cython/Build/Dependencies.py
View file @
7434e1b3
...
...
@@ -6,6 +6,7 @@ from Cython import __version__
from
glob
import
glob
import
re
,
os
,
sys
import
gzip
import
shutil
import
subprocess
try
:
...
...
@@ -646,12 +647,20 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
# Cython-generated c files are highly compressible.
# (E.g. a compression ratio of about 10 for Sage).
fingerprint_file
=
os
.
path
.
join
(
options
.
cache
,
"%s-%s.gz"
%
(
os
.
path
.
basename
(
c_file
),
fingerprint
)
options
.
cache
,
"%s-%s.gz"
%
(
os
.
path
.
basename
(
c_file
),
fingerprint
)
)
if
os
.
path
.
exists
(
fingerprint_file
):
if
not
quiet
:
print
(
"Found compiled %s in cache"
%
pyx_file
)
os
.
utime
(
fingerprint_file
,
None
)
open
(
c_file
,
'wb'
).
write
(
gzip
.
open
(
fingerprint_file
).
read
())
g
=
gzip
.
open
(
fingerprint_file
)
try
:
f
=
open
(
c_file
,
'wb'
)
try
:
shutil
.
copyfileobj
(
g
,
f
)
finally
:
f
.
close
()
finally
:
g
.
close
()
return
if
not
quiet
:
print
(
"Cythonizing %s"
%
pyx_file
)
...
...
@@ -670,7 +679,15 @@ def cythonize_one(pyx_file, c_file, fingerprint, quiet, options=None):
if
any_failures
:
raise
CompileError
(
None
,
pyx_file
)
if
fingerprint
:
gzip
.
open
(
fingerprint_file
,
'wb'
).
write
(
open
(
c_file
).
read
())
f
=
open
(
c_file
,
'rb'
)
try
:
g
=
gzip
.
open
(
fingerprint_file
,
'wb'
)
try
:
shutil
.
copyfileobj
(
f
,
g
)
finally
:
g
.
close
()
finally
:
f
.
close
()
def
cythonize_one_helper
(
m
):
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