Skip to content

Conversation

konstin
Copy link
Member

@konstin konstin commented Aug 27, 2025

Add a new method to add a single custom incompatibility that requires the base package and the proxy package share the same version range.

This intended for cases where proxy packages (also known as virtual packages) are used. Without this information, pubgrub does not know that these packages have to be at the same version. In cases where the base package is already to an incompatible version, this avoids going through all versions of the proxy package. In cases where there are two incompatible proxy packages, it avoids trying versions for both of them. Both improve performance (we don't need to check all versions when there is a conflict) and error messages (report a conflict of version ranges instead of enumerating the conflicting versions).

This method requires the user to manually register proxy packages, and is only available through DependecyProvider. Ideally, we had a more general concept of proxy packages in pubgrub, with built-in heuristics or at least misuse-safe methods.

There's several usage patterns for this method. The basic one is upon encountering a dependency on a proxy package with a range, using this method with its base package and that range.

Companion change in uv: astral-sh/uv#15200

Add a new method to add a single custom incompatibility that requires the base package and the proxy package share the same version range.

This intended for cases where proxy packages (also known as virtual packages) are used. Without this information, pubgrub does not know that these packages have to be at the same version. In cases where the base package is already to an incompatible version, this avoids going through all versions of the proxy package. In cases where there are two incompatible proxy packages, it avoids trying versions for both of them. Both improve performance (we don't need to check all versions when there is a conflict) and error messages (report a conflict of version ranges instead of enumerating the conflicting versions).

There's several usage patterns for this method. The basic one is upon encountering a dependency on a proxy package with a range, using this method with its base package and that range.
@konstin
Copy link
Member Author

konstin commented Aug 27, 2025

According to astral-sh/uv#15200, this is a small performance improvement.

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.

1 participant