mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
datasette install -e option, closes #2106
This commit is contained in:
parent
3a51ca9014
commit
278ac91a4d
2 changed files with 14 additions and 5 deletions
|
|
@ -351,13 +351,21 @@ def package(
|
|||
type=click.Path(exists=True),
|
||||
help="Install from requirements file",
|
||||
)
|
||||
def install(packages, upgrade, requirement):
|
||||
@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, requirement, editable):
|
||||
"""Install plugins and packages from PyPI into the same environment as Datasette"""
|
||||
if not packages and not requirement:
|
||||
if not packages and not requirement and not editable:
|
||||
raise click.UsageError("Please specify at least one package to install")
|
||||
args = ["pip", "install"]
|
||||
if upgrade:
|
||||
args += ["--upgrade"]
|
||||
if editable:
|
||||
args += ["--editable", str(editable)]
|
||||
if requirement:
|
||||
args += ["-r", requirement]
|
||||
args += list(packages)
|
||||
|
|
|
|||
|
|
@ -350,9 +350,10 @@ Would install the `datasette-cluster-map <https://datasette.io/plugins/datasette
|
|||
Install plugins and packages from PyPI into the same environment as Datasette
|
||||
|
||||
Options:
|
||||
-U, --upgrade Upgrade packages to latest version
|
||||
-r, --requirement PATH Install from requirements file
|
||||
--help Show this message and exit.
|
||||
-U, --upgrade Upgrade packages to latest version
|
||||
-r, --requirement PATH Install from requirements file
|
||||
-e, --editable DIRECTORY Install a project in editable mode from this path
|
||||
--help Show this message and exit.
|
||||
|
||||
|
||||
.. [[[end]]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue