setuptools-git-versioning: fix package version

Co-authored-by: TomaSajt <TomaSajt@users.noreply.github.com>
This commit is contained in:
Luca A.
2025-08-04 14:55:31 +02:00
co-authored by TomaSajt
parent 03316b4b4e
commit d606980e61
@@ -17,7 +17,7 @@
buildPythonPackage rec {
pname = "setuptools-git-versioning";
version = "2.1.0";
format = "pyproject";
pyproject = true;
src = fetchFromGitHub {
owner = "dolfinus";
@@ -26,6 +26,14 @@ buildPythonPackage rec {
hash = "sha256-Slf6tq83LajdTnr98SuCiFIdm/6auzftnARLAOBgyng=";
};
postPatch = ''
# Because the .git dir is missing, it falls back to using version 0.0.1
# Instead we use the version specified in the derivation
substituteInPlace setup.py --replace-fail \
'version=version_from_git(root=here, dev_template="{tag}.post{ccount}")' \
"version='${version}'"
'';
build-system = [
setuptools
];