From 948f3a9b95a200525223b897beaa92c8b255a444 Mon Sep 17 00:00:00 2001 From: Hsiou-Yuan Liu Date: Thu, 27 Jul 2023 18:03:31 -0400 Subject: [PATCH] Add an documentation for adding other online source for a dependency. --- docs/cli.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/cli.md b/docs/cli.md index 5a5fd878f7e..6c2ddcd48e4 100644 --- a/docs/cli.md +++ b/docs/cli.md @@ -351,6 +351,18 @@ poetry add pendulum@latest See the [Dependency specification]({{< relref "dependency-specification" >}}) for more information on setting the version constraints for a package. {{% /note %}} +The `add` command uses PyPi as its default source of dependency package. You can also specify other sources for your packages, such as other online source, git, local, and local and editable. + +You can add an online source using [`source add`](#source-add) command. After the source has been added, you can then add a dependency with the newly added source: + +```bash +# Use `source add` command to define a source +poetry source add --priority=explicit pytorch-gpu-src https://download.pytorch.org/whl/cu118 + +# Add an online dependency with the newly added source. +poetry add --source pytorch-gpu-src torch torchvision torchaudio +``` + You can also add `git` dependencies: ```bash