python-poetry / python-poetry/poetry

Suggestion: Add a command/option to the CLI to list groups

Open
#8,164 7 comments 22 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/feature status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have searched the FAQ and general documentation and believe that my question is not already covered.

Feature Request

It would be nice to be able to view all possible groups through the CLI through a command such as poetry list --groups as opposed to having to open the pyproject.toml file.

In addition to the above, if groups supported an additional property description it would make the output of the above recommended command easier for users to interpret by showing the purpose for the group.

An alternative and simpler solution could be to include what group dependencies are in when running poetry show --with dev. For example, the output could be:

coverage       7.2.7     dev      Code coverage measurement for Python
Example

In the pyproject.toml file I could have:

[tool.poetry.group.dev]
description = "Optional dev dependencies used for testing and linting code"
optional = true

[tool.poetry.group.dev.dependencies]
coverage = "7.2.7"
pytest = "7.4.0"
ruff = "0.0.272"

Using the CLI, I could run:

> poetry list --groups

Groups:

dev: Optional dev dependencies used for testing and linting code
    coverage = "7.2.7"
    pytest = "7.4.0"
    ruff = "0.0.272"

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the group definitions in pyproject.toml and the existing poetry list and poetry show CLI behavior. Compare the proposed --groups listing with the alternative poetry show --with dev output, then clarify which approach and description format should be implemented. Done means users can see group membership and purpose from the CLI without opening pyproject.toml.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.