From 9c257858ddc58c72f193fde14519a0b38e81f8b1 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 23 Feb 2021 18:54:38 +0200 Subject: [PATCH] Fix venv cache support for local folders --- clearml_agent/commands/worker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clearml_agent/commands/worker.py b/clearml_agent/commands/worker.py index 4a838c6..a53775a 100644 --- a/clearml_agent/commands/worker.py +++ b/clearml_agent/commands/worker.py @@ -1742,11 +1742,14 @@ class Worker(ServiceCommandSection): base_interpreter=package_api.requirements_manager.get_interpreter(), requirement_substitutions=[OnlyExternalRequirements] ) + package_api.cwd = vcs.location if vcs and vcs.location else directory # make sure we run the handlers cached_requirements = \ {k: package_api.requirements_manager.replace(requirements[k] or '') for k in requirements} - package_api.load_requirements(cached_requirements) + if str(cached_requirements.get('pip', '')).strip() \ + or str(cached_requirements.get('conda', '')).strip(): + package_api.load_requirements(cached_requirements) elif not is_cached and not standalone_mode: self.install_requirements(