feat: support glob and regex patterns in repodata queries#2036
Merged
baszalmstra merged 18 commits intoconda:mainfrom Feb 19, 2026
Merged
feat: support glob and regex patterns in repodata queries#2036baszalmstra merged 18 commits intoconda:mainfrom
baszalmstra merged 18 commits intoconda:mainfrom
Conversation
pavelzw
commented
Feb 4, 2026
Enable QueryExecutor to handle glob patterns (e.g., `foo*`) and regex patterns (e.g., `^numpy.*$`) in package names. Previously, these specs were silently dropped. The implementation stores pattern specs separately and expands them by matching against all package names from the subdirs before fetching records. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add a new `rattler search` command that demonstrates the glob and regex pattern support in repodata queries. Users can search for packages using: - Exact names: `rattler search python` - Glob patterns: `rattler search "python*"` - Regex patterns: `rattler search "^numpy-.*$"` Example usage: rattler search "openssl*" -c conda-forge --limit 5 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
7794e33 to
264107e
Compare
Add a doctest example to Gateway.query showing how to use glob patterns with MatchSpec(exact_names_only=False). Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8 tasks
baszalmstra
requested changes
Feb 5, 2026
|
|
||
| // If we have pattern specs, we need to wait for all subdirs to be loaded | ||
| // first so we can get all package names to match against | ||
| if !self.pending_pattern_specs.is_empty() { |
Collaborator
There was a problem hiding this comment.
I think it would be nicer if we can do this concurrently. This now blocks everything else meaning that if you have a channel that takes much longer we are essentially wasting time.
When a subdir resolves we query its names for matching packages.
I can also give this a go if that helps?
… executor The pattern expansion code was missing the `std::collections::HashSet` import and calling `HashMap::insert` with wrong arguments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
baszalmstra
reviewed
Feb 19, 2026
Collaborator
baszalmstra
left a comment
There was a problem hiding this comment.
Can you also add a test that verifies that this works when multiple channels/subdirs have different package names. We need to make sure they are all found across channels and subdirs.
Two mock sources with disjoint "lib-*" packages spread across linux-64 and noarch. Asserts all four matching names are found. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
baszalmstra
approved these changes
Feb 19, 2026
Closed
Merged
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable QueryExecutor to handle glob patterns (e.g.,
foo*) and regex patterns (e.g.,^numpy.*$) in package names. Previously, these specs were silently dropped.The implementation stores pattern specs separately and expands them by matching against all package names from the subdirs before fetching records.
closes #1723
Description
This is part 1 of improving pixi search: Xref prefix-dev/pixi#378