Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accept multiple .env files in UV_ENV_FILE #11665

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2784,7 +2784,7 @@ pub struct RunArgs {
///
/// Can be provided multiple times, with subsequent files overriding values defined in previous
/// files.
#[arg(long, env = EnvVars::UV_ENV_FILE)]
#[arg(long, value_delimiter = ' ', env = EnvVars::UV_ENV_FILE)]
pub env_file: Vec<PathBuf>,

/// Avoid reading environment variables from a `.env` file.
Expand Down
8 changes: 5 additions & 3 deletions crates/uv/tests/it/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3974,12 +3974,14 @@ fn run_with_multiple_env_files() -> Result<()> {
"###);

uv_snapshot!(context.filters(), context.run().arg("test.py").env(EnvVars::UV_ENV_FILE, ".env1 .env2"), @r###"
success: false
exit_code: 2
success: true
exit_code: 0
----- stdout -----
palpatine
obi_wan_kenobi
C3PO

----- stderr -----
error: No environment file found at: `.env1 .env2`
"###);

Ok(())
Expand Down
Loading