From 24177cc5a9ad77a25270a74d299426a55daea914 Mon Sep 17 00:00:00 2001 From: Niels ten Boom Date: Wed, 15 Jun 2022 09:26:24 +0200 Subject: [PATCH] Support private repos from requirements.txt file (#107) * support private repos * fix double indices --- clearml_agent/external/requirements_parser/parser.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/clearml_agent/external/requirements_parser/parser.py b/clearml_agent/external/requirements_parser/parser.py index cd1d7b1..77f0088 100644 --- a/clearml_agent/external/requirements_parser/parser.py +++ b/clearml_agent/external/requirements_parser/parser.py @@ -1,6 +1,8 @@ import os import warnings +from clearml_agent.definitions import PIP_EXTRA_INDICES + from .requirement import Requirement @@ -44,7 +46,10 @@ def parse(reqstr, cwd=None): line.startswith('-i') or line.startswith('--index-url') or \ line.startswith('--extra-index-url') or \ line.startswith('--no-index'): - warnings.warn('Private repos not supported. Skipping.') + _, extra_index = line.split() + if extra_index not in PIP_EXTRA_INDICES: + PIP_EXTRA_INDICES.append(extra_index) + print(f"appended {extra_index} to list of extra pip indices") continue elif line.startswith('-Z') or line.startswith('--always-unzip'): warnings.warn('Unused option --always-unzip. Skipping.')