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

Conversation

Seven4ME
Copy link
Contributor

According to the UV documentation, the UV_ENV_FILE environment variable should support multiple .env files, separated by spaces. However, when I tried using this feature in my repository, it didn’t work as expected.

To investigate, I checked the UV repository for relevant tests and found run_with_multiple_env_files.
This test asserts the following error: No environment file found at: .env1 .env2.

This discrepancy could indicate either a mismatch between the documentation and the implementation or a bug in the code.

I decided to fix the issue in the code since the ability to pass multiple .env files is a valuable feature.
If my fix isn’t appropriate, I’d be happy to make any necessary adjustments.

@charliermarsh charliermarsh self-assigned this Feb 20, 2025
@charliermarsh charliermarsh changed the title fix: Multiple .env files in UV_ENV_FILE Accept multiple .env files in UV_ENV_FILE Feb 21, 2025
@charliermarsh charliermarsh added bug Something isn't working configuration Settings and such labels Feb 21, 2025
Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! Looks like an oversight. I changed the fix to use Clap's built-in value_delimiter setting.

@charliermarsh charliermarsh enabled auto-merge (squash) February 21, 2025 05:29
@charliermarsh charliermarsh merged commit 88aa6e2 into astral-sh:main Feb 21, 2025
74 checks passed
@Seven4ME
Copy link
Contributor Author

Oh, really...
Nice fix! Thanks for the quick reaction :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working configuration Settings and such
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants