-
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
Add --only-root
option to install command, excluding all dependencies.
#5783
Add --only-root
option to install command, excluding all dependencies.
#5783
Conversation
Out of curiosity: What happens if I run |
Haha, good question :) I tried it out, looks like it's effectively a noop minus creating the lockfile if it isn't present. |
I'd like to see a meaningful message for the user when this case happens, e.g. poetry/src/poetry/console/commands/install.py Lines 77 to 83 in 6d01f07
|
Is this something that should apply to all group enabled commands? For example, this won't make much sense for update or export. |
Good point, I've gone ahead and added logic to catch this similar to that case, and set it up to exit when both options are present. Should I also have this exit when both
True, I've gone ahead and migrated it into |
I personally prefer an error as well, because an inattentive developer may munge a command line out of history. If they don't notice a warning message they may never understand the unexpected/inconsistent results they get until much later. I'd rather fail first as what the user is asking us to do is nonsensical and we should ask them to re-evaluate their request. (this is all hypothetical of course, I would never make a silly mistake like re-using a command from history and combining options in a nonsensical manner 😄) |
Yeah, that's definitely true. Plus I imagine swapping warnings to errors in the future is a whole lot harder than the other way around... might need to keep that in mind for some of my own tools lol |
--only-root
option to group commands, excluding all dependencies.--only-root
option to install command, excluding all dependencies.
'--no-root --root-only'.
be775f6
to
3568484
Compare
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Per the related issue, added the
--only-root
option to theInstallCommand
(as hinted in the issue) to exclude all dependency groups from install.This is already expected behavior on the part of the installer so no additional tests are needed to ensure this works with an empty list of dependency groups.
Pull Request Check List
Resolves: #3377