mirror of
				https://github.com/open-webui/open-webui
				synced 2025-06-26 18:26:48 +00:00 
			
		
		
		
	Merge pull request #11611 from nikes/feat/pip-options
feat: pip options in tools/functions install requirements
This commit is contained in:
		
						commit
						0551b90d47
					
				| @ -448,3 +448,10 @@ OTEL_RESOURCE_ATTRIBUTES = os.environ.get( | ||||
| OTEL_TRACES_SAMPLER = os.environ.get( | ||||
|     "OTEL_TRACES_SAMPLER", "parentbased_always_on" | ||||
| ).lower() | ||||
| 
 | ||||
| #################################### | ||||
| # TOOLS/FUNCTIONS PIP OPTIONS | ||||
| #################################### | ||||
| 
 | ||||
| PIP_OPTIONS = os.getenv("PIP_OPTIONS", "").split() | ||||
| PIP_PACKAGE_INDEX_OPTIONS = os.getenv("PIP_PACKAGE_INDEX_OPTIONS", "").split() | ||||
|  | ||||
| @ -7,7 +7,7 @@ import types | ||||
| import tempfile | ||||
| import logging | ||||
| 
 | ||||
| from open_webui.env import SRC_LOG_LEVELS | ||||
| from open_webui.env import SRC_LOG_LEVELS, PIP_OPTIONS, PIP_PACKAGE_INDEX_OPTIONS | ||||
| from open_webui.models.functions import Functions | ||||
| from open_webui.models.tools import Tools | ||||
| 
 | ||||
| @ -170,7 +170,7 @@ def install_frontmatter_requirements(requirements: str): | ||||
|         try: | ||||
|             req_list = [req.strip() for req in requirements.split(",")] | ||||
|             log.info(f"Installing requirements: {' '.join(req_list)}") | ||||
|             subprocess.check_call([sys.executable, "-m", "pip", "install"] + req_list) | ||||
|             subprocess.check_call([sys.executable, "-m", "pip", "install"] + PIP_OPTIONS + req_list + PIP_PACKAGE_INDEX_OPTIONS) | ||||
|         except Exception as e: | ||||
|             log.error(f"Error installing packages: {' '.join(req_list)}") | ||||
|             raise e | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user