Skip to content

Conversation

@spott
Copy link

@spott spott commented Apr 25, 2025

If the user has an env variable loaded, that variable is no longer clobbered by a .env file referencing the same variable.

So if your env has "ANTHROPIC_API_KEY", and you have an env file with "ANTHROPIC_API_KEY", you will use the value from your environment, rather than your env file. This sets up the priority:

$HOME/.env
$GIT_ROOT/.env
$PWD/.env
${--env-file}

Part of the reason I think this is the correct way to do this is that there are a couple of secret management tools that will parse an env file with secret references into the environment with secrets (so an env file with USERNAME="op://vault/secret name/username" gets instantiated in the environment as USERNAME=<my secret username>). This is how I discovered this behavior.

uniq.reverse()
files = uniq
files = list(map(str, files))
files = list(dict.fromkeys(files))
Copy link
Author

Choose a reason for hiding this comment

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

I'm pretty sure this doesn't actually change anything (maybe it was from a previous version to make the list unique). If it actually does something, I'd love to know what.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant