<s> from subprocess import call <EOL> import os <EOL> import re <EOL> version = None <EOL> def get_new_setup_py_lines ( ) : <EOL> global version <EOL> with open ( '<STR_LIT>' , '<STR_LIT:r>' ) as sf : <EOL> current_setup = sf . readlines ( ) <EOL> for line in current_setup : <EOL> if line . startswith ( '<STR_LIT>' ) : <EOL> major , minor = re . findall ( r"<STR_LIT>" , line ) [ <NUM_LIT:0> ] <EOL> version = "<STR_LIT>" . format ( major , int ( minor ) + <NUM_LIT:1> ) <EOL> yield "<STR_LIT>" . format ( version ) <EOL> else : <EOL> yield line <EOL> lines = list ( get_new_setup_py_lines ( ) ) <EOL> with open ( '<STR_LIT>' , '<STR_LIT:w>' ) as sf : <EOL> sf . writelines ( lines ) <EOL> call ( '<STR_LIT>' , shell = True ) <EOL> call ( '<STR_LIT>' . format ( version ) , shell = True ) <EOL> call ( '<STR_LIT>' . format ( version ) , shell = True ) <EOL> call ( '<STR_LIT>' , shell = True ) <EOL> call ( '<STR_LIT>' , shell = True ) <EOL> env = os . environ <EOL> env [ '<STR_LIT>' ] = '<STR_LIT:true>' <EOL> call ( '<STR_LIT>' , shell = True , env = env ) </s>
