#NEWLINE# def main( ) : #NEWLINE# #INDENT# opd = os . path . dirname #NEWLINE# opj = os . path . join #NEWLINE# s = None #NEWLINE# with open ( opj ( opd ( __file__ ) , '..' , 'setup.py' ) ) as f : #NEWLINE# #INDENT# s = f . read ( ) #NEWLINE# #UNINDENT# if s : #NEWLINE# #INDENT# if ( 'BUILD CACHE ACTIVATED (V2)' in s ) : #NEWLINE# #INDENT# print ( 'setup.py already wired with V2 build_cache, skipping..' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# SEP = '\nsetup(' #NEWLINE# ( before , after ) = s . split ( SEP ) #NEWLINE# with open ( opj ( opd ( __file__ ) , '..' , 'setup.py' ) , 'wb' ) as f : #NEWLINE# #INDENT# f . write ( ( ( ( before + shim ) + SEP ) + after ) . encode ( 'ascii' ) ) #NEWLINE# #UNINDENT# print ( '\n    setup.py was rewritten to use a build cache.\n    Make sure you\'ve put the following in your .bashrc:\n\n    export BUILD_CACHE_DIR=<an existing directory for saving cached files>\n    echo $BUILD_CACHE_DIR > pandas_repo_rootdir/.build_cache_dir\n\n    Once active, build results (compilation, cythonizations and 2to3 artifacts)\n    will be cached in "$BUILD_CACHE_DIR" and subsequent builds should be\n    sped up if no changes requiring recompilation were made.\n\n    Go ahead and run:\n\n    python setup.py clean\n    python setup.py develop\n\n    ' )