Skip to content

Feature names are allowed to contain a . but causes a parser error after being added. #3171

@ywilke

Description

@ywilke

Checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pixi, using pixi --version.

Reproducible example

pixi init --format pyproject
pixi add -f test.test rich

Output:

✔ Added rich
Added these only for feature: test.test
Error: 
  × Unexpected keys, expected only 'platforms', 'channels', 'channel-priority', 'target', 'dependencies', 'host-dependencies', 'build-dependencies', 'pypi-dependencies', 'activation', 'tasks',
  │ 'pypi-options', 'system-requirements'
    ╭─[pyproject.toml:37:25]
 36 │ 
 37 │ [tool.pixi.feature.test.test.dependencies]
    ·                         ──┬─
    ·                           ╰── 'test' was not expected here
 38 │ rich = "*"
    ╰────
  help: Did you mean 'tasks'?

Issue description

It allows you to use a . in feature names but this results in a parser error after the feature is added.

Expected behavior

The add command should check for illegal characters and return an error or escape it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions