Skip to content

Commit

Permalink
docs: add "extras" example to scripts docs (#1181)
Browse files Browse the repository at this point in the history
After digging around in the poetry code to figure out
how to include an `extras` key in a CLI script,
I thought it might be a useful thing to add to the docs
for future users.
  • Loading branch information
bradsbrown authored Nov 15, 2021
1 parent a694aad commit 46a3aa8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,13 @@ poetry = 'poetry.console:run'

Here, we will have the `poetry` script installed which will execute `console.run` in the `poetry` package.

To specify a script that [depends on an extra](#extras), you may provide an entry as an inline table:

```toml
[tool.poetry.scripts]
devtest = { callable = "mypackage:test.run_tests", extras = ["test"] }
```

{{% note %}}
When a script is added or updated, run `poetry install` to make them available in the project's virtualenv.
{{% /note %}}
Expand Down

0 comments on commit 46a3aa8

Please sign in to comment.