Skip to content

fix: better messaging when adding dependencies to unused features#6623

Merged
Hofer-Julian merged 1 commit into
prefix-dev:mainfrom
Hofer-Julian:fix/error-message-unused-feature
Jul 17, 2026
Merged

fix: better messaging when adding dependencies to unused features#6623
Hofer-Julian merged 1 commit into
prefix-dev:mainfrom
Hofer-Julian:fix/error-message-unused-feature

Conversation

@Hofer-Julian

Copy link
Copy Markdown
Contributor

Description

A feature that is not part of any environment is never solved, so pixi add has no version to pin to and leaves the dependency at *. That is expected, but the surrounding UX was confusing:

  • pixi add --feature test pytest now explains that the dependency was not resolved or pinned, suggests pixi workspace environment add followed by pixi upgrade to pin it afterward.
  • pixi workspace environment add no longer warns about an unused feature that it is adding to an environment at that very moment.

Fixes #6620

How Has This Been Tested?

Added tests and tried it locally

AI Disclosure

  • This PR contains AI-generated content.
    • I have tested any AI-generated content in my PR.
    • I take responsibility for any AI-generated content in my PR.

Tools: Claude

Checklist:

  • I have performed a self-review of my own code
  • I have added sufficient tests to cover my changes.

@Hofer-Julian
Hofer-Julian requested a review from baszalmstra July 17, 2026 13:06
@Hofer-Julian
Hofer-Julian enabled auto-merge (squash) July 17, 2026 13:10
A feature that is not part of any environment is never solved, so `pixi add` has no version to pin to and leaves the dependency at `*`. That is expected, but the UX around it was confusing:

- `pixi add --feature test pytest` now explains that the dependency was not resolved or pinned, suggests `pixi workspace environment add` followed by `pixi upgrade` to pin it afterwards.
- `pixi workspace environment add` no longer warns about an unused feature that it is adding to an environment at that very moment.

Fixes prefix-dev#6620
@Hofer-Julian
Hofer-Julian force-pushed the fix/error-message-unused-feature branch from 42c3b23 to cfd275c Compare July 17, 2026 13:14
@Hofer-Julian
Hofer-Julian merged commit e1b69cb into prefix-dev:main Jul 17, 2026
35 checks passed
@Hofer-Julian
Hofer-Julian deleted the fix/error-message-unused-feature branch July 17, 2026 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent behaviour of adding dependencies / pinning/ creating envs

2 participants