Skip to content

feat: allow searching for specific package versions using matchspec #3565

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
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

simonjung1603
Copy link

solves #3173

I allowed specifying a MatchSpec for the exact search so that for example

  • pixi search "rattler-build<=0.35.4"
  • pixi search "rattler-build[build=h3ab7716_0]"

are valid search calls and yield the respective package versions.

I added the examples from the issue to the search_extender docs.
I added a test case in search_tests.rs for this feature.

Copy link
Contributor

@baszalmstra baszalmstra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! This looks great! I left one small comment!


if packages.is_empty() {
let normalized_package_name = package_name_search.as_normalized();
return Err(miette::miette!("Package {normalized_package_name} not found, please use a wildcard '*' in the search name for a broader result."));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does that actually work?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If yes, please add a test for it :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I moved this error message up unchanged from line 245 in order to differentiate between the package itself not being found and the match spec not matching. I did not implement providing a match spec for the wildcard search, only the exact one. Do you think the error message is now misleading in that regard? I'm happy to adjust it if you have suggestions for the wording. :)

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.

3 participants