depot/pkgs/development/interpreters/python/tests/test_nix_pythonprefix/default.nix
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00: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
''