Merge pull request #247868 from doronbehar/pkg/python-tk-test
python.tests.tkinter: init
This commit is contained in:
commit
4ed77bebec
@ -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;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
{ 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
|
||||
''
|
Loading…
Reference in New Issue
Block a user