<s> from __future__ import print_function <EOL> import pipes <EOL> import re <EOL> from fabric . api import settings , task , local , hide , env <EOL> from fabric . contrib . console import confirm <EOL> def is_working_tree_clean ( ) : <EOL> with settings ( hide ( '<STR_LIT>' ) , warn_only = True ) : <EOL> local ( '<STR_LIT>' ) <EOL> unstaged = local ( '<STR_LIT>' , <EOL> capture = True ) <EOL> uncommitted = local ( '<STR_LIT>' <EOL> '<STR_LIT>' , capture = True ) <EOL> return unstaged . succeeded and uncommitted . succeeded <EOL> @ task <EOL> def lint ( ) : <EOL> """<STR_LIT>""" <EOL> local ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> @ task <EOL> def authors ( ) : <EOL> """<STR_LIT>""" <EOL> fmt_re = re . compile ( r'<STR_LIT>' ) <EOL> authors = local ( '<STR_LIT>' , capture = True ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT:w>' ) as fh : <EOL> fh . write ( '<STR_LIT>' ) <EOL> fh . write ( '<STR_LIT>' ) <EOL> for line in authors . splitlines ( ) : <EOL> match = fmt_re . match ( line ) <EOL> name , email = match . groups ( ) <EOL> if email in env . ignored_authors : <EOL> continue <EOL> fh . write ( '<STR_LIT>' ) <EOL> fh . write ( line ) <EOL> fh . write ( '<STR_LIT:\n>' ) <EOL> @ task <EOL> def release ( ) : <EOL> """<STR_LIT>""" <EOL> if not is_working_tree_clean ( ) : <EOL> print ( '<STR_LIT>' ) <EOL> return <EOL> print ( '<STR_LIT>' ) <EOL> authors ( ) <EOL> if not is_working_tree_clean ( ) : <EOL> print ( '<STR_LIT>' <EOL> '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> return <EOL> version = '<STR_LIT>' . format ( local ( '<STR_LIT>' , capture = True ) ) <EOL> name = local ( '<STR_LIT>' , capture = True ) <EOL> tag_message = '<STR_LIT>' . format ( name , version ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( '<STR_LIT>' ) <EOL> print ( ) <EOL> print ( '<STR_LIT>' . format ( version ) ) <EOL> print ( '<STR_LIT>' . format ( tag_message ) ) <EOL> print ( ) <EOL> if not confirm ( '<STR_LIT>' , default = True ) : <EOL> print ( '<STR_LIT>' ) <EOL> return <EOL> local ( '<STR_LIT>' . format ( pipes . quote ( version ) , <EOL> pipes . quote ( tag_message ) ) ) <EOL> local ( '<STR_LIT>' ) <EOL> local ( '<STR_LIT>' ) </s>
