def get_version():
    """Returns project version as string from 'git describe' command."""

    from subprocess import check_output

    _version = check_output(["git", "describe", "--tags", "--always"])

    if _version:
        return _version.decode("utf-8")
    else:
        return "X.Y"
Returns project version as string from 'git describe' command.
doc/source/conf.py