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

Remove environs #2222

Open
lucyb opened this issue Dec 10, 2024 · 1 comment
Open

Remove environs #2222

lucyb opened this issue Dec 10, 2024 · 1 comment

Comments

@lucyb
Copy link
Contributor

lucyb commented Dec 10, 2024

See Dave's comment in this PR.

Airlock specifically didn't use environs because its transitive dependencies seemed pretty heavyweight for the value it gives. We're only using it in settings.py, so it seems unlikely we're getting the full value from it and that we can easily remove it.

@StevenMaude
Copy link
Contributor

The solution used in Airlock is to rely on just importing the .env and directly calling out to os.environ(), with a helpful error message if an environment variable is missing telling you to import via your shell.

See https://github.com/opensafely-core/airlock/blob/6148179ac2b0c669b0388fbaf2ce31ddeeaa3324/airlock/settings.py

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

No branches or pull requests

3 participants