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
) – ifTrue
version starts always withv
, otherwise it never starts withv
- Return type
- Returns
version number
Examples
>>> git_repo_version() 'v1.0.0'