1{ stdenv
2, buildPythonPackage
3, fetchPypi
4, python
5, wrapPython
6, unzip
7, callPackage
8, bootstrapped-pip
9}:
10
11buildPythonPackage rec {
12 pname = "setuptools";
13 version = "41.2.0";
14 format = "other";
15
16 src = fetchPypi {
17 inherit pname version;
18 extension = "zip";
19 sha256 = "66b86bbae7cc7ac2e867f52dc08a6bd064d938bac59dfec71b9b565dd36d6012";
20 };
21
22 # There is nothing to build
23 dontBuild = true;
24
25 nativeBuildInputs = [ bootstrapped-pip ];
26
27 installPhase = ''
28 dst=$out/${python.sitePackages}
29 mkdir -p $dst
30 export PYTHONPATH="$dst:$PYTHONPATH"
31 ${python.pythonForBuild.interpreter} setup.py install --prefix=$out
32 wrapPythonPrograms
33 '';
34
35 # Adds setuptools to nativeBuildInputs causing infinite recursion.
36 catchConflicts = false;
37
38 # Requires pytest, causing infinite recursion.
39 doCheck = false;
40
41 meta = with stdenv.lib; {
42 description = "Utilities to facilitate the installation of Python packages";
43 homepage = https://pypi.python.org/pypi/setuptools;
44 license = with licenses; [ psfl zpl20 ];
45 platforms = python.meta.platforms;
46 priority = 10;
47 };
48}