diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 15f369a44f2..1fdbd4ffc0b 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -42,6 +42,9 @@ # generated binaries. , makeWrapperArgs ? [] +# Additional flags to pass to "pip install". +, installFlags ? [] + , ... } @ attrs: @@ -95,7 +98,7 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "doCheck"] // export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH" pushd dist - ${bootstrapped-pip}/bin/pip install *.whl --no-index --prefix=$out --no-cache + ${bootstrapped-pip}/bin/pip install *.whl --no-index --prefix=$out --no-cache ${toString installFlags} popd runHook postInstall diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index f925e688933..df742a5c84c 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -15067,6 +15067,10 @@ in modules // { sha256 = "46f4bd0d8dfd51125a554568d646fe4200a3c2c6c36b9f2d06d2212148439521"; }; + # pip detects that we already have bootstrapped_pip "installed", so we need + # to force it a little. + installFlags = [ "--ignore-installed" ]; + buildInputs = with self; [ mock scripttest virtualenv pytest ]; }; @@ -15492,7 +15496,7 @@ in modules // { ${python.executable} setup.py test ''; - installFlags = optional (versionAtLeast protobuf.version "2.6.0") "--cpp_implementation"; + installFlags = optional (versionAtLeast protobuf.version "2.6.0") "--install-option='--cpp_implementation'"; doCheck = true;