-
Notifications
You must be signed in to change notification settings - Fork 279
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
base: main
Are you sure you want to change the base?
feat: allow searching for specific package versions using matchspec #3565
Conversation
There was a problem hiding this 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.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that actually work?
There was a problem hiding this comment.
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 :)
There was a problem hiding this comment.
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. :)
👀 any progress? I can work on this is the author allow it |
@trim21 from our side you would be welcome to continue this work! If @simonjung1603 doesn't react I would recommend to fork his work and continue from there. |
Hey, I am fine with either. I'd happily continue, frankly I wasn't sure how you wanted me to proceed as I didn't get a reply on my comment about wildcard matchspec and the error message. Sorry for not poking you to follow up but I was otherwise occupied. @trim21 if you have enough changes planned and want to take over, you have my permission. Just let me know. If all this needs to be merged is a rewording of the diagnostic though then I'd propose I finish it. |
So looks like this is a communication things 🤔 |
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.