class_docstr: Helps to build releases through scripting of steps.
class_docstr_tok: ["Helps","to","build","releases","through","scripting","of","steps","."]
docstr: Initialize ReleaseBuilder class.
  
  Args:
    git_repo: Full path to github repo.
    version_file: relative path to version file in repo.
    release_number: String representing the release number, e.g. 0.1.2 or
      0.2.3.rc1.
    working_dir: Full path to the directory to check the code out into.
    branch_hash: Git hash to use to create the new branch if needed.
docstr_tok: ["Initialize","ReleaseBuilder","class",".","Args",":","git_repo",":","Full","path","to","github","repo",".","version_file",":","relative","path","to","version","file","in","repo",".","release_number",":","String","representing","the","release","number",",","e.g",".","0.1.2","or","0.2.3.rc1",".","working_dir",":","Full","path","to","the","directory","to","check","the","code","out","into",".","branch_hash",":","Git","hash","to","use","to","create","the","new","branch","if","needed","."]
code: def __init__(
      self,
      git_repo,
      version_file,
      release_number,
      working_dir,
      branch_hash,
  ):
      """Initialize ReleaseBuilder class.
  
      Args:
        git_repo: Full path to github repo.
        version_file: relative path to version file in repo.
        release_number: String representing the release number, e.g. 0.1.2 or
          0.2.3.rc1.
        working_dir: Full path to the directory to check the code out into.
        branch_hash: Git hash to use to create the new branch if needed.
      """
      (
          self.major,
          self.minor,
          self.patch,
          self.release,
      ) = self._parse_version_input(release_number)
      self.branch_name = "r{}.{}.{}".format(
          self.major, self.minor, self.patch
      )
      self.tag_name = "v{}.{}.{}".format(
          self.major, self.minor, self.patch
      )
      self.branch_hash = branch_hash
      self.repo = self._get_repo(git_repo, working_dir)
      if version_file:
          self.version_file = os.path.join(
              self.repo.working_tree_dir, version_file
          )
  
file_path: agents/tools/release_builder.py
imports: import fileinput
  import os
  from absl import app
  from absl import flags
  from absl import logging
  from git import Repo
  from git.exc import GitCommandError
  from git.exc import InvalidGitRepositoryError
label_desc: Use image node_id 1 to create a new ReleaseBuilder object from inherited base classes: object with example: obj = ReleaseBuilder(git_repo, version_file, release_number, working_dir, branch_hash)