Closed swssl closed 5 months ago
As documented
The dependencies specified for each extra must already be defined as project dependencies. Dependencies listed in dependency groups cannot be specified as extras.
not only as documented, but as checked:
$ poetry check
Error: Cannot find dependency "mysql-connector-python" for extra "mysql" in main dependencies.
Error: Cannot find dependency "psycopg2" for extra "pgsql" in main dependencies.
please close
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Description
When adding an extra to the current project as stated in the docs, everything works. When adding the packages as optional to another dependency group, the lock file contains an empty array for that extra, so
poetry install -E myextra
runs without error but doesnt install the extra as defined in pyproject.toml. Possibly, locking the extra could either raise an error (which the docs should help to avoid) or support extras containing packages from other groupsWorkarounds
Moving package to main group.
Poetry Installation Method
pipx
Operating System
Ubuntu (WSL)
Poetry Version
1.8.2
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
Poetry Runtime Logs
On
poetry install --extras mysql --no-root
, both packages extras are skipped without error:Afterwards, the poetry.lock contains this: