pixi icon indicating copy to clipboard operation
pixi copied to clipboard

fix: resolve dependency matching bug in add command

Open aryan0931 opened this issue 10 months ago • 2 comments

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.

aryan0931 avatar Apr 11 '25 11:04 aryan0931

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 avatar Apr 11 '25 12:04 baszalmstra

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.

aryan0931 avatar Apr 15 '25 17:04 aryan0931

Closing this PR as stale

ruben-arts avatar Jun 26 '25 13:06 ruben-arts