···17buildPythonPackage rec {
18 pname = "setuptools-git-versioning";
19 version = "2.1.0";
20+ pyproject = true;
2122 src = fetchFromGitHub {
23 owner = "dolfinus";
···25 tag = "v${version}";
26 hash = "sha256-Slf6tq83LajdTnr98SuCiFIdm/6auzftnARLAOBgyng=";
27 };
28+29+ postPatch = ''
30+ # Because the .git dir is missing, it falls back to using version 0.0.1
31+ # Instead we use the version specified in the derivation
32+ substituteInPlace setup.py --replace-fail \
33+ 'version=version_from_git(root=here, dev_template="{tag}.post{ccount}")' \
34+ "version='${version}'"
35+ '';
3637 build-system = [
38 setuptools