From 3b83c23012ab435bd38a38a4cf6f927c48e8d609 Mon Sep 17 00:00:00 2001 From: Frederik Rietdijk Date: Wed, 7 Jun 2017 17:28:34 +0200 Subject: [PATCH] python.pkgs.bootstrapped-pip: upgrade pkg_resources, fixes #26392 pip 9.0.1 vendors a version of setuptools/pkg_resources which has been fixed in setuptools/pkg_resources but not yet in pip. Because we're now facing this issue with nox, we update pkg_resources to the version we also have in setuptools. Let's cross our fingers this will work without breaking other stuff. --- .../python-modules/bootstrapped-pip/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/bootstrapped-pip/default.nix b/pkgs/development/python-modules/bootstrapped-pip/default.nix index 0f8b6652c267..3e07806986b1 100644 --- a/pkgs/development/python-modules/bootstrapped-pip/default.nix +++ b/pkgs/development/python-modules/bootstrapped-pip/default.nix @@ -1,4 +1,4 @@ -{ stdenv, python, fetchPypi, makeWrapper, unzip }: +{ stdenv, python, fetchPypi, fetchurl, makeWrapper, unzip }: let wheel_source = fetchPypi { @@ -13,6 +13,15 @@ let format = "wheel"; sha256 = "f2900e560efc479938a219433c48f15a4ff4ecfe575a65de385eeb44f2425587"; }; + + # TODO: Shouldn't be necessary anymore for pip > 9.0.1! + # https://github.com/NixOS/nixpkgs/issues/26392 + # https://github.com/pypa/setuptools/issues/885 + pkg_resources = fetchurl { + url = https://raw.githubusercontent.com/pypa/setuptools/v36.0.1/pkg_resources/__init__.py; + sha256 = "1wdnq3mammk75mifkdmmjx7yhnpydvnvi804na8ym4mj934l2jkv"; + }; + in stdenv.mkDerivation rec { pname = "pip"; version = "9.0.1"; @@ -29,6 +38,8 @@ in stdenv.mkDerivation rec { unzip -d $out/${python.sitePackages} $src unzip -d $out/${python.sitePackages} ${setuptools_source} unzip -d $out/${python.sitePackages} ${wheel_source} + # TODO: Shouldn't be necessary anymore for pip > 9.0.1! + cp ${pkg_resources} $out/${python.sitePackages}/pip/_vendor/pkg_resources/__init__.py ''; patchPhase = ''