feat(console/commands): add --all-groups
Pull Request Check List
Resolves: N/A
- [x] Added tests for changed code.
- [x] 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.
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.
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?
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 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 :)
Deploy preview for website ready!
✅ Preview https://website-4yb9ib9c4-python-poetry.vercel.app
Built with commit 9dca875b0778a5996e78d78949aa3d96db5adf5b. This pull request is being automatically deployed with vercel-action
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.
is this issue dead? has it been succeeded by anything? i could also use this functionality.
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?
that's workable for me. what wound be the stain getting this implemented?
I also have a use-case for it, sad that this is not implemented.
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.
Same for me, any chance to reopen this?
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.
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.