Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lean/components/docker/lean_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -969,7 +969,7 @@ def parse_extra_docker_config(run_options: Dict[str, Any], extra_docker_config:
target = run_options["environment"] = {}
if isinstance(extra_docker_config["environment"], list):
target.update({item[0]: item[1] for item in [
item if not isinstance(item, str) else (item.split("=")[0], item.split("=")[1]) for item in extra_docker_config["environment"]
item if not isinstance(item, str) else item.split("=", 1) for item in extra_docker_config["environment"]
]})
elif isinstance(extra_docker_config["environment"], dict):
target.update(extra_docker_config["environment"])
Expand Down
8 changes: 8 additions & 0 deletions tests/components/docker/test_lean_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,3 +823,11 @@ def path_is_mounted_in_files(path):

assert all([key in backtesting_env and backtesting_env[key] == source_to_target(value)
for key, value in paths_to_mount.items()])


def test_lean_runner_parses_environment_values_containing_equals_from_extra_docker_configs() -> None:
run_options = {}
LeanRunner.parse_extra_docker_config(run_options,
{"environment": ["JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8", "TOKEN=abc=="]})

assert run_options["environment"] == {"JAVA_TOOL_OPTIONS": "-Dfile.encoding=UTF-8", "TOKEN": "abc=="}
Loading