nixos/testing: Support mypy through regular mechanisms
Rebase / forward port of 2c8bbf33fd
This commit is contained in:
@@ -52,6 +52,7 @@ let
|
|||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
hostPkgs.makeWrapper
|
hostPkgs.makeWrapper
|
||||||
] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ];
|
] ++ lib.optionals (!config.skipTypeCheck) [ hostPkgs.mypy ];
|
||||||
|
buildInputs = [ testDriver ];
|
||||||
testScript = config.testScriptString;
|
testScript = config.testScriptString;
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
passthru = config.passthru;
|
passthru = config.passthru;
|
||||||
@@ -73,13 +74,10 @@ let
|
|||||||
|
|
||||||
cat -n testScriptWithTypes
|
cat -n testScriptWithTypes
|
||||||
|
|
||||||
# set pythonpath so mypy knows where to find the imports. this requires the py.typed file.
|
|
||||||
export PYTHONPATH='${../test-driver}'
|
|
||||||
mypy --no-implicit-optional \
|
mypy --no-implicit-optional \
|
||||||
--pretty \
|
--pretty \
|
||||||
--no-color-output \
|
--no-color-output \
|
||||||
testScriptWithTypes
|
testScriptWithTypes
|
||||||
unset PYTHONPATH
|
|
||||||
''}
|
''}
|
||||||
|
|
||||||
echo -n "$testScript" >> $out/test-script
|
echo -n "$testScript" >> $out/test-script
|
||||||
|
|||||||
Reference in New Issue
Block a user