Fix protobuf resolution knot for pip 25.1 #51742
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related to #51702.
There is a resolution "knot" involving
protobufwhen pip 25.1 attempts to resolve dependencies during CI. Many Google dependencies requireprotobuf, butgrpcio-statusandopentelemetry-protooften have conflicting version requirements, for example:grpcio-status1.73.0 requiresprotobuf<7.0.0,>=6.30.0opentelemetry-proto1.27.0 requiresprotobuf<5.0,>=3.19Because so many packages depend on
protobuf, pip's heuristics struggle to correctly identify which packages to backtrack on, leading to resolution too deep errors.This change introduces a workaround by adding
opentelemetry-protowith an upper bound to the dependency list. This signals to pip that the package should be resolved early, while the use of a very high upper bound ensures that it doesn't meaningfully restrict user environments. I considered using a requirement likeopentelemetry-proto<2!0, but decided against it, as it felt too magical and might break tools that are not fully PEP 440 compliant.