Skip to content

Commit 07a17bc

Browse files
committed
python3Packages.debugpy: make src reproducible
1 parent 42e29df commit 07a17bc

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkgs/development/python-modules/debugpy/default.nix

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,17 @@ buildPythonPackage rec {
3232
owner = "microsoft";
3333
repo = "debugpy";
3434
tag = "v${version}";
35-
hash = "sha256-U9WeWAX0qDusWcMsFaI1ct4YKlGQEHUYlKZfRiYhma0=";
35+
36+
# Upstream uses .gitattributes to inject information about the revision
37+
# hash and the refname into `src/debugpy/_version.py`, see:
38+
#
39+
# - https://git-scm.com/docs/gitattributes#_export_subst and
40+
# - https://github.com/microsoft/debugpy/blob/v1.8.17/src/debugpy/_version.py#L24-L30
41+
postFetch = ''
42+
sed -i 's/git_refnames = "[^"]*"/git_refnames = " (tag: ${src.tag})"/' "$out/src/debugpy/_version.py"
43+
'';
44+
45+
hash = "sha256-eAiCtSJUqLASapxnYCyq1UCiGz6QmKQum7Vs3MoU1s8=";
3646
};
3747

3848
patches = [

0 commit comments

Comments
 (0)