buildPythonPackage: add shell hook for instant development
This commit is contained in:
parent
f0f2125620
commit
0558c87288
|
@ -38,6 +38,12 @@
|
|||
|
||||
, meta ? {}
|
||||
|
||||
# Execute before shell hook
|
||||
, preShellHook ? ""
|
||||
|
||||
# Execute after shell hook
|
||||
, postShellHook ? ""
|
||||
|
||||
, ... } @ attrs:
|
||||
|
||||
# Keep extra attributes from `attrs`, e.g., `patchPhase', etc.
|
||||
|
@ -150,6 +156,16 @@ python.stdenv.mkDerivation (attrs // {
|
|||
done
|
||||
'';
|
||||
|
||||
shellHook = attrs.shellHook or ''
|
||||
mkdir -p /tmp/$name/lib/${python.libPrefix}/site-packages
|
||||
${preShellHook}
|
||||
export PATH="/tmp/$name/bin:$PATH"
|
||||
export PYTHONPATH="/tmp/$name/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
|
||||
python setup.py develop --prefix /tmp/$name
|
||||
${postShellHook}
|
||||
return
|
||||
'';
|
||||
|
||||
meta = with lib.maintainers; {
|
||||
# default to python's platforms
|
||||
platforms = python.meta.platforms;
|
||||
|
|
Loading…
Reference in a new issue