Skip to content

fix: resolve dependency matching bug in add command #3572

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aryan0931
Copy link

fixes: #3026

Enhances the error message in pixi add when no package candidates are found for a specified dependency (e.g., pixi add bla). Instead of a generic "No candidates were found" error, it now suggests up to 3 similar package names using the strsim::jaro similarity algorithm (threshold 0.6), reused from pixi/crates/pixi_manifest/src/error.rs (lines 286–304), and adds a tip: "Tip: Run pixi search to explore available packages." The solution modifies pixi/src/cli/add.rs to fetch repodata, compute suggestions, and print the improved message, while adding a CLI test in pixi/tests/cli/add.rs to verify the output. Dependencies (strsim, itertools) are ensured in pixi/Cargo.toml. Changes are kept minimal per mentor guidance, avoiding version inclusion (e.g., blaz (1.2.3)) and new modules.

Signed-off-by: Aryan Yadav <141573833+aryan0931@users.noreply.github.com>
@baszalmstra
Copy link
Contributor

This doesnt seem ready yet, it seems to target an much older version of pixi. Im marking this as a draft for the time being. When ready feel free to undraft an request a review.

@baszalmstra baszalmstra marked this pull request as draft April 11, 2025 12:48
@aryan0931
Copy link
Author

This doesnt seem ready yet, it seems to target an much older version of pixi. Im marking this as a draft for the time being. When ready feel free to undraft an request a review.

I am working on it will raise a new pr with updated changes.

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.

Print a help when a package was not found
2 participants