mirror of
https://github.com/Hopiu/llm.git
synced 2026-03-17 05:00:25 +00:00
--no-cache-dir and --force-reinstall options, closes #146
This commit is contained in:
parent
c5adc59252
commit
609e8dead8
2 changed files with 18 additions and 1 deletions
|
|
@ -292,6 +292,9 @@ Usage: llm install [OPTIONS] [PACKAGES]...
|
|||
Options:
|
||||
-U, --upgrade Upgrade packages to latest version
|
||||
-e, --editable TEXT Install a project in editable mode from this path
|
||||
--force-reinstall Reinstall all packages even if they are already up-to-
|
||||
date
|
||||
--no-cache-dir Disable the cache
|
||||
--help Show this message and exit.
|
||||
```
|
||||
### llm uninstall --help
|
||||
|
|
|
|||
16
llm/cli.py
16
llm/cli.py
|
|
@ -611,13 +611,27 @@ def templates_path():
|
|||
"--editable",
|
||||
help="Install a project in editable mode from this path",
|
||||
)
|
||||
def install(packages, upgrade, editable):
|
||||
@click.option(
|
||||
"--force-reinstall",
|
||||
is_flag=True,
|
||||
help="Reinstall all packages even if they are already up-to-date",
|
||||
)
|
||||
@click.option(
|
||||
"--no-cache-dir",
|
||||
is_flag=True,
|
||||
help="Disable the cache",
|
||||
)
|
||||
def install(packages, upgrade, editable, force_reinstall, no_cache_dir):
|
||||
"""Install packages from PyPI into the same environment as LLM"""
|
||||
args = ["pip", "install"]
|
||||
if upgrade:
|
||||
args += ["--upgrade"]
|
||||
if editable:
|
||||
args += ["--editable", editable]
|
||||
if force_reinstall:
|
||||
args += ["--force-reinstall"]
|
||||
if no_cache_dir:
|
||||
args += ["--no-cache-dir"]
|
||||
args += list(packages)
|
||||
sys.argv = args
|
||||
run_module("pip", run_name="__main__")
|
||||
|
|
|
|||
Loading…
Reference in a new issue