poetry install --extras doesn't work
See original GitHub issue- I am on the latest Poetry version.
- I have searched the issues of this repo and believe that this is not a duplicate.
- If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: macOS 10.14.6
- Poetry version: 1.0.3
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/anentropic/661458664b20923cf07f7e377972870b
Issue
The docs show a pyproject.toml:
[tool.poetry]
name = "awesome"
[tool.poetry.dependencies]
# These packages are mandatory and form the core of this package’s distribution.
mandatory = "^1.0"
# A list of all of the optional dependencies, some of which are included in the
# below `extras`. They can be opted into by apps.
psycopg2 = { version = "^2.7", optional = true }
mysqlclient = { version = "^1.3", optional = true }
[tool.poetry.extras]
mysql = ["mysqlclient"]
pgsql = ["psycopg2"]
And then an example of installing the “extras”:
poetry install --extras "mysql pgsql"
But pasting the relevant part of this example into my own pyproject.toml (see gist) it doesn’t work:
$ poetry install --extras "mysql pgsql"
Installing dependencies from lock file
[ValueError]
Extra [mysql] is not specified.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:18 (9 by maintainers)
Top Results From Across the Web
poetry doesn't install extras · Issue #1145 - GitHub
I had the same issue, but it seems to work correctly if I specify the extra dependencies in the tool.poetry.dependencies section instead of...
Read more >Python poetry - how to install optional dependencies?
5. For anyone getting the Extra is not specified error, you have to run poetry update first. · 1. Is there a short...
Read more >Commands | master | Documentation | Poetry - Python ...
--all-extras : Install all extra features (conflicts with –extras). --no-dev : Do not install dev dependencies. (Deprecated, use --without dev or --only main ......
Read more >The pyproject.toml file | master | Documentation | Poetry
When a script is added or updated, run poetry install to make them available in the project's virtualenv. extras #. Poetry supports extras...
Read more >Announcing Poetry 1.2.0 | Blog
The Poetry team is pleased to announce the immediate availability of Poetry 1.2.0. Poetry 1.2 boasts a massive list of changes, new features ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looks like you can install multiple dependencies in a single set using the following approach:
resulting in the following changes to the pyproject.toml file:
But running
poetry update; poetry install -E API
doesn’t work yet.You need to add the following entry to the pyproject.toml file (NOTE you have to add the requirements specifier otherwise what gets passed to pip install complains and errors out):
and then
poetry update; poetry install -E API
works fine.My django-getpaid project has a
test
extra dependency group declared among others.poetry install
does not install pytestpoetry install -E test
does not install pytest either.