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

Config.load() should probably always read .env files #171

Open
scy opened this issue Oct 6, 2023 · 3 comments
Open

Config.load() should probably always read .env files #171

scy opened this issue Oct 6, 2023 · 3 comments
Labels
area:backend Related to the server component class:newcomer Good for newcomers to the project: easy and/or limited scope prio:D Completely optional, but interesting nevertheless type:enhancement New feature or request

Comments

@scy
Copy link
Collaborator

scy commented Oct 6, 2023

Right now, only CLI commands (i.e. dearmep …) load a .env file automatically. It would probably be cool, especially for debugging when you run random modules like python -m dearmep.whatever, if .env files would always be loaded…?

@scy scy added type:enhancement New feature or request area:backend Related to the server component labels Oct 6, 2023
@scy scy added this to the 1.0: suggest MEPs, no call support milestone Oct 6, 2023
@scy scy added the prio:D Completely optional, but interesting nevertheless label Oct 11, 2023
@jbethune
Copy link
Collaborator

jbethune commented Nov 4, 2023

Does that mean we should add

if __name__ == "__main__":
  from dotenv import load_dotenv
  load_dotenv()

at the top of all python files?

@jbethune
Copy link
Collaborator

jbethune commented Nov 5, 2023

On second thought: YAGNI? I vote for closing this 1.0 issue, because there is no clear need for it right now and it's easy to add this feature later to specific python modules if we should discover that it is actually useful.

@scy
Copy link
Collaborator Author

scy commented Dec 15, 2024

Does that mean we should add

if __name__ == "__main__":
  from dotenv import load_dotenv
  load_dotenv()

at the top of all python files?

No. As the title said, doing it in Config.load should be sufficient.

@scy scy added the class:newcomer Good for newcomers to the project: easy and/or limited scope label Dec 15, 2024
@scy scy removed this from the 1.0: suggest MEPs, no call support milestone Dec 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:backend Related to the server component class:newcomer Good for newcomers to the project: easy and/or limited scope prio:D Completely optional, but interesting nevertheless type:enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants