-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install removes dependencies of non-installed extras #6229
Comments
IMO poetry's behavior with extras should parallel what's happening with Also, IMO whether |
groups and extras are absolutely not interchangeable and you should not expect them to give identical results - them not being "consistent" here is not an issue. |
Ok, thanks for your reply. I submit that the distinction between when to use extras and when to use optional groups isn't clear in the documentation yet (especially to me, mostly a 1.1 user, who only had the option to use extras in that version). I think this important distinction re: whether dependencies get removed when the extra / optional group isn't selected is important to end users and should be clearly / prominently documented. |
I see that #6230 has just gone in hopefully helping to clarify the distinction, I expect further MRs improving the docs would be welcome. |
Thanks, that is a good start! Unfortunately, I'm asking for documentation largely because I'm still unclear on the motivations for making optional groups/extras behave differently when not selected for install. I don't think clarifying that reasoning is something I can contribute to. |
duplicate #5895 |
(cherry picked from commit 8546dd6)
(cherry picked from commit 8546dd6)
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. |
-vvv
option).Issue
I've been testing 1.2.0rc1 and it seems poetry is removing dependencies of non-installed extras. My understanding of #4336 and #4242 is that poetry should only ever remove packages during an install if they're superseded by the locked versions that need to be installed, or if the
--sync
option is used. A workaround is to rewrite the extras as optional groups, which seems to solve the problem. If nothing else, perhaps some documentation updates are needed to mark extras as deprecated?In my pyproject.toml,
setuptools
is a derived dependency ofgunicorn
(an optional package grouped under theweb
extra).Running
poetry install --no-root -vvv
removessetuptools
:I also tested re-writing the extras as groups instead, and did not get the same result. Making these changes fixed the problem:
The text was updated successfully, but these errors were encountered: