Permalink
Browse files

make setup.py less failure-prone with cython

  • Loading branch information...
1 parent ac55752 commit 2e188a82547b7661b50ae9c6497cbe283c865300 @rspeer rspeer committed Apr 16, 2010
Showing with 19 additions and 18 deletions.
  1. +3 −3 fabfile.py
  2. +16 −15 setup.py
View
@@ -7,11 +7,10 @@ def push():
def git_dance():
local('git commit -av', capture=False)
- local('git pull origin master')
- local('git push origin master')
+ local('git pull origin master', capture=False)
+ local('git push origin master', capture=False)
def metapush():
- push()
with cd('~/mmp/omcs/divisi2'):
local('git pull')
with cd('~/mmp/omcs'):
@@ -20,6 +19,7 @@ def metapush():
git_dance()
def release():
+ push()
metapush()
local('python setup.py sdist upload')
View
@@ -57,21 +57,22 @@
### Update the Cython file, if necessary.
def get_modification_time(filename):
return os.stat(filename)[ST_MTIME]
-
-if not os.path.exists(CYTHON_OUT) or get_modification_time(CYTHON_SRC) > get_modification_time(CYTHON_OUT):
- try:
- # Try building the Cython file
- print 'Building Cython source'
- from Cython.Compiler.Main import compile
- res = compile(CYTHON_SRC)
- if res.num_errors > 0:
- print >>sys.stderr, "Error building the Cython file."
- sys.exit(1)
- except ImportError:
- print >>sys.stderr, 'Warning: Skipped building the Cython file.'
- print >>sys.stderr, ' The svdlib source file is more recent than the Cython output file, but'
- print >>sys.stderr, ' you seem to lack Cython, so skipping rebuilding it.'
-
+try:
+ if not os.path.exists(CYTHON_OUT) or get_modification_time(CYTHON_SRC) > get_modification_time(CYTHON_OUT):
+ try:
+ # Try building the Cython file
+ print 'Building Cython source'
+ from Cython.Compiler.Main import compile
+ res = compile(CYTHON_SRC)
+ if res.num_errors > 0:
+ print >>sys.stderr, "Error building the Cython file."
+ sys.exit(1)
+ except ImportError:
+ print >>sys.stderr, 'Warning: Skipped building the Cython file.'
+ print >>sys.stderr, ' The svdlib source file is more recent than the Cython output file, but'
+ print >>sys.stderr, ' you seem to lack Cython, so skipping rebuilding it.'
+except OSError:
+ print >>sys.stderr, 'Warning: Skipped building the Cython file.'
svdlibc = Extension(
name='csc.divisi2._svdlib',

0 comments on commit 2e188a8

Please sign in to comment.