Skip to content

feat: pixi search improvements: allow arbitrary MatchSpecs, add --json#5442

Merged
ruben-arts merged 39 commits intoprefix-dev:mainfrom
pavelzw:search-matchspec
Feb 27, 2026
Merged

feat: pixi search improvements: allow arbitrary MatchSpecs, add --json#5442
ruben-arts merged 39 commits intoprefix-dev:mainfrom
pavelzw:search-matchspec

Conversation

@pavelzw
Copy link
Collaborator

@pavelzw pavelzw commented Feb 4, 2026

Bildschirmaufnahme.2026-02-20.um.15.26.29.mov

closes #378, depends on conda/rattler#2036

this concludes all my wishes for pixi search. all other things like micromamba repoquery i would rather put in https://github.com/pavelzw/pixi-browse

How Has This Been Tested?

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 + codex

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added sufficient tests to cover my changes.
  • I have verified that changes that would impact the JSON schema have been made in schema/model.py.

Replace manual wildcard handling in `pixi search` with rattler's new
glob matchspec support via `ParseStrictnessWithNameMatcher`.

Changes:
- Consolidate `search_exact()` and `search_wildcard()` into single
  `search()` function that handles both exact and glob patterns
- Remove regex conversion and fuzzy search (jaro similarity) fallback
- Add `-n/--limit-packages` flag to control detailed output count
  (default: 3 packages show full info, rest show compact table)
- Gateway now handles glob matching internally - no more manual
  `gateway.names()` + filtering
- Results sorted alphabetically by package name

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@pavelzw pavelzw changed the title refactor: use rattler glob matchspec support in pixi search feat: pixi search improvements: allow arbitrary MatchSpecs, add --json Feb 20, 2026
Comment on lines +42 to +44
/// The platform(s) to search for
#[arg(short, long, default_values_t = [Platform::current(), Platform::NoArch])]
pub platform: Vec<Platform>,
Copy link
Collaborator Author

@pavelzw pavelzw Feb 20, 2026

Choose a reason for hiding this comment

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

this is slightly different api than the rest of pixi but can express more. any opinions on this? alternatively we could also only add --all-platforms and fall back to platform being vec![platform, Platform::NoArch]

Copy link
Contributor

Choose a reason for hiding this comment

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

Does it really change anything for the normal usage? I though it would start expecting --platform linux-64 osx-64 but it still expects one value per flag, so I guess it's good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

"Normal usage" might be -p linux-64 which would After this pr not include noarch. This might be unexpected in some scenarios

"ISC",
"MIT",
"MPL-2.0",
"OpenSSL",
Copy link
Collaborator Author

@pavelzw pavelzw Feb 20, 2026

Choose a reason for hiding this comment

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

parts of the codebase now use aws-smithy-http-client which uses aws-lc-sys which apparently has the openssl license

❯ cargo tree -i aws-lc-sys
aws-lc-sys v0.37.1
└── aws-lc-rs v1.16.0
    ├── rustls v0.23.36
    │   ├── aws-smithy-http-client v1.1.9
    │   │   ├── rattler_networking v0.26.1

since reqwest 0.13 will require this anyway(?) i think this is fine

@pavelzw pavelzw marked this pull request as ready for review February 20, 2026 15:55
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

Love the change! Next step is a smarter result where it does an automatic * addition to the string if it doens't find anything ;)

I believe rattler was released such that you can update it in Pixi.

Comment on lines +42 to +44
/// The platform(s) to search for
#[arg(short, long, default_values_t = [Platform::current(), Platform::NoArch])]
pub platform: Vec<Platform>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does it really change anything for the normal usage? I though it would start expecting --platform linux-64 osx-64 but it still expects one value per flag, so I guess it's good.

return Err(e).into_diagnostic();
}
// Resolve platforms
let platforms = if args.all_platforms {
Copy link
Contributor

Choose a reason for hiding this comment

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

Reading this I feel this could be even more agressive.

Why not use workspace.platforms always and only sort for the specific platforms if requested or outside of the workspace. --all-platforms sounds to me that it would go beyond the given platforms and search with all the exotic stuff rattler already knows.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Also works for me 👍🏻

Copy link
Collaborator Author

@pavelzw pavelzw Feb 27, 2026

Choose a reason for hiding this comment

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

okay let's remove --all-platforms (make it default) and make platforms an Option<Platform>

Copy link
Collaborator Author

@pavelzw pavelzw Feb 27, 2026

Choose a reason for hiding this comment

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

@pavelzw
Copy link
Collaborator Author

pavelzw commented Feb 27, 2026

i updated the rattler crates again and rattler-build

@pavelzw pavelzw requested a review from ruben-arts February 27, 2026 00:54
Copy link
Contributor

@ruben-arts ruben-arts left a comment

Choose a reason for hiding this comment

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

Great feature! Thanks

@ruben-arts ruben-arts merged commit 75150e5 into prefix-dev:main Feb 27, 2026
41 checks passed
@pavelzw pavelzw deleted the search-matchspec branch February 27, 2026 09:50
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.

Improvement ideas for pixi search

2 participants