diff --git a/clearml_agent/external/requirements_parser/parser.py b/clearml_agent/external/requirements_parser/parser.py index 77f0088..2864040 100644 --- a/clearml_agent/external/requirements_parser/parser.py +++ b/clearml_agent/external/requirements_parser/parser.py @@ -1,4 +1,5 @@ import os +import re import warnings from clearml_agent.definitions import PIP_EXTRA_INDICES @@ -44,10 +45,12 @@ def parse(reqstr, cwd=None): yield requirement elif line.startswith('-f') or line.startswith('--find-links') or \ line.startswith('-i') or line.startswith('--index-url') or \ - line.startswith('--extra-index-url') or \ line.startswith('--no-index'): - _, extra_index = line.split() - if extra_index not in PIP_EXTRA_INDICES: + warnings.warn('Private repos not supported. Skipping.') + elif line.startswith('--extra-index-url'): + extra_index = line[len('--extra-index-url'):].strip() + extra_index = re.sub(r"\s+#.*$", "", extra_index) # strip comments + if extra_index and 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