Commit 7ef5f46a authored by Kira Bruneau's avatar Kira Bruneau
Browse files

python313Packages.debugpy: make src reproducible

parent ac5a69f2
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -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=";
  };