Files
nixpkgs/pkgs/development/interpreters/python/tests/test_nix_pythonprefix/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
591 B
Nix
Raw Normal View History

2025-10-09 14:15:47 +02:00
{
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
''