Fix poetry support

This commit is contained in:
allegroai 2020-01-21 16:23:36 +02:00
parent 599219b02d
commit 06897f7606
2 changed files with 2 additions and 4 deletions

View File

@ -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:

View File

@ -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"):