Fix poetry support (issue #57)

This commit is contained in:
allegroai 2021-04-14 11:22:07 +03:00
parent 948fc4c6ce
commit 60a58f6fad

View File

@ -2242,6 +2242,9 @@ class Worker(ServiceCommandSection):
except Exception:
requirements = freeze
# disable caching with poetry because we cannot make it install into a specific folder
# Todo: add support for poetry caching
if not self.poetry.enabled:
# add to cache
print('Adding venv into cache: {}'.format(add_venv_folder_cache))
if add_venv_folder_cache:
@ -2310,7 +2313,11 @@ class Worker(ServiceCommandSection):
package_api.cwd = cwd
api = self._install_poetry_requirements(repo_info)
if api:
package_api = api
# update back the package manager, this hack should be fixed
if package_api == self.package_api:
self.package_api = api
elif package_api == self.global_package_api:
self.global_package_api = api
return
package_api.upgrade_pip()