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

Dotenv run resolve path #507

Closed
wants to merge 20 commits into from
Closed

Conversation

Bajron
Copy link

@Bajron Bajron commented Mar 15, 2024

No description provided.

Bajron and others added 20 commits November 13, 2023 22:30
Default expansion is more strict now (undefined vs. empty).
The supported set is closer to what is available in docker-compose
See: https://docs.docker.com/compose/environment-variables/env-file/
Single quoted strings do not expand variables in bash.
I think the libary was missing a simple way
to selectively disable variable expansion.
Error results in no quote.
I corrected flake8 errors in this commit.
test_parser.py had a lot of long lines, formatted it with black.

Importing sh is done in try/except. Although the package
is available for Windows, it is failing on import.

Moved previous manual tests into proper pytest.

Utility for simulating Windows os.environment behavior
moved to a separate file.
This commit brings back the old interface for `resolve_variables`.
I realized it might be actually used by the clients.

I made _resolve_bindings private.
Created resolve_variable as a result of refactoring.
It be as useful as resolve_variables for the clients.
With an option to have a different behavior for single quoted
strings it would be nice to use mixed string (e.g. "ffo"'${bar}'
to produce "foo${bar}".

Intruduced it by reading multiple strings on the value side.
Unquoted strings are tricky because of the whitespace and comments.
All the rest should come for free, as it is a change from
handling a single value to handling a list of values and concatenation.
There was actually one bug detected by the typing check.
Value without '=' did not work properly. Added a test for that.
Add windows to tested operating systems
Addresses non-intuitive behavior of `dotenv run python ...` on Windows
@Bajron Bajron closed this Mar 15, 2024
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.

None yet

1 participant