Skip to content

Commit 82c3e33

Browse files
authored
python313Packages.debugpy: make src reproducible (#468328)
2 parents 8645d7d + a245797 commit 82c3e33

File tree

2 files changed

+10
-52
lines changed

2 files changed

+10
-52
lines changed

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,20 @@ buildPythonPackage rec {
3232
owner = "microsoft";
3333
repo = "debugpy";
3434
tag = "v${version}";
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+
3545
hash = "sha256-eAiCtSJUqLASapxnYCyq1UCiGz6QmKQum7Vs3MoU1s8=";
3646
};
3747

3848
patches = [
39-
# Use nixpkgs version instead of versioneer
40-
(replaceVars ./hardcode-version.patch {
41-
inherit version;
42-
})
43-
4449
# Fix importing debugpy in:
4550
# - test_nodebug[module-launch(externalTerminal)]
4651
# - test_nodebug[module-launch(integratedTerminal)]

pkgs/development/python-modules/debugpy/hardcode-version.patch

Lines changed: 0 additions & 47 deletions
This file was deleted.

0 commit comments

Comments
 (0)