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

Handling of unset/empty environment variables #3

Closed
moreinhardt opened this issue Nov 17, 2020 · 2 comments
Closed

Handling of unset/empty environment variables #3

moreinhardt opened this issue Nov 17, 2020 · 2 comments

Comments

@moreinhardt
Copy link

Is the following intended?

foo: "xx${BAR}zzz"

When BAR isn't set, in the shell this would evaluate to "xxzzz". When I use this package I get the following:

from envyaml import EnvYAML
env = EnvYAML()
env["foo"] is None  # True

I think the default behaviour should be to perform the expansion like the shell does.

And I propose a flag that can be passed to __init__() to raise errors in case of unset (and empty?) variables that should be parsed. e.g. env = EnvYAML(ignore_unset=False) -> would raise an error (default True of course).

What do you think? I'd be happy to contribute this.

@thesimj
Copy link
Owner

thesimj commented Nov 24, 2020

this feature will be addressed in version 1.0.0 (branch https://github.com/thesimj/envyaml/tree/develop-v1)

@thesimj
Copy link
Owner

thesimj commented Nov 25, 2020

Stable version v1 with strict mode and default values.
I will be appreciate if you could review it.

https://github.com/thesimj/envyaml/tree/develop-v1

@thesimj thesimj closed this as completed Nov 25, 2020
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

No branches or pull requests

2 participants