mirror of
https://github.com/clearml/clearml-agent
synced 2025-02-12 07:38:04 +00:00
Fix additional poetry cwd support feature
This commit is contained in:
parent
667c2ced3d
commit
787c7d88bb
@ -2939,10 +2939,15 @@ class Worker(ServiceCommandSection):
|
|||||||
self.log_traceback(e)
|
self.log_traceback(e)
|
||||||
return freeze
|
return freeze
|
||||||
|
|
||||||
def _install_poetry_requirements(self, repo_info, lockfile_path):
|
def _install_poetry_requirements(self, repo_info, working_dir=None):
|
||||||
# type: (Optional[RepoInfo], Path) -> Optional[PoetryAPI]
|
# type: (Optional[RepoInfo], Optional[str]) -> Optional[PoetryAPI]
|
||||||
if not repo_info:
|
if not repo_info:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
files_from_working_dir = self._session.config.get(
|
||||||
|
"agent.package_manager.poetry_files_from_repo_working_dir", False)
|
||||||
|
lockfile_path = Path(repo_info.root) / ((working_dir or "") if files_from_working_dir else "")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if not self.poetry.enabled:
|
if not self.poetry.enabled:
|
||||||
return None
|
return None
|
||||||
@ -2986,9 +2991,7 @@ class Worker(ServiceCommandSection):
|
|||||||
if package_api:
|
if package_api:
|
||||||
package_api.cwd = cwd
|
package_api.cwd = cwd
|
||||||
|
|
||||||
files_from_working_dir = package_api.session.config.get("agent.package_manager.poetry_files_from_repo_working_dir", False)
|
api = self._install_poetry_requirements(repo_info, execution.working_dir)
|
||||||
lockfile_path = Path(repo_info.root) / (execution.working_dir if files_from_working_dir else "")
|
|
||||||
api = self._install_poetry_requirements(repo_info, lockfile_path)
|
|
||||||
if api:
|
if api:
|
||||||
# update back the package manager, this hack should be fixed
|
# update back the package manager, this hack should be fixed
|
||||||
if package_api == self.package_api:
|
if package_api == self.package_api:
|
||||||
|
Loading…
Reference in New Issue
Block a user