Enable package overrides in pip-compile
#631
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.
Summary
This PR enables overrides to be passed to
pip-compile
andpip-install
via a new--overrides
flag.When overrides are provided, we effectively replace any requirements that are overridden with the overridden versions. This is applied at all depths of the tree.
The merge semantics are such that we replace all requirements of a package with all requirements from the overrides files. So, for example, if a package declares:
And the user provides an override like:
Then both of the
foo
requirements in the package will be replaced with the override.If instead, the user provided an override like:
Then we'd replace both of the original
foo
requirements with both of these overrides. (In technical terms, for each package in the requirements file, we flat-map over its overrides.)Closes #511.