Skip to content

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

Description

@jakecyr
  • 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"

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions