Conversation
bae4888 to
a84a013
Compare
|
Please note that I removed Python 3.4 on |
bbc2
left a comment
There was a problem hiding this comment.
Thank you for this work.
I think it's OK to accept variables without a value but I don't agree with all the changes made in main.py. However, the changes in parser.py look fine.
I'm curious: What functions or classes of this project would Docker-compose use?
src/dotenv/main.py
Outdated
| key = to_env(k) | ||
| value = to_env(v) | ||
| if key and value: | ||
| os.environ[key] = value |
There was a problem hiding this comment.
This is quite complicated. What about simplifying this to the following?
if k in os.environ and not override:
continue
if v is not None:
os.environ[to_env(k)] = to_env(v)There was a problem hiding this comment.
Great!
That was me juggling with mypy errors and trying to test everything with None 😄
PTAL
src/dotenv/main.py
Outdated
| """ | ||
| ret = os.getenv(name, new_values.get(name, "")) | ||
| return ret | ||
| return ret if ret is not None else name |
There was a problem hiding this comment.
ret can't be None here, so I think the if is not None test shouldn't be added. Also, returning name looks incorrect because "" should be the default value.
It seems that Mypy detects an unrelated issue, but in that case I would suggest adding # type: ignore, if necessary, since it's probably a false positive from Mypy.
There was a problem hiding this comment.
Same mypy juggling here. I'll just ignore
PTAL
Signed-off-by: ulyssessouza <[email protected]>
Signed-off-by: Ulysses Souza <[email protected]>
01c197f to
30b0b0f
Compare
You are welcome!
The idea is to use |
OK good to know. |
bbc2
left a comment
There was a problem hiding this comment.
Looks good now. Nice rebasing. 👍
|
@bbc2 Any expectations on a release? For now I'm vendoring from my branch, but I cannot merge into |
|
Draft PR on |
Add support for variables with no value
Closes: #219