poetry icon indicating copy to clipboard operation
poetry copied to clipboard

feat(console/commands): add --all-groups

Open lovesegfault opened this issue 3 years ago • 5 comments

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.

lovesegfault avatar Apr 16 '22 20:04 lovesegfault

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 avatar Apr 16 '22 20:04 lovesegfault

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?

lovesegfault avatar Apr 16 '22 20:04 lovesegfault

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 = "*"

abn avatar Apr 17 '22 08:04 abn

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 :)

lovesegfault avatar Apr 18 '22 06:04 lovesegfault

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

github-actions[bot] avatar May 19 '22 13:05 github-actions[bot]

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.

courtland avatar Mar 01 '23 22:03 courtland

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

jgangemi avatar Jul 27 '23 18:07 jgangemi

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?

tomzx avatar Aug 16 '23 20:08 tomzx

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

jgangemi avatar Aug 20 '23 14:08 jgangemi

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

sobolevn avatar Sep 16 '23 08:09 sobolevn

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.

randolf-scholz avatar Sep 21 '23 13:09 randolf-scholz

Same for me, any chance to reopen this?

MischaPanch avatar Dec 01 '23 17:12 MischaPanch

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.

vancromy avatar Jan 11 '24 16:01 vancromy

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[bot] avatar Mar 03 '24 18:03 github-actions[bot]