about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/setuptools/default.nix')
-rw-r--r--nixpkgs/pkgs/development/python-modules/setuptools/default.nix70
1 files changed, 16 insertions, 54 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/setuptools/default.nix b/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
index c851cef24b30..ad7638f3cb38 100644
--- a/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/setuptools/default.nix
@@ -1,73 +1,36 @@
 { stdenv
+, lib
 , buildPythonPackage
 , fetchFromGitHub
 , python
-, bootstrapped-pip
-, lib
-, pipInstallHook
-, setuptoolsBuildHook
+, wheel
 }:
 
-let
+buildPythonPackage rec {
   pname = "setuptools";
-  version = "67.4.0";
-
-  # Create an sdist of setuptools
-  sdist = stdenv.mkDerivation rec {
-    name = "${pname}-${version}-sdist.tar.gz";
-
-    src = fetchFromGitHub {
-      owner = "pypa";
-      repo = pname;
-      rev = "refs/tags/v${version}";
-      hash = "sha256-QDHycUFA2VRUE9alan8rF0efZTNV3Jt0CskjkCc+in0=";
-      name = "${pname}-${version}-source";
-    };
-
-    patches = [
-      ./tag-date.patch
-      ./setuptools-distutils-C++.patch
-    ];
-
-    buildPhase = ''
-      ${python.pythonForBuild.interpreter} setup.py egg_info
-      ${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
-
-      # Here we untar the sdist and retar it in order to control the timestamps
-      # of all the files included
-      tar -xzf dist/${pname}-${version}.post0.tar.gz -C dist/
-      tar -czf dist/${name} -C dist/ --mtime="@$SOURCE_DATE_EPOCH" --sort=name ${pname}-${version}.post0
-    '';
-
-    installPhase = ''
-      echo "Moving sdist..."
-      mv dist/${name} $out
-    '';
+  version = "68.0.0";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "pypa";
+    repo = "setuptools";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-Ew/DpI5XsYMB4kBfkFeeB5wv5cjx4oYTddZCWLgBHBs=";
   };
-in buildPythonPackage {
-  inherit pname version;
-  # Because of bootstrapping we don't use the setuptoolsBuildHook that comes with format="setuptools" directly.
-  # Instead, we override it to remove setuptools to avoid a circular dependency.
-  # The same is done for pip and the pipInstallHook.
-  format = "other";
 
-  src = sdist;
+  patches = [
+    ./tag-date.patch
+    ./setuptools-distutils-C++.patch
+  ];
 
   nativeBuildInputs = [
-    bootstrapped-pip
-    (pipInstallHook.override{pip=null;})
-    (setuptoolsBuildHook.override{setuptools=null; wheel=null;})
+    wheel
   ];
 
   preBuild = lib.optionalString (!stdenv.hostPlatform.isWindows) ''
     export SETUPTOOLS_INSTALL_WINDOWS_SPECIFIC_FILES=0
   '';
 
-  pipInstallFlags = [ "--ignore-installed" ];
-
-  # Adds setuptools to nativeBuildInputs causing infinite recursion.
-  catchConflicts = false;
-
   # Requires pytest, causing infinite recursion.
   doCheck = false;
 
@@ -77,7 +40,6 @@ in buildPythonPackage {
     changelog = "https://setuptools.pypa.io/en/stable/history.html#v${replaceStrings [ "." ] [ "-" ] version}";
     license = with licenses; [ mit ];
     platforms = python.meta.platforms;
-    priority = 10;
     maintainers = teams.python.members;
   };
 }