Commit 335f209c by Larry Huang Committed by Bjorn Neergaard

Update dependency-specification.md

Add description of `source` property.

Co-authored-by: Arun Babu Neelicattu <arun.neelicattu@gmail.com>
Co-authored-by: Gabriel Galli <ggabriel96@hotmail.com>
parent a358be7d
......@@ -152,6 +152,30 @@ with the corresponding `add` call:
poetry add https://example.com/my-package-0.1.0.tar.gz
```
## `source` dependencies
To depend on a package from an [alternate repository](/docs/repositories/#install-dependencies-from-a-private-repository),
you can use the `source` property:
```toml
[[tool.poetry.source]]
name = "foo"
url = "https://foo.bar/simple/"
secondary = true
[tool.poetry.dependencies]
my-cool-package = { version = "*", source = "foo" }
```
with the corresponding `add` call:
```sh
poetry add my-cool-package --source foo
```
!!!note
In this example, we expect `foo` to be configured correctly. See [using a private repository](repositories.md#using-a-private-repository) for further information.
## Python restricted dependencies
......@@ -178,7 +202,6 @@ via the `markers` property:
pathlib2 = { version = "^2.2", markers = "python_version ~= '2.7' or sys_platform == 'win32'" }
```
## Multiple constraints dependencies
Sometimes, one of your dependency may have different version ranges depending
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment