summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/setuptools
diff options
context:
space:
mode:
authorFrederik Rietdijk <fridh@fridh.nl>2019-10-20 15:33:35 +0200
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-10-20 19:48:00 +0200
commit56727dc1ff430bc2d39b08601e03094de4ab189e (patch)
treeaeb134a24d5f6759b9bbdb60824d453aba50775b /pkgs/development/python-modules/setuptools
parent1fca2ab52dacc18bb0e7a152709924c585760737 (diff)
Python: setuptools/wheel/pip now bootstrap from source
Since wheel support was introduced in 2015 we always relied on pre-built wheels for bootstrapping. Now, we can bootstrap directly from the sources of these packages in git. The `bootstrapped-pip` packages is used to build `pip`, `setuptools` and `wheel`, after which those packages are used to build everything else. Note that when building `bootstrapped-pip` some errors are shown. These are not important, the build actually does succeed and work as intended.
Diffstat (limited to 'pkgs/development/python-modules/setuptools')
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix35
1 files changed, 28 insertions, 7 deletions
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index 5053a46f4bf8..9254e53d1428 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -1,6 +1,6 @@
{ stdenv
, buildPythonPackage
-, fetchPypi
+, fetchFromGitHub
, python
, wrapPython
, unzip
@@ -11,19 +11,40 @@
, setuptoolsBuildHook
}:
-buildPythonPackage rec {
+let
pname = "setuptools";
version = "41.4.0";
+
+ # Create an sdist of setuptools
+ sdist = stdenv.mkDerivation rec {
+ name = "${pname}-${version}-sdist.tar.gz";
+
+ src = fetchFromGitHub {
+ owner = "pypa";
+ repo = pname;
+ rev = "v${version}";
+ sha256 = "0asxfnsi56r81lm48ynqbfkmm3kvw2jwrlf2l9azn5w6xm30jvp5";
+ name = "${pname}-${version}-source";
+ };
+
+ buildPhase = ''
+ ${python.pythonForBuild.interpreter} bootstrap.py
+ ${python.pythonForBuild.interpreter} setup.py sdist --formats=gztar
+ '';
+
+ installPhase = ''
+ echo "Moving sdist..."
+ mv dist/*.tar.gz $out
+ '';
+ };
+in buildPythonPackage rec {
+ 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 = fetchPypi {
- inherit pname version;
- extension = "zip";
- sha256 = "7eae782ccf36b790c21bde7d86a4f303a441cd77036b25c559a602cf5186ce4d";
- };
+ src = sdist;
nativeBuildInputs = [
bootstrapped-pip