#NEWLINE# def get_version( ) : #NEWLINE# #INDENT# vfile = os . path . join ( os . path . dirname ( __file__ ) , '..' , 'src' , 'rasterstats' , '_version.py' ) #NEWLINE# with open ( vfile , 'r' ) as vfh : #NEWLINE# #INDENT# vline = vfh . read ( ) #NEWLINE# #UNINDENT# vregex = '^__version__ = [\'\\"]([^\'\\"]*)[\'\\"]' #NEWLINE# match = re . search ( vregex , vline , re . M ) #NEWLINE# if match : #NEWLINE# #INDENT# return match . group ( 1 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise RuntimeError ( 'Unable to find version string in {}.' . format ( vfile ) )