Add DepsTraversalBehavior(Enum) and some docstrings#19387
Merged
cognifloyd merged 3 commits intomainfrom Jun 27, 2023
Merged
Conversation
DepsTraversalBehavior(Enum) and some docstrings
cognifloyd
added a commit
that referenced
this pull request
Jul 15, 2023
…19155) This builds on: - #19272 - #19306 - #19387 This only updates the `pex_binary` rule to use the new `TraverseIfNotPackageTarget` predicate when requesting the source files that should be included in this pex. Wheels, other pex_binaries, and other package targets are not handled via this code path since those are not python sources that get included in the pex based on the `include_sources` flag. Fixes #15855 This fixes #15855 because anything in a `python_distribution` does not need to be included as a source file in the `pex_binary`. wheels get included via the `LocalDists` rules. In some cases, we might still get more sources in the pex than intended. This might happen if a dependency is inferred between sources, bypassing the logic that looks for wheels that own the relevant things. In any case, this is PR provides an improvement and resolves the sample error in #15855. Related: - #18254 - #17368 - #15082 --------- Co-authored-by: Joshua Cannon <joshdcannon@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This addresses feedback from #19306 (review)
The
ShouldTraverseDepsPredicatereturned a bool before. But, the bool was sometimes unclear, so this adds an enum to make the code more readable.NB: The values of the enum are not important.
This is marked as internal because it's a refactor for a 2.18.x feature that hasn't been released yet.