Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / llm / 001-disable-install-uninstall-commands.patch
blobcef7fba13343e4cf2ed4818efe0f237a1efd6d16
1 diff --git a/llm/cli.py b/llm/cli.py
2 index af37feb..18b078a 100644
3 --- a/llm/cli.py
4 +++ b/llm/cli.py
5 @@ -1014,18 +1014,7 @@ def templates_path():
7 def install(packages, upgrade, editable, force_reinstall, no_cache_dir):
8 """Install packages from PyPI into the same environment as LLM"""
9 - args = ["pip", "install"]
10 - if upgrade:
11 - args += ["--upgrade"]
12 - if editable:
13 - args += ["--editable", editable]
14 - if force_reinstall:
15 - args += ["--force-reinstall"]
16 - if no_cache_dir:
17 - args += ["--no-cache-dir"]
18 - args += list(packages)
19 - sys.argv = args
20 - run_module("pip", run_name="__main__")
21 + click.echo("Install command has been disabled for Nix. If you want to install extra llm plugins, use llm.withPlugins([]) expression.")
24 @cli.command()
25 @@ -1033,8 +1022,7 @@ def install(packages, upgrade, editable, force_reinstall, no_cache_dir):
26 @click.option("-y", "--yes", is_flag=True, help="Don't ask for confirmation")
27 def uninstall(packages, yes):
28 """Uninstall Python packages from the LLM environment"""
29 - sys.argv = ["pip", "uninstall"] + list(packages) + (["-y"] if yes else [])
30 - run_module("pip", run_name="__main__")
31 + click.echo("Uninstall command has been disabled for Nix. If you want to uninstall extra llm plugins, just remove them from llm.withPlugins([]) list expression.")
34 @cli.command()