buildPythonPackage: accept developmentPrefix and send pip
output to stderr
#22015
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation for this change
This changes 2 small parts about
buildPythonPackage
. I'm happy to split them into two PRs if you prefer, but I figured I'd combine them since they require a rebuild of all python packages.pip install
output tostderr
. The nix integration in direnv (https://direnv.net/, from @zimbatm) relies onnix-shell --run CMD
producing only the output fromCMD
on stdout (it dumps the environment from inside nix-shell and recreates it in your current shell). The python shellHook logs the followingpip
boilerplate to stdout, which breaks this functionality:This is clearly output that belongs on
stderr
, so I've added a>&2
redirect in the shell hook.developmentPrefix
tobuildPythonPackage
. This is used only in the shellHook, and allows a specific path to be used for development installation, rather than creating a tempfile each time. This keeps the $PATH reproducible, which is important if you store it somewhere to be reused at a later time (since nix-shell can take a while on complex inputs, I cache the results used bydirenv
to set my environment). The default behaviour is unchanged.Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)