Skip to content
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

feat(install): add --all-groups flag to install all dependency groups #9744

Merged
merged 7 commits into from
Oct 15, 2024

Conversation

schneebuzz
Copy link
Contributor

@schneebuzz schneebuzz commented Oct 9, 2024

This PR adds the --all-groups flag to poetry install which includes all the dependency groups (including optional groups) for installation. This is a very common use case for projects with multiple optional groups and allows the user to install everything without specifying each group.

This feature has been discussed in the past. See e.g. #7605 and #5461. I gave it another shot with an implementation that respects the existing options and flags.

I decided not to go with --with=all or similar and instead use the explicit flag --all-groups, consistent with the --all-extras flag. A naming alternative would be --with-all.

Options like

  • --all-groups --without=docs are supported,
  • --all-groups --with=foo ignores the with with a warning,
  • and --all-groups --only=foo results in an error.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

@schneebuzz
Copy link
Contributor Author

Please review, feedback welcome.

Secrus
Secrus previously approved these changes Oct 10, 2024
Copy link
Member

@Secrus Secrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @radoering, care to take a look?

@radoering
Copy link
Member

I will take a look tomorrow.

Copy link
Member

@radoering radoering left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. There is just one thing: python-poetry/poetry-plugin-export#294 introduces --all-groups to poetry export (not yet released). It is the same name; that is good. However, in poetry export --all-groups conflicts with --with and --without. I have no clear preference, but we should make it consistent.

@schneebuzz
Copy link
Contributor Author

LGTM. There is just one thing: python-poetry/poetry-plugin-export#294 introduces --all-groups to poetry export (not yet released). It is the same name; that is good. However, in poetry export --all-groups conflicts with --with and --without. I have no clear preference, but we should make it consistent.

Thanks for reviewing.
Even though the all but without could be handy, I aligned with the referenced PR since it leaves less room for confusion.

@schneebuzz schneebuzz requested a review from radoering October 13, 2024 12:16
@radoering radoering added the impact/docs Contains or requires documentation changes label Oct 15, 2024
Copy link

github-actions bot commented Oct 15, 2024

Deploy preview for website ready!

✅ Preview
https://website-pwb22s84b-python-poetry.vercel.app

Built with commit 0b0c838.
This pull request is being automatically deployed with vercel-action

docs/cli.md Outdated Show resolved Hide resolved
@schneebuzz schneebuzz requested a review from radoering October 15, 2024 06:14
@radoering radoering merged commit dcd5ae1 into python-poetry:main Oct 15, 2024
88 checks passed
Secrus pushed a commit to Secrus/poetry that referenced this pull request Oct 27, 2024
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
impact/docs Contains or requires documentation changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants