Skip to content

Extra features with underscores in their names are not found when installing the test environment #2166

@jeberger

Description

@jeberger

Given the following in my pyproject.toml:

[project.optional-dependencies]
foo_bar = [ "foo" ]

[tool.hatch.envs.hatch-test]
features = [
    "foo_bar",
]

Running hatch test causes the following error:

ValueError: Feature `foo-bar` of field `tool.hatch.envs.hatch-test.py3.11.features` is not defined in the dynamic field `project.optional-dependencies`

Replacing the underscores with hyphens (i.e. renaming foo_bar to foo-bar) works around the issue.

This used to work until v1.15.1, and fails since v1.16.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions