uv
407f1e37 - uv-resolver: filter dependencies that can't exist in a fork

Commit
1 year ago
uv-resolver: filter dependencies that can't exist in a fork This commit adds marker expressions to our `Fork` type, which are in turn passed down into `PubGrubDependencies::from_requirements` to filter our any dependencies with markers that are disjoint from the fork's marker expression. This is necessary to avoid visiting packages in the dependency graph that can never actually be installed. This is because when a fork is created in the resolver, it always happens when there are two sibling dependency specifications on a package with the same name, but with non-overlapping marker expressions. Each fork corresponds to each such conflicting dependency specification, and each fork assumes the the corresponding marker expression as a pre-condition for any future dependencies considered by it. That is, since the fork represents an installation path that can only be taken when the corresponding dependency specification (and its marker expression) is actually used, it also therefore follows that the marker expression is true. Therefore, any dependency visited in that fork with a marker expression that cannot possibly be true when the markers of the fork are true can and ought to be completely ignored.
Author
Committer
Parents
Loading