Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add pytorch example for explicit source #9006

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ poetry will choose a suitable one based on the available package versions.
poetry add requests pendulum
```

{{% note %}}
A package is looked up, by default, only from the [Default Package Source]({{< relref "repositories/#default-package-source" >}}).
You can modify the default source (PyPI); or add and use [Supplemental Package Sources]({{< relref "repositories/#supplemental-package-sources" >}})
or [Explicit Package Sources]({{< relref "repositories/#explicit-package-sources" >}}).

For more information, refer to the [Package Sources]({{< relref "repositories/#package-sources" >}}) documentation.
{{% /note %}}

You can also specify a constraint when adding a package:

```bash
Expand Down
9 changes: 9 additions & 0 deletions docs/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ poetry source add --priority=explicit foo https://foo.bar/simple/

There can be more than one explicit package source.

{{% note %}}
A real-world example where an explicit package source is useful, is for PyTorch GPU packages.

```bash
poetry source add --priority=explicit pytorch-gpu-src https://download.pytorch.org/whl/cu118
poetry add --source pytorch-gpu-src torch torchvision torchaudio
```
{{% /note %}}

#### Package Source Constraint

All package sources (including secondary and possibly supplemental sources) will be searched during the package lookup
Expand Down
Loading