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

Replace get_env_config() with resolve_env_vars(). #198

Merged
merged 14 commits into from
Jan 17, 2025
Merged

Conversation

apaz-cli
Copy link
Contributor

@apaz-cli apaz-cli commented Jan 16, 2025

Autism wins yet again. This is the last time though.

Instead of resolving the env vars as you access them with get_env_config(), let's just resolve them all at the beginning and do config.thing. The env var for that is still ZERO_BAND_THING, as before. But now we don't have to replace every place the config is accessed.

Because screw that, honestly. This is way better, and is what it should have been in the first place.


for field_name, _ in config_obj.__class__.model_fields.items():
# Build the full env var name
full_env_var = f"ZERO_BAND_{prefix}_{field_name}".upper() if prefix else f"ZERO_BAND_{field_name}".upper()
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you make ZERO_BAND ad const var somewhere ? In case where we finally rename the whole thing to prime

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, will do. Makes a lot of sense.

@apaz-cli apaz-cli merged commit ea4aa53 into main Jan 17, 2025
1 of 2 checks passed
@apaz-cli apaz-cli deleted the ap/liger_ce branch January 17, 2025 00:02
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.

2 participants