def __init__(self, package, version):
        """Construct a new requirement.

        :param package: the package name.
        :param version: a semver compatible version specification.
        """
        self.package = package
        self.version = version
        if self.version and not re.match(r"[<=>~]", version[:2]):
            self.version = "=={}".format(self.version)
def git_checkout(git_url, git_branch=None, git_tag=None, git_hash=None):
    git_dst = tempfile.mkdtemp()
    g = GitManager(url=git_url, git_dst=git_dst, git_branch=git_branch, git_tag=git_tag, git_hash=git_hash)
    g.run()
    shutil.rmtree(git_dst)