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.