Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
2 tasks done
ywilke opened this issue Feb 19, 2025 · 2 comments · May be fixed by #3594
Open
2 tasks done

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

ywilke opened this issue Feb 19, 2025 · 2 comments · May be fixed by #3594
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ywilke
Copy link
Contributor

ywilke commented Feb 19, 2025

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.

@nichmor nichmor added good first issue Good for newcomers bug Something isn't working labels Feb 20, 2025
@Hofer-Julian
Copy link
Contributor

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

Yeah, I think it should escape it.

So pixi add -f test.test rich should result in the table [tool.pixi.feature."test.test".dependencies]

@baszalmstra baszalmstra added the pixi label Mar 27, 2025 — with Linear
@baszalmstra baszalmstra removed the pixi label Apr 1, 2025
@mrswastik-robot
Copy link
Contributor

I can look into this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants