#NEWLINE# def package_to_requirement( package_name ) : #NEWLINE# #INDENT# 'Translate a name like Foo-1.2 to Foo==1.3' #NEWLINE# match = re . search ( '^(.*?)-(dev|\\d.*)' , package_name ) #NEWLINE# if match : #NEWLINE# #INDENT# name = match . group ( 1 ) #NEWLINE# version = match . group ( 2 ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# name = package_name #NEWLINE# version = '' #NEWLINE# #UNINDENT# if version : #NEWLINE# #INDENT# return ( '%s==%s' % ( version , version ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return name