Simplify python local dist handling code. #5480
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.
Previously,
BuildLocalPythonDistributions
generated local dists and put themin products. Downstream tasks then synthesized
PythonRequirementLibrary
targets to point to the local dists, if they needed to resolve them. This was clunky,
and required special knowledge of local dist issues to reside in multiple downstream
tasks.
This change has
BuildLocalPythonDistributions
itself inject the syntheticPythonRequirementLibrary
targets - one per dist - and stitches them into thebuild graph. Downstream tasks no longer need to know or care about local dists
(apart from declaring them as required products), they just see
PythonRequirementLibrary
targets, whether synthetic or organic, and handle them uniformly.
Note that previously
PythonBinaryCreate
had to do some footwork to ensure that only thedists depended on by a specific
PythonBinary
were used when creating that binary.This now happens naturally, since we generate one requirement library per dist,
and the dependencies are wired up in the right way.