You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export UV_ENV_FILE=./.env
uv run <something>cd<new repo without .env file>
uv run <something>
or even better, add export UV_ENV_FILE=./.env to my .bash_profile
Currently, uv will throw an error if UV_ENV_FILE doesn't point to a valid file:
error: No environment file found at: `./.env`
Proposed solution
Add a config option/env var to proceed on missing env file, e.g. proceed with uv run (and throw a warning instead) if UV_WARN_ON_MISSING_ENV_FILE=1.
Alternatively, maybe there's a solution where a missing env-file is only an error if it's passed with the --env-file flag, and a warning if it's set with the UV_ENV_FILE var.
The text was updated successfully, but these errors were encountered:
I've stumbled upon a similar problem. Imo it would be great to just have a flag (or even default behavior) to read .env in the project directory if such file exists.
Essentially, yes. There's generally some env vars that I source centrally (i.e. artifactory/docker login credentials), and some that I have in a .env file in the repo (i.e. db connection strings, mlflow tracking uri etc.), I can't really store them centrally because the apps/libs generally look for specific var names to find and connect to the resources.
I'd like to be able to configure uv to use my repo scoped .env files (if found) by default, without breaking my development workflow if I switch to another repo.
Problem
I'd like to be able to do the following:
or even better, add
export UV_ENV_FILE=./.env
to my.bash_profile
Currently, uv will throw an error if
UV_ENV_FILE
doesn't point to a valid file:Proposed solution
Add a config option/env var to proceed on missing env file, e.g. proceed with
uv run
(and throw a warning instead) ifUV_WARN_ON_MISSING_ENV_FILE=1
.Alternatively, maybe there's a solution where a missing env-file is only an error if it's passed with the
--env-file
flag, and a warning if it's set with theUV_ENV_FILE
var.The text was updated successfully, but these errors were encountered: