Changeset 7617:a973d3d90f93


Ignore:
Timestamp:
12/11/07 12:16:34 (6 years ago)
Author:
William Stein <wstein@…>
Branch:
default
Message:

Trac #1462 -- optimize "sage -b"

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r7601 r7617  
    33push 
    44pull 
     5.cython_hash$ 
    56\.hi$ 
    67\.mtl$ 
  • setup.py

    r7605 r7617  
    10511051            sys.exit(1) 
    10521052    return [outfile] 
    1053      
     1053 
     1054def hash_of_cython_file_timestamps(): 
     1055    h = 0 
     1056    extensions = set(['.pyx', '.pxd', '.pxi']) 
     1057    def hash_of_dir(dir): 
     1058        h = 0 
     1059        for f in os.listdir(dir): 
     1060            z = dir + '/' + f 
     1061            if os.path.isdir(z): 
     1062                h += hash_of_dir(z) 
     1063            elif f[-4:] in extensions: 
     1064                h += hash(os.path.getmtime(z)) 
     1065        return h 
     1066    return hash_of_dir('sage') 
     1067 
     1068CYTHON_HASH_FILE='.cython_hash' 
     1069H = str(hash_of_cython_file_timestamps()) 
     1070if not os.path.exists(CYTHON_HASH_FILE): 
     1071    H_old = H + 'x' 
     1072else: 
     1073    H_old = open(CYTHON_HASH_FILE).read() 
     1074if H != H_old: 
     1075    do_cython = True 
     1076    open(CYTHON_HASH_FILE,'w').write(H) 
     1077else: 
     1078    do_cython = False 
    10541079 
    10551080def cython(ext_modules): 
     
    10691094         
    10701095 
    1071 if not sdist: 
     1096if not sdist and do_cython: 
    10721097    cython(ext_modules) 
    10731098 
Note: See TracChangeset for help on using the changeset viewer.