Support UV_PROJECT environment to set project directory. (#12327)

## Summary

<!-- What's the purpose of the change? What does it do, and why? -->
Support the `UV_PROJECT` environment variable to set the project
directory.
#11946 

## Test Plan

<!-- How was it tested? -->
`cargo nextest run` passed except the cache_prune.
```
export UV_PROJECT=/path/to/project
uv sync
```
works.

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
This commit is contained in:
Nozomi R
2025-03-31 03:12:02 +08:00
committed by GitHub
parent 56914c9c60
commit ac2dcd658e
5 changed files with 59 additions and 8 deletions
+1 -1
View File
@@ -319,7 +319,7 @@ pub struct GlobalArgs {
/// See `--directory` to change the working directory entirely.
///
/// This setting has no effect when used in the `uv pip` interface.
#[arg(global = true, long)]
#[arg(global = true, long, env = EnvVars::UV_PROJECT)]
pub project: Option<PathBuf>,
}