datasette install -r requirements.txt, closes #2033

This commit is contained in:
Simon Willison 2023-03-06 14:27:30 -08:00
commit 1ad92a1d87
4 changed files with 44 additions and 6 deletions

View file

@ -345,13 +345,14 @@ Would install the `datasette-cluster-map <https://datasette.io/plugins/datasette
::
Usage: datasette install [OPTIONS] PACKAGES...
Usage: datasette install [OPTIONS] [PACKAGES]...
Install plugins and packages from PyPI into the same environment as Datasette
Options:
-U, --upgrade Upgrade packages to latest version
--help Show this message and exit.
-U, --upgrade Upgrade packages to latest version
-r, --requirement PATH Install from requirements file
--help Show this message and exit.
.. [[[end]]]

View file

@ -51,7 +51,16 @@ This command can also be used to upgrade Datasette itself to the latest released
datasette install -U datasette
These commands are thin wrappers around ``pip install`` and ``pip uninstall``, which ensure they run ``pip`` in the same virtual environment as Datasette itself.
You can install multiple plugins at once by listing them as lines in a ``requirements.txt`` file like this::
datasette-vega
datasette-cluster-map
Then pass that file to ``datasette install -r``::
datasette install -r requirements.txt
The ``install`` and ``uninstall`` commands are thin wrappers around ``pip install`` and ``pip uninstall``, which ensure that they run ``pip`` in the same virtual environment as Datasette itself.
One-off plugins using --plugins-dir
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~