Skip to content

feat: support glob and regex patterns in repodata queries#2036

Merged
baszalmstra merged 18 commits intoconda:mainfrom
pavelzw:glob-repodata-queries
Feb 19, 2026
Merged

feat: support glob and regex patterns in repodata queries#2036
baszalmstra merged 18 commits intoconda:mainfrom
pavelzw:glob-repodata-queries

Conversation

@pavelzw
Copy link
Member

@pavelzw 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.

closes #1723

Description

This is part 1 of improving pixi search: Xref prefix-dev/pixi#378

pavelzw and others added 2 commits February 4, 2026 17:29
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>
@pavelzw pavelzw force-pushed the glob-repodata-queries branch from 7794e33 to 264107e Compare February 4, 2026 16:32
pavelzw and others added 5 commits February 4, 2026 17:56
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>

// 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() {
Copy link
Collaborator

Choose a reason for hiding this comment

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

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

pavelzw and others added 8 commits February 5, 2026 14:55
… 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>
Copy link
Collaborator

@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.

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.

pavelzw and others added 3 commits February 19, 2026 13:28
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>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@pavelzw pavelzw requested a review from baszalmstra February 19, 2026 12:33
@baszalmstra baszalmstra merged commit 2c9d9ad into conda:main Feb 19, 2026
20 checks passed
@github-actions github-actions bot mentioned this pull request Feb 19, 2026
@pavelzw pavelzw deleted the glob-repodata-queries branch February 19, 2026 13:37
@pavelzw pavelzw mentioned this pull request Feb 19, 2026
2 tasks
@github-actions github-actions bot mentioned this pull request Feb 19, 2026
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.

Add support for glob/regex in repodata queries

2 participants