Skip to content

Invalid group names in poetry install --only are silently ignored #7303

@johnthagen

Description

@johnthagen
  • Poetry version: 1.3.1
  • Python version: 3.10.8
  • OS version and name: macOS 12.6
  • pyproject.toml:
[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = "^3.10, <3.11"
typer = "*"

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
  • I am on the latest stable Poetry version, installed using a recommended method.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • I have consulted the FAQ and blog for any relevant entries or release notes.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

Running the following command for the simple project above does not generate an error:

$ poetry install --only batman

The real world case for this was in a real production application Dockerfile we misspelled a group name by a single character, and it was not obvious why some of the dependencies were not being installed and took several hours to debug.

I would recommend that poetry install --without, --with, --only should all validate that the group names passed them actually exist and error if not, printing an error that shows which group name was not valid.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cliRelated to the command linearea/pyprojectMetadata/pyproject.toml-relatedkind/featureFeature requests/implementationsstatus/triageThis issue needs to be triaged

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions