From 06897f7606877c4044430433fa3fc9f722f525b3 Mon Sep 17 00:00:00 2001 From: allegroai <> Date: Tue, 21 Jan 2020 16:23:36 +0200 Subject: [PATCH] Fix poetry support --- trains_agent/commands/worker.py | 3 ++- trains_agent/helper/package/pytorch.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/trains_agent/commands/worker.py b/trains_agent/commands/worker.py index 9c0dd82..8550153 100644 --- a/trains_agent/commands/worker.py +++ b/trains_agent/commands/worker.py @@ -1164,7 +1164,7 @@ class Worker(ServiceCommandSection): sys.stdout.flush() sys.stderr.flush() os.chdir(script_dir) - if not is_windows_platform(): + if not is_windows_platform() and not isinstance(self.package_api, PoetryAPI): os.execv(command.argv[0].as_posix(), tuple([command.argv[0].as_posix()])+command.argv[1:]) else: exit_code = command.check_call(cwd=script_dir) @@ -1414,6 +1414,7 @@ class Worker(ServiceCommandSection): self.poetry.initialize(cwd=repo_info.root) api = self.poetry.get_api(repo_info.root) if api.enabled: + print('Poetry Enabled: Ignoring requested python packages, using repository poetry lock file!') api.install() return api except Exception: diff --git a/trains_agent/helper/package/pytorch.py b/trains_agent/helper/package/pytorch.py index b6b6e1c..22dcdda 100644 --- a/trains_agent/helper/package/pytorch.py +++ b/trains_agent/helper/package/pytorch.py @@ -249,9 +249,6 @@ class PytorchRequirement(SimpleSubstitution): return url def get_url_for_platform(self, req): - assert self.package_manager == "pip" - assert self.os != "mac" - # check if package is already installed with system packages try: if self.config.get("agent.package_manager.system_site_packages"):