Skip to content

Commit

Permalink
Doc: Update "extras" section in pyproject.toml file
Browse files Browse the repository at this point in the history
Resolves: #1076
  • Loading branch information
akhileshraju authored Mar 6, 2021
1 parent 6eaa298 commit adc3cde
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion docs/docs/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,15 +243,32 @@ mysqlclient = { version = "^1.3", optional = true }
[tool.poetry.extras]
mysql = ["mysqlclient"]
pgsql = ["psycopg2"]
databases = ["mysqlclient", "psycopg2"]
```

When installing packages, you can specify extras by using the `-E|--extras` option:
When installing packages with Poetry, you can specify extras by using the `-E|--extras` option:

```bash
poetry install --extras "mysql pgsql"
poetry install -E mysql -E pgsql
```

When installing or specifying Poetry-built packages, the extras defined in this section can be activated
as described in [PEP 508](https://www.python.org/dev/peps/pep-0508/#extras).

For example, when installing the package using `pip`, the dependencies required by
the `databases` extra can be installed as shown below.

```bash
pip install awesome[databases]
```

!!!note

The dependencies specified for each `extra` must already be defined as project dependencies.
Dependencies listed in the `dev-dependencies` section cannot be specified as extras.


## `plugins`

Poetry supports arbitrary plugins which work similarly to
Expand Down

0 comments on commit adc3cde

Please sign in to comment.