Skip to content

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>
@pavelzw pavelzw marked this pull request as ready for review February 4, 2026 18:38
@pavelzw pavelzw requested a review from baszalmstra February 4, 2026 18:38

// 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?

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