nixpkgs-suyu/pkgs/development/interpreters/python/tests/test_nix_pythonprefix/default.nix
Robert Hensing fbafeb7ad5 treewide: runCommandNoCC -> runCommand
This has been synonymous for ~5y.
2021-08-15 17:36:41 +02:00

25 lines
547 B
Nix

{ interpreter, writeText, runCommand }:
let
python = let
packageOverrides = self: super: {
typeddep = self.callPackage ./typeddep {};
};
in interpreter.override {inherit packageOverrides; self = python;};
pythonEnv = python.withPackages(ps: [
ps.typeddep
ps.mypy
]);
pythonScript = writeText "myscript.py" ''
from typeddep import util
s: str = util.echo("hello")
print(s)
'';
in runCommand "${interpreter.name}-site-prefix-mypy-test" {} ''
${pythonEnv}/bin/mypy ${pythonScript}
touch $out
''