remote: print which dependencies we are missing

Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
Ruslan Kuprieiev
2018-06-27 19:08:51 +03:00
parent d2352530fa
commit c0ede960ea
4 changed files with 10 additions and 7 deletions
+7 -4
View File
@@ -33,17 +33,20 @@ class DataCloudError(DvcException):
class RemoteBase(object):
REGEX = None
REQUIRES = []
REQUIRES = {}
def __init__(self, project, config):
pass
@classmethod
def supported(cls, config):
url_ok = cls.match(config[Config.SECTION_REMOTE_URL])
deps_ok = all(cls.REQUIRES)
url = config[Config.SECTION_REMOTE_URL]
url_ok = cls.match(url)
deps_ok = all(cls.REQUIRES.values())
if url_ok and not deps_ok:
Logger.warning("URL matches but requires missing dependencies")
missing = [k for k,v in cls.REQUIRES.items() if v == None]
msg = "URL \'{}\' is supported but requires these missing dependencies: {}"
Logger.warn(msg.format(url, str(missing)))
return url_ok and deps_ok
@classmethod
+1 -1
View File
@@ -20,7 +20,7 @@ from dvc.progress import progress
class RemoteGS(RemoteBase):
scheme = 'gs'
REGEX = r'^gs://(?P<path>.*)$'
REQUIRES = RemoteBase.REQUIRES + [storage]
REQUIRES = {'google.cloud.storage': storage}
PARAM_ETAG = 'etag'
def __init__(self, project, config):
+1 -1
View File
@@ -35,7 +35,7 @@ class Callback(object):
class RemoteS3(RemoteBase):
scheme = 's3'
REGEX = r'^s3://(?P<path>.*)$'
REQUIRES = RemoteBase.REQUIRES + [boto3]
REQUIRES = {'boto3': boto3}
PARAM_ETAG = 'etag'
def __init__(self, project, config):
+1 -1
View File
@@ -45,7 +45,7 @@ class RemoteSSH(RemoteBase):
#NOTE: temporarily only absolute paths are allowed
REGEX = r'^ssh://((?P<user>.*)@)?(?P<host>[^/]*):(?P<path>/.*)$'
REQUIRES = RemoteBase.REQUIRES + [paramiko]
REQUIRES = {'paramiko': paramiko}
PARAM_MD5 = 'md5'
def __init__(self, project, config):