Skip to content

Commit

Permalink
doc: add pytorch example for explicit source
Browse files Browse the repository at this point in the history
  • Loading branch information
hyliu1989 authored and abn committed Feb 24, 2024
1 parent 0ab6204 commit 601ebb1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions docs/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,18 @@ 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
# Use `source add` command to define an explicit 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
```
{{% /note %}}

#### Package Source Constraint

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

0 comments on commit 601ebb1

Please sign in to comment.