@staticmethod  <EOL><INDENT>def increment(version):<DEDENT>
release_version = os.environ.get("<STR_LIT>", None)<EOL>if release_version is not None:<EOL><INDENT>return release_version<EOL><DEDENT>if isinstance(version, LegacyVersion):<EOL><INDENT>msg = """<STR_LIT>"""<EOL>raise Exception(msg.format(version))<EOL><DEDENT>release_type = os.environ.get("<STR_LIT>", "<STR_LIT>")<EOL>v = version._version<EOL>epoch_name, epoch = VersionUtils.get_version_number(v, <NUM_LIT:0>, None, "<STR_LIT:!>")<EOL>pre_name, pre = VersionUtils.get_version_number(v, <NUM_LIT:3>, None, "<STR_LIT>")<EOL>post_name, post = VersionUtils.get_version_number(v, <NUM_LIT:4>, None, "<STR_LIT>")<EOL>dev_name, dev = VersionUtils.get_version_number(v, <NUM_LIT:2>, None, "<STR_LIT>")<EOL>_, major = VersionUtils.get_version_number(v[<NUM_LIT:1>], <NUM_LIT:0>, <NUM_LIT:0>)<EOL>_, minor = VersionUtils.get_version_number(v[<NUM_LIT:1>], <NUM_LIT:1>, None)<EOL>_, micro = VersionUtils.get_version_number(v[<NUM_LIT:1>], <NUM_LIT:2>, None)<EOL>if release_type == "<STR_LIT>":<EOL><INDENT>micro, post, pre = VersionUtils.process_pre(micro, post, pre)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev, post = VersionUtils.process_post(dev, post)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev = VersionUtils.process_dev(dev)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev, micro, minor, post, pre = VersionUtils.process_micro(<EOL>dev, micro, minor, post, pre<EOL>)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev, micro, minor, post, pre = VersionUtils.process_minor(<EOL>dev, micro, minor, post, pre<EOL>)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev, major, micro, minor, post, pre = VersionUtils.process_major(<EOL>dev, major, micro, minor, post, pre<EOL>)<EOL><DEDENT>if release_type == "<STR_LIT>":<EOL><INDENT>dev, epoch, major, micro, minor, post, pre = VersionUtils.process_epoch(<EOL>dev, epoch, major, micro, minor, post, pre<EOL>)<EOL><DEDENT>local = "<STR_LIT>".join(v[<NUM_LIT:5>] or []) or None<EOL>version_list = [major, minor, micro]<EOL>if release_type not in ["<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]:<EOL><INDENT>version_list += list(v[<NUM_LIT:1>][<NUM_LIT:3>:])<EOL><DEDENT>version_string = "<STR_LIT:.>".join([str(x) for x in version_list if x or x == <NUM_LIT:0>])<EOL>if epoch:<EOL><INDENT>version_string = str(epoch) + epoch_name + version_string<EOL><DEDENT>if pre is not None:<EOL><INDENT>version_string = VersionUtils.calc_pre_version_string(<EOL>pre, pre_name, version_string<EOL>)<EOL><DEDENT>if post is not None:<EOL><INDENT>version_string += "<STR_LIT:.>" + post_name + str(post)<EOL><DEDENT>if dev is not None:<EOL><INDENT>version_string += "<STR_LIT:.>" + dev_name + str(dev)<EOL><DEDENT>if local is not None:<EOL><INDENT>version_string += "<STR_LIT:.>" + str(local)<EOL><DEDENT>return version_string<EOL>
Return an incremented version string.