diff --git a/pkgs/development/python-modules/debugpy/default.nix b/pkgs/development/python-modules/debugpy/default.nix index a288bccf7d89..ed81790c081e 100644 --- a/pkgs/development/python-modules/debugpy/default.nix +++ b/pkgs/development/python-modules/debugpy/default.nix @@ -32,6 +32,16 @@ buildPythonPackage rec { owner = "microsoft"; repo = "debugpy"; tag = "v${version}"; + + # Upstream uses .gitattributes to inject information about the revision + # hash and the refname into `src/debugpy/_version.py`, see: + # + # - https://git-scm.com/docs/gitattributes#_export_subst and + # - https://github.com/microsoft/debugpy/blob/v1.8.17/src/debugpy/_version.py#L24-L30 + postFetch = '' + sed -i 's/git_refnames = "[^"]*"/git_refnames = " (tag: ${src.tag})"/' "$out/src/debugpy/_version.py" + ''; + hash = "sha256-eAiCtSJUqLASapxnYCyq1UCiGz6QmKQum7Vs3MoU1s8="; };