GitHubInventory#

class neophile.inventory.github.GitHubInventory(http_client)#

Bases: object

Inventory available tags of a GitHub repository.

Parameters:

http_client (AsyncClient) – HTTP client to use for requests.

Methods Summary

inventory(owner, repo, *[, semantic])

Return the latest tag of a GitHub repository.

Methods Documentation

async inventory(owner, repo, *, semantic=False)#

Return the latest tag of a GitHub repository.

Parameters:
  • owner (str) – Owner of the repository.

  • repo (str) – Name of the repository.

  • semantic (bool, default: False) – If set to true, only semantic versions will be considered and the latest version will be determined by semantic version sorting instead of packaging.version.Version.

Returns:

The latest tag in sorted order. Tags that parse as valid versions sort before tags that do not, which should normally produce the correct results when version tags are mixed with other tags. If no valid tags are found or the repository doesn’t exist, returns None.

Return type:

str or None