Skip to content
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

feat: Match GenericVirtualPackage with MatchSpec #1016

Merged
merged 4 commits into from
Jan 9, 2025

Conversation

ruben-arts
Copy link
Collaborator

@ruben-arts ruben-arts commented Jan 7, 2025

Description

I'm working on improving pixi's implementation of the virtual package requirements.

I was reading the virtual packages from the depends field of the package record, which could be parsed as MatchSpecs. So I implemented this. But to avoid the huge overhead of parsing all dependencies, I later reverted to doing the starts_with("__") check again in pixi on the strings. I kept this feature in rattler_conda_types::MatchSpec however, as it seems like a useful function.

This PR also allows you to compare MatchSpecs with GenericVirtualPackages, which I use to validate the system virtual packages with the MatchSpecs of a virtual dependency.

I've also added some small convenience functions to make building the logic on the lockfile a little easier.

…atchspec is virtual.

This is useful to compare `depends` from a record to a `GenericVirtualPackage`
@ruben-arts ruben-arts marked this pull request as draft January 7, 2025 12:37
@baszalmstra baszalmstra changed the title feat: Let the matchspec work with virtual packages feat: Match GenericVirtualPackage with MatchSpec Jan 9, 2025
@ruben-arts ruben-arts marked this pull request as ready for review January 9, 2025 12:57
@ruben-arts ruben-arts requested a review from baszalmstra January 9, 2025 12:58
@baszalmstra baszalmstra enabled auto-merge (squash) January 9, 2025 12:59
@baszalmstra baszalmstra merged commit 899ab59 into conda:main Jan 9, 2025
16 checks passed
@baszalmstra baszalmstra mentioned this pull request Jan 9, 2025
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.

2 participants