about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/libcst/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/libcst/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/libcst/default.nix12
1 files changed, 10 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/libcst/default.nix b/nixpkgs/pkgs/development/python-modules/libcst/default.nix
index abad21fe6760..d1fc8ec75e33 100644
--- a/nixpkgs/pkgs/development/python-modules/libcst/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/libcst/default.nix
@@ -2,6 +2,7 @@
 , stdenv
 , buildPythonPackage
 , fetchFromGitHub
+, fetchpatch
 , cargo
 , hypothesis
 , libiconv
@@ -40,14 +41,21 @@ buildPythonPackage rec {
 
   cargoRoot = "native";
 
+  patches = [
+    # https://github.com/Instagram/LibCST/pull/1042
+    (fetchpatch {
+      name = "remove-distutils.patch";
+      url = "https://github.com/Instagram/LibCST/commit/a6834aa0e6eb78e41549fd1087d7ba60ca4dd237.patch";
+      hash = "sha256-lyIXJhm4UMwdCOso6McDslIvtK7Ar8sF5Zy7qo1nicQ=";
+    })
+  ];
+
   postPatch = ''
     # avoid infinite recursion by not formatting the release files
     substituteInPlace libcst/codegen/generate.py \
       --replace '"ufmt"' '"true"'
   '';
 
-  SETUPTOOLS_SCM_PRETEND_VERSION = version;
-
   nativeBuildInputs = [
     setuptools-rust
     setuptools-scm