Add .env file support for environment login strategy#1265
Add .env file support for environment login strategy#1265Sherwin-14 wants to merge 1 commit intoearthaccess-dev:mainfrom
Conversation
|
I feel like I've missed some conversations here, but I'm not sure we should add It looks like this is only being used for earthdata login credentials, and a netrc file is a more standard place to serialize and store the credentials, which we'll also write to disk for users. I'm not sure what benefit supporting Similarly, I've typically seen .env use more for testing than for end-users, so I would have expected to see this in a |
|
I agree, but to be honest, `.env` is more popular.
I think that in itself is good reason to support it.
`.netrc` isn't as well known as `.env`, and using `.env` for managing
secrets has pretty much been standardized.
`.netrc` is also user-local rather than project local.
Though an archaic usecase, a developer could use different accounts for
different projects if `.env` was added. Which is possible with `.netrc`,
but requires you to fiddle around.
Though, I suppose we could remove load_dotenv and only mention it in the
documentation, that's fine too.
I think we should wait to hear what Matt has to say, since he was the one
who created the issue.
…On Mon, 23 Mar 2026, 15:00 Joseph H Kennedy, ***@***.***> wrote:
*jhkennedy* left a comment (earthaccess-dev/earthaccess#1265)
<#1265 (comment)>
I feel like I've missed some conversations here, but I'm not sure we
should add load_dotenv to the earthaccess init.
It looks like this is only being used for earthdata login credentials, and
a netrc file is a more standard place to serialize and store the
credentials, which we'll also write to disk for users. I'm not sure what
benefit supporting .dotenv adds and makes reasoning about credentials
more complicated?
Similarly, I've typically seen .env use more for testing than for
end-users, so I would have expected to see this in a conftest.py or
similar.
—
Reply to this email directly, view it on GitHub
<#1265?email_source=notifications&email_token=BBV63P57U7BLP2BFDM5MYOT4SD72LA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJQHEYTQOJZGA42M4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4109189909>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBV63PZ354DJGTE5IFBHAZ34SD72LAVCNFSM6AAAAACW2WK2S2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMBZGE4DSOJQHE>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
I agree with @jhkennedy. Although dotenv is a small package, our dependency tree is already quite bloated (we should define "extras" to help end-users avoid unwanted deps). Further, this approach does not allow users to configure things differently than the default (i.e., this approach supports only use of a single file named If a user wants to use a "dot env" file, they should do so on their own so they have full control. |
I suppose this is more of a downvote for the original issue: #748 |
|
True.
I guess I can remove calls and the dependency on dotenv(), and only add
lines to the documentation that mention how you can use .env.
…On Wed, 25 Mar 2026, 20:21 Chuck Daniels, ***@***.***> wrote:
*chuckwondo* left a comment (earthaccess-dev/earthaccess#1265)
<#1265 (comment)>
I agree with @jhkennedy <https://github.com/jhkennedy>.
Although dotenv is a small package, our dependency tree is already quite
bloated (we should define "extras" to help end-users avoid unwanted deps).
Further, this approach does not allow users to configure things
differently than the default (i.e., this approach supports *only* use of
a single file named .env).
If a user wants to use a "dot env" file, they should do so on their own so
they have full control.
I suppose this is more of a downvote for the original issue: #748
<#748>
—
Reply to this email directly, view it on GitHub
<#1265?email_source=notifications&email_token=BBV63P7ET5HSRQZ4RJ7B4FT4SPW7XA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMJSG4ZDGNJRGEZKM4TFMFZW63VGMF2XI2DPOKSWK5TFNZ2KYZTPN52GK4S7MNWGSY3L#issuecomment-4127235112>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BBV63P6BQYKRPKL6Z2H467D4SPW7XAVCNFSM6AAAAACW2WK2S2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DCMRXGIZTKMJRGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
This PR allows the
environmentlogin strategy to load environment variables from.envfile. Resolves #748.📚 Documentation preview 📚: https://earthaccess--1265.org.readthedocs.build/en/1265/