writers: add deps & flake8 to writePython{2,3}
This commit is contained in:
parent
bfde8bea27
commit
c25054b4a0
@ -283,26 +283,26 @@ with import <stockholm/lib>;
|
|||||||
${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out
|
${pkgs.cabal2nix}/bin/cabal2nix ${path} > $out
|
||||||
'');
|
'');
|
||||||
|
|
||||||
writePython2 = name: text:
|
writePython2 = deps:
|
||||||
assert (with types; either absolute-pathname filename).check name;
|
let
|
||||||
pkgs.writeOut (baseNameOf name) {
|
py = pkgs.python2.withPackages(ps: attrVals deps ps);
|
||||||
${optionalString (types.absolute-pathname.check name) name} = {
|
in
|
||||||
|
pkgs.makeScriptWriter {
|
||||||
|
interpreter = "${py}/bin/python";
|
||||||
check = pkgs.writeDash "python2check.sh" ''
|
check = pkgs.writeDash "python2check.sh" ''
|
||||||
exec ${pkgs.python2}/bin/python -m py_compile "$1"
|
exec ${pkgs.python2Packages.flake8}/bin/flake8 --show-source "$1"
|
||||||
'';
|
'';
|
||||||
inherit text;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
writePython3 = name: text:
|
writePython3 = deps:
|
||||||
assert (with types; either absolute-pathname filename).check name;
|
let
|
||||||
pkgs.writeOut (baseNameOf name) {
|
py = pkgs.python3.withPackages(ps: attrVals deps ps);
|
||||||
${optionalString (types.absolute-pathname.check name) name} = {
|
in
|
||||||
|
pkgs.makeScriptWriter {
|
||||||
|
interpreter = "${py}/bin/python";
|
||||||
check = pkgs.writeDash "python3check.sh" ''
|
check = pkgs.writeDash "python3check.sh" ''
|
||||||
exec ${pkgs.python3}/bin/python -m py_compile "$textPath"
|
exec ${pkgs.python3Packages.flake8}/bin/flake8 --show-source "$1"
|
||||||
'';
|
'';
|
||||||
inherit text;
|
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
writeSed = pkgs.makeScriptWriter {
|
writeSed = pkgs.makeScriptWriter {
|
||||||
|
Loading…
Reference in New Issue
Block a user