diff options
author | Domen Kožar <domen@dev.si> | 2015-11-26 17:31:10 +0100 |
---|---|---|
committer | Domen Kožar <domen@dev.si> | 2015-11-26 17:31:10 +0100 |
commit | 0c772699ba3c58fc10bc97f4cd7d93385757d5ce (patch) | |
tree | c59c86de65a73d134d35822246527777a3167e19 /pkgs/development/python-modules/generic | |
parent | cf5984e4bf3a6b75d43077f7cbcd4bd7fa4ba08c (diff) |
buildPythonPackage: write some comments
Diffstat (limited to 'pkgs/development/python-modules/generic')
-rw-r--r-- | pkgs/development/python-modules/generic/default.nix | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/pkgs/development/python-modules/generic/default.nix b/pkgs/development/python-modules/generic/default.nix index 67f03d36fa872..fe62428c0b083 100644 --- a/pkgs/development/python-modules/generic/default.nix +++ b/pkgs/development/python-modules/generic/default.nix @@ -13,10 +13,10 @@ , buildInputs ? [] # propagate build dependencies so in case we have A -> B -> C, -# C can import propagated packages by A +# C can import package A propagated by B , propagatedBuildInputs ? [] -# passed to "python setup.py build" +# passed to "python setup.py build_ext" # https://github.com/pypa/pip/issues/881 , setupPyBuildFlags ? [] @@ -50,10 +50,13 @@ then throw "${name} not supported for interpreter ${python.executable}" else let + # use setuptools shim (so that setuptools is imported before distutils) + # pip does the same thing: https://github.com/pypa/pip/pull/3265 setuppy = ./run_setup.py; + # For backwards compatibility, let's use an alias + doInstallCheck = doCheck; in -python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { - +python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled" "doCheck"] // { name = namePrefix + name; buildInputs = [ wrapPython bootstrapped-pip ] ++ buildInputs ++ pythonPath @@ -62,8 +65,6 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { # propagate python/setuptools to active setup-hook in nix-shell propagatedBuildInputs = propagatedBuildInputs ++ [ python setuptools ]; - pythonPath = pythonPath; - configurePhase = attrs.configurePhase or '' runHook preConfigure @@ -74,6 +75,8 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { runHook postConfigure ''; + # we copy nix_run_setup.py over so it's executed relative to the root of the source + # many project make that assumption buildPhase = attrs.buildPhase or '' runHook preBuild cp ${setuppy} nix_run_setup.py @@ -94,8 +97,10 @@ python.stdenv.mkDerivation (builtins.removeAttrs attrs ["disabled"] // { runHook postInstall ''; - doInstallCheck = doCheck; - doCheck = false; + # We run all tests after software has been installed since that is + # a common idiom in Python + doInstallCheck = doInstallCheck; + installCheckPhase = attrs.checkPhase or '' runHook preCheck ${python.interpreter} nix_run_setup.py test |