Skip to content

Commit

Permalink
fix: wrong condition tabulation
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Apr 19, 2024
1 parent efcc2a6 commit 1393c12
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions lean/components/docker/lean_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,27 +340,27 @@ def _setup_installed_packages(self, run_options: Dict[str, Any], image: DockerIm
self._logger.debug(f"LeanRunner._setup_installed_packages(): installed packages {len(installed_packages)}")
self.set_up_common_csharp_options(run_options, target_path)

# Mount the modules directory
run_options["volumes"][MODULES_DIRECTORY] = {"bind": "/Modules", "mode": "ro"}

# Add the modules directory as a NuGet source root
run_options["commands"].append("dotnet nuget add source /Modules")
# Create a C# project used to resolve the dependencies of the modules
run_options["commands"].append("mkdir /ModulesProject")
run_options["commands"].append("dotnet new sln -o /ModulesProject")
# Mount the modules directory
run_options["volumes"][MODULES_DIRECTORY] = {"bind": "/Modules", "mode": "ro"}

# Add the modules directory as a NuGet source root
run_options["commands"].append("dotnet nuget add source /Modules")
# Create a C# project used to resolve the dependencies of the modules
run_options["commands"].append("mkdir /ModulesProject")
run_options["commands"].append("dotnet new sln -o /ModulesProject")

framework_ver = self._docker_manager.get_image_label(image, 'target_framework', DEFAULT_LEAN_DOTNET_FRAMEWORK)
run_options["commands"].append(f"dotnet new classlib -o /ModulesProject -f {framework_ver} --no-restore")
run_options["commands"].append("rm /ModulesProject/Class1.cs")

# Add all modules to the project, automatically resolving all dependencies
for package in installed_packages:
self._logger.debug(f"LeanRunner._setup_installed_packages(): Adding module {package} to the project")
run_options["commands"].append(f"rm -rf /root/.nuget/packages/{package.name.lower()}")
run_options["commands"].append(f"dotnet add /ModulesProject package {package.name} --version {package.version}")

# Copy all module files to /Lean/Launcher/bin/Debug, but don't overwrite anything that already exists
run_options["commands"].append("python /copy_csharp_dependencies.py /Compile/obj/ModulesProject/project.assets.json")
framework_ver = self._docker_manager.get_image_label(image, 'target_framework', DEFAULT_LEAN_DOTNET_FRAMEWORK)
run_options["commands"].append(f"dotnet new classlib -o /ModulesProject -f {framework_ver} --no-restore")
run_options["commands"].append("rm /ModulesProject/Class1.cs")

# Add all modules to the project, automatically resolving all dependencies
for package in installed_packages:
self._logger.debug(f"LeanRunner._setup_installed_packages(): Adding module {package} to the project")
run_options["commands"].append(f"rm -rf /root/.nuget/packages/{package.name.lower()}")
run_options["commands"].append(f"dotnet add /ModulesProject package {package.name} --version {package.version}")
# Copy all module files to /Lean/Launcher/bin/Debug, but don't overwrite anything that already exists
run_options["commands"].append("python /copy_csharp_dependencies.py /Compile/obj/ModulesProject/project.assets.json")

return bool(installed_packages)

Expand Down

0 comments on commit 1393c12

Please sign in to comment.