Support private repos from requirements.txt file (#107)

* support private repos
* fix double indices
This commit is contained in:
Niels ten Boom 2022-06-15 09:26:24 +02:00 committed by GitHub
parent 178af0dee8
commit 24177cc5a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,8 @@
import os import os
import warnings import warnings
from clearml_agent.definitions import PIP_EXTRA_INDICES
from .requirement import Requirement from .requirement import Requirement
@ -44,7 +46,10 @@ def parse(reqstr, cwd=None):
line.startswith('-i') or line.startswith('--index-url') or \ line.startswith('-i') or line.startswith('--index-url') or \
line.startswith('--extra-index-url') or \ line.startswith('--extra-index-url') or \
line.startswith('--no-index'): 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 continue
elif line.startswith('-Z') or line.startswith('--always-unzip'): elif line.startswith('-Z') or line.startswith('--always-unzip'):
warnings.warn('Unused option --always-unzip. Skipping.') warnings.warn('Unused option --always-unzip. Skipping.')