git_repo_version()

audeer.git_repo_version(*, v=True)[source]

Get a version number from current git ref.

The version is inferred executing git describe --tags --always. If the command fails, '<unknown>' is returned.

Parameters

v (bool) – if True version starts always with v, otherwise it never starts with v

Return type

str

Returns

version number

Examples

>>> git_repo_version()
'v1.0.0'