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

Update repositories.md #5605

Merged
merged 6 commits into from
Sep 18, 2022
Merged
Changes from 1 commit
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
22 changes: 20 additions & 2 deletions docs/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ when publishing a package.

### Project Configuration

These package sources maybe managed using the [`source`]({{< relref "cli#source" >}}) command for
These package sources may be managed using the [`source`]({{< relref "cli#source" >}}) command for
your project.

```bash
Expand All @@ -112,9 +112,27 @@ default = false
secondary = false
```

When a package source is defined like this, it takes precedence over [PyPI](https://pypi.org).
jonapich marked this conversation as resolved.
Show resolved Hide resolved

To ignore [PyPI](https://pypi.org) completely, use `default = true`.

To target a package source only on specific packages, use `secondary = true` on the package source, and specify the `source` when adding the dependency.
In the example below, `my-lib` will be obtained from the custom package source and `urllib3` will use the [PyPI](https://pypi.org) source.

```toml
[tool.poetry.requirements]
my-lib = { version = "*", source = "foo" }
urllib3 = "*"

[[tool.poetry.source]]
name = "foo"
url = "https://foo.bar/simple/"
secondary = true
```
jonapich marked this conversation as resolved.
Show resolved Hide resolved

{{% warning %}}

If package sources are defined for a project, these will take precedence over
Reminder: If package sources are defined for a project, these will take precedence over
jonapich marked this conversation as resolved.
Show resolved Hide resolved
[PyPI](https://pypi.org). If you do not want this to be the case, you should declare **all** package
sources to be [secondary](#secondary-package-sources).

Expand Down