diff --git a/.gitattributes b/.gitattributes index fd6f3e06..48f9b68a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,4 @@ -hdtv/_version.py export-subst +pyproject.toml export-subst * text=auto eol=lf # diff --git a/pyproject.toml b/pyproject.toml index d42714b1..0fa052d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -97,6 +97,13 @@ hdtv = ["share/*"] "share/bash-completion/completions" = ["data/completions/hdtv"] "share/applications" = ["data/hdtv.desktop"] +[tool.versioningit.vcs] +method = "git-archive" +describe-subst = "$Format:%(describe:tags)$" +# A clone or fork with tags is needed to get the correct version information. +# The fixed `default-tag` is used when no git tag is available. +default-tag = "0000" + [tool.versioningit.format] distance = "{base_version}+{distance}.{vcs}{rev}" dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"