mirror of
				https://github.com/clearml/clearml-agent
				synced 2025-06-26 18:16:15 +00:00 
			
		
		
		
	Support poetry when agent is installed inside virtualenv
This commit is contained in:
		
							parent
							
								
									eb012f5c24
								
							
						
					
					
						commit
						ae2775f7b8
					
				| @ -1,7 +1,9 @@ | ||||
| from copy import deepcopy | ||||
| from functools import wraps | ||||
| 
 | ||||
| import attr | ||||
| import sys | ||||
| import os | ||||
| from pathlib2 import Path | ||||
| from trains_agent.helper.process import Argv, DEVNULL, check_if_command_exists | ||||
| from trains_agent.session import Session, POETRY | ||||
| @ -56,6 +58,9 @@ class PoetryConfig: | ||||
|     def run(self, *args, **kwargs): | ||||
|         func = kwargs.pop("func", Argv.get_output) | ||||
|         kwargs.setdefault("stdin", DEVNULL) | ||||
|         kwargs['env'] = deepcopy(os.environ) | ||||
|         kwargs['env'].pop('VIRTUAL_ENV', None) | ||||
|         kwargs['env'].pop('CONDA_PREFIX', None) | ||||
|         if check_if_command_exists("poetry"): | ||||
|             argv = Argv("poetry", *args) | ||||
|         else: | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 allegroai
						allegroai