project_config.fetchers.github module

Github files resources URIs fetcher.

project_config.fetchers.github._build_raw_githubusercontent_url(repo_owner: str, repo_name: str, git_reference: str, fpath: str) str[source]
project_config.fetchers.github._get_default_branch_from_git_repo(repo_owner: str, repo_name: str) str[source]
project_config.fetchers.github._get_default_branch_from_repo_branches_html(repo_owner: str, repo_name: str) Optional[str][source]
project_config.fetchers.github._get_default_branch_from_repo_github_api(repo_owner: str, repo_name: str) str[source]
project_config.fetchers.github.fetch(url_parts: urllib.parse.SplitResult, **kwargs: Any) str[source]

Fetch a resource through HTTPs protocol for a Github URI.

Parameters

url_parts (urllib.parse.SplitResult) – The URL parts of the URI.

Returns

The fetched resource content.

Return type

str

project_config.fetchers.github.get_latest_release_tags(repo_owner: str, repo_name: str, only_semver: bool = False) List[str][source]

Get the latest release tag of a Github repository.

Parameters
  • repo_owner (str) – The Github repository owner.

  • repo_name (str) – The Github repository name.

  • only_semver (bool) – If True, only return a tag if it is a semver tag.

Returns

The latest release tag.

Return type

str

project_config.fetchers.github.resolve_url(url_parts: urllib.parse.SplitResult) str[source]

Resolve a gh: scheme URI to their real counterpart.

Parameters

url_parts (urllib.parse.SplitResult) – The URL parts of the URI.

Returns

The real https: scheme URL.

Return type

str