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

Adding support for invoking cli as python -m dotenv #394

Closed
bialix opened this issue Apr 5, 2022 · 2 comments · Fixed by #395
Closed

Adding support for invoking cli as python -m dotenv #394

bialix opened this issue Apr 5, 2022 · 2 comments · Fixed by #395

Comments

@bialix
Copy link

bialix commented Apr 5, 2022

I'm heavily using virtualenv as many python developers today. And I don't use "activate" in my workspaces, but instead run just fine local symlink (or batch file on Windows) to execute something in current venv workspace. That works just fine as far as every lib I care about has the way to run it with python -m.

Please consider adding this little addition to your library that allows running your utility as python -m dotenv.

@bialix
Copy link
Author

bialix commented Apr 5, 2022

You need to put the following chunk of code to your src/dotenv/__main__.py file:

from .cli import cli

if __name__ == "__main__":
    cli()

@theskumar
Copy link
Owner

This sounds great! I'll get it added.

Thank you

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 a pull request may close this issue.

2 participants