-
-
Notifications
You must be signed in to change notification settings - Fork 646
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support Python requirement target addrs in tool requirements. (#19014)
Currently users can enumerate `requirements` for a Python tool, which will cause Pants to use that requirement subset from the tool's lockfile. This supports resolving a tool from a larger lockfile, when that makes sense. If no requirements are provided the entire lockfile is used. Two examples of when resolving a tool from a subset of a larger lockfile is useful: 1. Resolving `pytest` as a tool at the same version as its runtime library without specifying it in two places. 2. Having a single lockfile for all tools, and user code, to be consumed by VSCode. However, the value of this `requirements` option is typically redundant with the input requirements used to generate the lockfile. This change allows `requirements` to specify addresses (or address specs). This can be used to avoid the redundancy: You can point to some python_requirement targets that are a subset of all those used to generate the lockfile. The implementation turns out to be reasonably neat, as it just pushes some code that turns addresses into requirement strings to slightly later in the pex creation logic, and actually allowed us to reduce some redundancy and trim some code. This fixes #18816.
- Loading branch information
Showing
11 changed files
with
186 additions
and
68 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.