Commit ca499f69 authored by Doron Behar's avatar Doron Behar
Browse files

python.tests.tkinter: init

parent 9535d51d
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -114,6 +114,10 @@ let
      nix-pythonprefix-mypy = callPackage ./tests/test_nix_pythonprefix {
        interpreter = python;
      };
      # Make sure tkinter is importable. See https://github.com/NixOS/nixpkgs/issues/238990
      tkinter = callPackage ./tests/test_tkinter {
        interpreter = python;
      };
    }
  );

+17 −0
Original line number Diff line number Diff line
{ interpreter, writeText, runCommand }:

let

  pythonEnv = interpreter.withPackages(ps: [
    ps.tkinter
  ]);

  pythonScript = writeText "myscript.py" ''
    import tkinter
    print(tkinter)
  '';

in runCommand "${interpreter.name}-tkinter-test" {} ''
  ${pythonEnv}/bin/python ${pythonScript}
  touch $out
''