def _update_version(self, version):
if self.get_python_file_version():<EOL><INDENT>setup_cfg = pypi.SetupConfig()<EOL>filename = setup_cfg.python_file_with_version()<EOL>lines = open(filename).read().split('<STR_LIT:\n>')<EOL>for index, line in enumerate(lines):<EOL><INDENT>match = UNDERSCORED_VERSION_PATTERN.search(line)<EOL>if match:<EOL><INDENT>lines[index] = "<STR_LIT>" % version<EOL><DEDENT><DEDENT>contents = '<STR_LIT:\n>'.join(lines)<EOL>open(filename, '<STR_LIT:w>').write(contents)<EOL>logger.info("<STR_LIT>", filename, version)<EOL>return<EOL><DEDENT>versionfile = self.filefind(['<STR_LIT>', '<STR_LIT:version>'])<EOL>if versionfile:<EOL><INDENT>setup_version = self.get_setup_py_version()<EOL>if not setup_version or (setup_version ==<EOL>self.get_version_txt_version()):<EOL><INDENT>open(versionfile, '<STR_LIT:w>').write(version + '<STR_LIT:\n>')<EOL>logger.info("<STR_LIT>", versionfile, version)<EOL>return<EOL><DEDENT><DEDENT>good_version = "<STR_LIT>" % version<EOL>line_number = <NUM_LIT:0><EOL>setup_lines = open('<STR_LIT>').read().split('<STR_LIT:\n>')<EOL>for line in setup_lines:<EOL><INDENT>match = VERSION_PATTERN.search(line)<EOL>if match:<EOL><INDENT>logger.debug("<STR_LIT>", line)<EOL>if line.startswith('<STR_LIT:U+0020>'):<EOL><INDENT>indentation = line.split('<STR_LIT:version>')[<NUM_LIT:0>]<EOL>good_version = indentation + "<STR_LIT>" % version<EOL><DEDENT>setup_lines[line_number] = good_version<EOL>break<EOL><DEDENT>line_number += <NUM_LIT:1><EOL><DEDENT>contents = '<STR_LIT:\n>'.join(setup_lines)<EOL>open('<STR_LIT>', '<STR_LIT:w>').write(contents)<EOL>logger.info("<STR_LIT>", version)<EOL>
Find out where to change the version and change it.

        There are three places where the version can be defined. The first one
        is an explicitly defined Python file with a ``__version__``
        attribute. The second one is some version.txt that gets read by
        setup.py. The third is directly in setup.py.