mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-23 01:14:31 +02:00
sqlite-utils install -e, closes #570
This commit is contained in:
parent
f7af23837d
commit
ef31210bf0
1 changed files with 10 additions and 2 deletions
|
|
@ -2771,15 +2771,23 @@ def _analyze(db, tables, columns, save, common_limit=10, no_most=False, no_least
|
|||
|
||||
|
||||
@cli.command()
|
||||
@click.argument("packages", nargs=-1, required=True)
|
||||
@click.argument("packages", nargs=-1, required=False)
|
||||
@click.option(
|
||||
"-U", "--upgrade", is_flag=True, help="Upgrade packages to latest version"
|
||||
)
|
||||
def install(packages, upgrade):
|
||||
@click.option(
|
||||
"-e",
|
||||
"--editable",
|
||||
type=click.Path(readable=True, exists=True, dir_okay=True, file_okay=False),
|
||||
help="Install a project in editable mode from this path",
|
||||
)
|
||||
def install(packages, upgrade, editable):
|
||||
"""Install packages from PyPI into the same environment as sqlite-utils"""
|
||||
args = ["pip", "install"]
|
||||
if upgrade:
|
||||
args += ["--upgrade"]
|
||||
if editable:
|
||||
args += ["--editable", str(editable)]
|
||||
args += list(packages)
|
||||
sys.argv = args
|
||||
run_module("pip", run_name="__main__")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue