poli.core.util.files.download_files_from_github.get_sha_for_tag

poli.core.util.files.download_files_from_github.get_sha_for_tag#

poli.core.util.files.download_files_from_github.get_sha_for_tag(repository: github.Repository.Repository, tag: str) str#

Returns a commit PyGithub object for the specified repository and tag.

Parameters
  • repository (Repository) – The repository.

  • tag (str) – The tag.

Returns

commit_sha – The commit SHA for the specified repository and tag.

Return type

str

Raises

ValueError – If no tag or branch exists with the specified name.

Examples

>>> from github import Github
>>> from github.Repository import Repository
>>> github = Github()
>>> repository = github.get_repo("rdkit/rdkit")
>>> get_sha_for_tag(repository, "Release_2023_09")
'068441957858f786c227825d90eb2c43f4f2b000'