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
'';
Before we used `easy_install` command to handle installation
in one shot, now this is split into two phases:
- buildPhase: python setup.py build
- installPhase: python setup.py install
Each of those commands have the ability to pass extra
parameters through buildPythonPackage parameters as
`setupPyInstallFlags` and `setupPyBuildFlags`.
Phases now correctly execute post/pre hooks.
In configurePhase we inject setuptools dependency before distutils
is imported to apply monkeypatching by setuptools that is needed
for special features to apply.
We don't have to reorder default phases anymore, as test
phase comes after build and that works.
I rewrote offineDistutils into distutils-cfg with a bit cleaner
syntax and ability to specify extraCfg to the config file.
Plone packages are failing and garbas said he will adopt them to
the new functions. The rest of the packages I fixed and these commits
shouldn't break any package (according to my testings) and they introduce
16 new jobs and fix 38 that were broken before.
This reverts commit edd160452e.
If we propagate it, derivations that use a python package will also
get the recursivePthLoader needed to process the pth files of the
package.
if they are really needed they will be in pth file created by
easy_install. If that does not work, they need to be put into
propagatedBuildInputs or the setup.py fixed.
see #210
setuptools site.py can't resolve recursively which is needed for nix,
as each package has its own directory. A different solution than
putting the loader into every package output needs to be found.
see also #209