Commit c94c34c8 by Joey Wilhelm Committed by GitHub

Document expanded table syntax for dependencies (#2392)

parent 9734ca39
...@@ -179,6 +179,34 @@ foo = [ ...@@ -179,6 +179,34 @@ foo = [
] ]
``` ```
## Expanded dependency specification syntax
In the case of more complex dependency specifications, you may find that you
end up with lines which are very long and difficult to read. In these cases,
you can shift from using "inline table" syntax, to the "standard table" syntax.
An example where this might be useful is the following:
```toml
[tool.poetry.dev-dependencies]
black = {version = "19.10b0", allow-prereleases = true, python = "^3.6", markers = "platform_python_implementation == 'CPython'}
```
As a single line, this is a lot to digest. To make this a little bit easier to
work with, you can do the following:
```toml
[tool.poetry.dev-dependencies.black]
version = "19.10b0"
allow-prereleases = true
python = "^3.6"
markers = "platform_python_implementation == 'CPython'"
```
All of the same information is still present, and ends up providing the exact
same specification. It's simply split into multiple, slightly more readable,
lines.
!!!note !!!note
The constraints **must** have different requirements (like `python`) The constraints **must** have different requirements (like `python`)
......
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