Skip to content

Error when making dependency group optional #10558

@jaredahern

Description

@jaredahern

Description

In poetry 2.2.0, there is a problem when setting dependency groups to be optional.

Running poetry check on the example below fails with the error "The Poetry configuration is invalid: - tool.poetry.group.lint cannot be validated by any definition". This appears to be caused by this line in the JSON schema, which requries either dependencies or include-groups for everytool.poetry.group.

Workarounds

Uncommenting include-groups = [] in the example avoids the problem, but I'm not sure whether this would work if dependency-groups.lint had an include group.

Poetry Installation Method

install.python-poetry.org

Operating System

Win & Mac

Poetry Version

2.2.0

Example pyproject.toml

[project]
name = "project-name"
version = "0.0.0"

[dependency-groups]
lint = [
    "pylint",
]

[tool.poetry.group.lint]
optional = true
# include-groups = []

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/coreRelated to the poetry-core librarykind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions