#NEWLINE# def get_version( ) : #NEWLINE# #INDENT# VERSIONFILE = 'curator/_version.py' #NEWLINE# verstrline = fread ( VERSIONFILE ) . strip ( ) #NEWLINE# vsre = '^__version__ = [\'\\"]([^\'\\"]*)[\'\\"]' #NEWLINE# mo = re . search ( vsre , verstrline , re . M ) #NEWLINE# if build_number : #NEWLINE# #INDENT# VERSION = mo . group ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( ( 'Unable to find version string in %s.' % ( VERSIONFILE , ) ) ) #NEWLINE# #UNINDENT# build_number = os . environ . get ( 'CURATOR_BUILD_NUMBER' , None ) #NEWLINE# if build_number : #NEWLINE# #INDENT# return ( VERSION + 'b{}' . format ( build_number ) ) #NEWLINE# #UNINDENT# return VERSION