forked from pantsbuild/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix issues with REPL implementation (pantsbuild#10597)
There were a few issues with our REPL support: 1. We ran the REPL in a tmpdir under the repo root, with the cwd was the repo root. So if the repo root also happened to also be a source root we'd import from the original sources in the repo, instead of from the chrooted copy. 2. There was custom target filtering logic on the repl implementations, that didn't handle codegen (and was redundant anyway). This change fixes these by: 1. Running the REPL in a chroot not under the repo root. 2. Getting rid of the custom target filtering. Our python/ipython REPL implementations just use the standard mechanisms for this. This change also refactors out a requirements_pex_from_targets_request helper function that creates a PexFromTargetsRequest that can generate a pex containing just requirements. We now use this in pytest_runner.py and in repl.py. This increases the chances of getting cache hits, as this helper ensures that, e.g., the pex output file name is uniform. To further increase cache hits, this change resolves ipython in a separate pex, instead of in the requirements pex. As a result, we can now see generated code in python/ipython repls. [ci skip-rust] [ci skip-build-wheels]
- Loading branch information
Showing
7 changed files
with
137 additions
and
74 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.