-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use environment layering for
uv run --with
(#3447)
## Summary This PR takes a different approach to `--with` for `uv run`. Now, instead of merging the requirements and re-resolving, we have two phases: (1) sync the workspace requirements to the workspace environment; then (2) sync the ephemeral `--with` requirements to an ephemeral environment. The two environments are then layered by setting the `PATH` and `PYTHONPATH` variables appropriately. I think this approach simplifies a few things: 1. Once we have a lockfile, the semantics are much clearer, and we can actually reuse it for the workspace. If we had to add arbitrary dependencies via `--with`, then it's not really clear how the lockfile would/should behave. 2. Caching becomes simpler, because we can just cache the ephemeral environment based on the requirements. The current version of this PR loses a few behaviors though that I need to restore: - `--python` support -- but I'm not yet sure how this is supposed to behave within projects? It's also left unclear in `uv sync` and `uv lock`. - The "reuse the workspace environment if it already satisfies the ephemeral requirements" behavior. Closes #3411.
- Loading branch information
1 parent
7d41e7d
commit fa43288
Showing
2 changed files
with
134 additions
and
151 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