Fix version control links in requirements when using conda

This commit is contained in:
allegroai 2020-05-09 19:52:51 +03:00
parent abb30ac2b8
commit 6ce9cf7c2a

View File

@ -262,6 +262,7 @@ class CondaAPI(PackageManager):
# this should happen if experiment was executed on non-conda machine or old trains client # this should happen if experiment was executed on non-conda machine or old trains client
conda_supported_req = requirements['pip'] if requirements.get('conda', None) is None else requirements['conda'] conda_supported_req = requirements['pip'] if requirements.get('conda', None) is None else requirements['conda']
conda_supported_req_names = [] conda_supported_req_names = []
pip_requirements = []
for r in conda_supported_req: for r in conda_supported_req:
try: try:
marker = list(parse(r)) marker = list(parse(r))
@ -271,6 +272,10 @@ class CondaAPI(PackageManager):
continue continue
m = MarkerRequirement(marker[0]) m = MarkerRequirement(marker[0])
# conda does not support version control links
if m.vcs:
pip_requirements.append(m)
continue
conda_supported_req_names.append(m.name.lower()) conda_supported_req_names.append(m.name.lower())
if m.req.name.lower() == 'matplotlib': if m.req.name.lower() == 'matplotlib':
has_matplotlib = True has_matplotlib = True
@ -287,7 +292,6 @@ class CondaAPI(PackageManager):
reqs.append(m) reqs.append(m)
pip_requirements = []
# if we have a conda list, the rest should be installed with pip, # if we have a conda list, the rest should be installed with pip,
if requirements.get('conda', None) is not None: if requirements.get('conda', None) is not None:
for r in requirements['pip']: for r in requirements['pip']: