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(console/commands): add --all-groups #5461

Closed
wants to merge 1 commit into from

Conversation

lovesegfault
Copy link
Contributor

Pull Request Check List

Resolves: N/A

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

This adds a utility flag --all-groups to install which enables all available
dependency groups.

It's handy if you have lots of groups which you almost always want.

@lovesegfault
Copy link
Contributor Author

One alternative to this would be to treat all a special value to --with, so you could say --with=all and it would understand that.

I felt like a separate CLI flag was less magic though.

@lovesegfault
Copy link
Contributor Author

lovesegfault commented Apr 16, 2022

Hm, I guess one cool thing about allowing --with=all is you could do things like:

poetry install --with=all --without='foo,bar'

Which reads less awkwardly than

poetry install --all-groups --without='foo,bar'

Another idea: perhaps --all-groups should just force optional=false for everything, and then it also can compose cleanly with --without.

@abn Thoughts?

@abn
Copy link
Member

abn commented Apr 17, 2022

I would like to understand how common this use case is.

Another change I was thinking was to allow for a group to extend from another. If we had something like that I wonder if this is still something that makes sense.

[tool.poetry.group.foo.dependencies]
pytest = "*" 

[tool.poetry.group.bar]
extends = ["foo"]

[tool.poetry.group.bar.dependencies]
aiohttp = "*"

@lovesegfault
Copy link
Contributor Author

I would like to understand how common this use case is.

Another change I was thinking was to allow for a group to extend from another. If we had something like that I wonder if this is still something that makes sense.

[tool.poetry.group.foo.dependencies]
pytest = "*" 

[tool.poetry.group.bar]
extends = ["foo"]

[tool.poetry.group.bar.dependencies]
aiohttp = "*"

I like that a lot, I'm going to give it a shot :)

@Secrus Secrus added the area/docs Documentation issues/improvements label May 19, 2022
@github-actions
Copy link

Deploy preview for website ready!

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

Built with commit 9dca875.
This pull request is being automatically deployed with vercel-action

@courtland
Copy link

I'm guessing this is now stale, but FWIW I would like this functionality as well. I have 4-5 groups, and in some cases I always want to install all of them. This would be easier than having to update CI scripts or what not if a group is ever added.

@lovesegfault lovesegfault deleted the all-groups branch April 3, 2023 15:21
@jgangemi
Copy link

is this issue dead? has it been succeeded by anything? i could also use this functionality.

@tomzx
Copy link
Contributor

tomzx commented Aug 16, 2023

I think it's fair to be able to install all groups without having to specify them all. How about extending --with to support --with="*" which will match all groups?

@jgangemi
Copy link

that's workable for me. what wound be the stain getting this implemented?

@sobolevn
Copy link
Contributor

I also have a use-case for it, sad that this is not implemented.

@randolf-scholz
Copy link

A trivial use case: To keep an overview over development dependencies, I like to organize them by groups. (linters, formatters, typing, testing, documentation, etc.) Otherwise, it just becomes an unwieldy long list.

@MischaPanch
Copy link

Same for me, any chance to reopen this?

@vancromy
Copy link

Just to add on here that a classic use case (at least within our org) is to ensure that versions are up to date for all groups. This is done both in a CI/CD pipeline to ensure our lock files are updated with poetry update --no-interaction --lock --with=all_groups and also done during development. It's a hassle having to hardcode groups in our CI/CD config files and remembering to keep these up to date. It would be really nice having a handy shortcut for installing/updating all dependency groups.

Copy link

github-actions bot commented Mar 3, 2024

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 Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Documentation issues/improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants