aboutsummaryrefslogtreecommitdiffstats
path: root/pkgs/default.nix
diff options
context:
space:
mode:
authorIngolf Wagner <palo@pepe>2018-08-30 17:52:42 +0200
committerIngolf Wagner <palo@pepe>2018-09-02 18:17:12 +0200
commitbd003832d2925618a9d7a9c8ff29ff4ce74e0cd8 (patch)
treee5e10ebb24bc2b8ed06059949035e1cd3c7f5c37 /pkgs/default.nix
parent5d79992262e8f16a3efa985375be74abea3bb392 (diff)
fixed writePython{2,3}{,Bin}v2.0.0palo/fix-writePython
moved deps (and additional rarely used parameters in an attribute set) now you have to do instead of: ``` writePython2Bin "foo.py" [] '' ... '' ``` this: ``` writePython2Bin "foo.py" {} '' ... '' ```
Diffstat (limited to 'pkgs/default.nix')
-rw-r--r--pkgs/default.nix14
1 files changed, 8 insertions, 6 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix
index c01f88c..87fec50 100644
--- a/pkgs/default.nix
+++ b/pkgs/default.nix
@@ -299,28 +299,30 @@ pkgs: oldpkgs: {
${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out
'');
- writePython2 = name: deps:
+ writePython2 = name: { deps ? [], flakeIgnore ? [] }:
let
- py = pkgs.python2.withPackages(ps: attrVals deps ps);
+ py = pkgs.python2.withPackages (ps: deps);
+ ignoreAttribute = lib.optionalString (ignore != []) "--ignore ${lib.concatMapStringsSep "," lib.escapeShellArg flakeIgnore}";
in
pkgs.makeScriptWriter {
interpreter = "${py}/bin/python";
check = pkgs.writeDash "python2check.sh" ''
- exec ${pkgs.python2Packages.flake8}/bin/flake8 --show-source "$1"
+ exec ${pkgs.python2Packages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1"
'';
} name;
writePython2Bin = name:
pkgs.writePython2 "/bin/${name}";
- writePython3 = name: deps:
+ writePython3 = name: { deps ? [], flakeIgnore ? [] }:
let
- py = pkgs.python3.withPackages(ps: attrVals deps ps);
+ py = pkgs.python3.withPackages (ps: deps);
+ ignoreAttribute = lib.optionalString (ignore != []) "--ignore ${lib.concatMapStringsSep "," lib.escapeShellArg flakeIgnore}";
in
pkgs.makeScriptWriter {
interpreter = "${py}/bin/python";
check = pkgs.writeDash "python3check.sh" ''
- exec ${pkgs.python3Packages.flake8}/bin/flake8 --show-source "$1"
+ exec ${pkgs.python3Packages.flake8}/bin/flake8 --show-source ${ignoreAttribute} "$1"
'';
} name;