Files
nixpkgs/pkgs/development/python-modules/llm/mk-plugin-test.nix
Philip Taron 794f8c04b0 python3Packages.llm: introduce mkPluginTest and use it
Since there's no fixpoint function support for `buildPythonPackage` yet,
each of the llm modules imports itself for its tests. Works!
2025-05-31 20:22:54 -07:00

28 lines
444 B
Nix

{
cacert,
runCommand,
writableTmpDirAsHomeHook,
yq,
llm,
plugin,
}:
let
venv = llm.pythonModule.withPackages (_: [
llm
plugin
]);
in
runCommand "${plugin.pname}-test"
{
nativeBuildInputs = [
venv
writableTmpDirAsHomeHook
yq
];
env.SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt";
}
''
llm plugins | yq --exit-status 'any(.name == "${plugin.pname}")'
touch "$out"
''