1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-09-11 15:08:33 +01:00
nixpkgs/pkgs
Rok Garbas 602f7e5aa4 python: collision in names when developing 2 and more python packages with nix
when you run nix-shell 2 times at the same time of project (but different
branches) you get collision in names inside /tmp folder. i solved this by
hashing current path of developing folder and using that as indentifier while
still keeping name at the end.

diff --git a/pkgs/development/python-modules/generic/default.nix
b/pkgs/development/python-modules/generic/default.nix index 4c9c53a..6ec7934
100644 --- a/pkgs/development/python-modules/generic/default.nix +++
b/pkgs/development/python-modules/generic/default.nix @@ -161,11 +161,12 @@ if
disabled then throw "${name} not supported for interpreter ${python.executabl

   shellHook = attrs.shellHook or ''
     if test -e setup.py; then
-       mkdir -p /tmp/$name/lib/${python.libPrefix}/site-packages
+       tmp_path=/tmp/`pwd | md5sum | cut -f 1 -d " "`-$name
+       mkdir -p $tmp_path/lib/${python.libPrefix}/site-packages
        ${preShellHook}
-       export PATH="/tmp/$name/bin:$PATH"
-       export PYTHONPATH="/tmp/$name/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
-       ${python}/bin/${python.executable} setup.py develop --prefix /tmp/$name
+       export PATH="$tmp_path/bin:$PATH"
+       export PYTHONPATH="$tmp_path/lib/${python.libPrefix}/site-packages:$PYTHONPATH"
+       ${python}/bin/${python.executable} setup.py develop --prefix $tmp_path
        ${postShellHook}
     fi
   '';
2014-09-19 14:23:45 +02:00
..
applications Merge pull request #4143 from geerds/cask 2014-09-19 13:23:28 +02:00
build-support build-fhs-chrootenv: bind mount chroots /tmp to hosts /tmp 2014-09-09 12:10:54 +02:00
data Merge pull request #4151 from lostdj/ltp/master/tzdata2014g 2014-09-18 18:37:37 +02:00
desktops Added termite package and updated vte to be compatible. 2014-09-18 23:29:58 +02:00
development python: collision in names when developing 2 and more python packages with nix 2014-09-19 14:23:45 +02:00
games dwarf-fortress: Bump to 0.40.13. 2014-09-18 20:41:54 +02:00
misc added alock package 2014-09-16 09:25:47 +02:00
os-specific Merge pull request #4092 from ts468/pam_mount 2014-09-17 13:15:22 +02:00
servers seyren: udpate to 1.1.0 2014-09-17 18:33:51 +02:00
shells fishshell builds on unix platforms 2014-09-16 09:04:55 +02:00
stdenv Revert "stdenv/setup.sh: unbreak *.lz sources on darwin" 2014-08-30 22:41:56 +02:00
test s/dependancy/dependency/ 2014-09-10 00:28:49 +01:00
tools curl: update to 7.38.0, including security (#4161) 2014-09-19 11:53:08 +02:00
top-level graphite_api: disable on pypy 2014-09-19 14:07:27 +02:00