Skip to content

Commit

Permalink
Fix: missed installing extra modules (#499)
Browse files Browse the repository at this point in the history
* fix: missed module installing for extra packages
feat: module_version for extra packages

* feat:comment: why it must not be removed
  • Loading branch information
Romazes authored Sep 9, 2024
1 parent 99fbdcf commit 3b3d0cc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lean/commands/backtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def backtest(project: Path,

# Configure addon modules
build_and_configure_modules(addon_module, cli_addon_modules, organization_id, lean_config,
kwargs, logger, environment_name)
kwargs, logger, environment_name, container_module_version)

lean_runner = container.lean_runner
lean_runner.run_lean(lean_config,
Expand Down
2 changes: 1 addition & 1 deletion lean/commands/live/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def deploy(project: Path,

# Configure addon modules
build_and_configure_modules(addon_module, cli_addon_modules, organization_id, lean_config,
kwargs, logger, environment_name)
kwargs, logger, environment_name, container_module_version)

if container.platform_manager.is_host_arm():
if "InteractiveBrokersBrokerage" in lean_config["environments"][environment_name]["live-mode-brokerage"] \
Expand Down
2 changes: 1 addition & 1 deletion lean/commands/optimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def optimize(project: Path,

# Configure addon modules
build_and_configure_modules(addon_module, cli_addon_modules, organization_id, lean_config,
kwargs, logger, environment_name)
kwargs, logger, environment_name, container_module_version)

container.update_manager.pull_docker_image_if_necessary(engine_image, update, no_update)

Expand Down
5 changes: 4 additions & 1 deletion lean/components/util/json_modules_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

def build_and_configure_modules(target_modules: List[str], module_list: List[JsonModule], organization_id: str,
lean_config: Dict[str, Any], properties: Dict[str, Any], logger: Logger,
environment_name: str):
environment_name: str, module_version: str):
"""Builds and configures the given modules
:param target_modules: the requested modules
Expand All @@ -29,10 +29,13 @@ def build_and_configure_modules(target_modules: List[str], module_list: List[Jso
:param properties: the user provided arguments
:param logger: the logger instance
:param environment_name: the environment name to use
:param module_version: The version of the module to install. If not provided, the latest version will be installed.
"""
for target_module_name in target_modules:
module = non_interactive_config_build_for_name(lean_config, target_module_name, module_list, properties,
logger, environment_name)
# Ensures extra modules (not brokerage or data feeds) are installed.
module.ensure_module_installed(organization_id, module_version)
lean_config["environments"][environment_name].update(module.get_settings())


Expand Down

0 comments on commit 3b3d0cc

Please sign in to comment.