diff --git a/dvc/remote/base.py b/dvc/remote/base.py index 13f9c695b..86b8c1d34 100644 --- a/dvc/remote/base.py +++ b/dvc/remote/base.py @@ -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 diff --git a/dvc/remote/gs.py b/dvc/remote/gs.py index 0ae7ee3b7..602a56388 100644 --- a/dvc/remote/gs.py +++ b/dvc/remote/gs.py @@ -20,7 +20,7 @@ from dvc.progress import progress class RemoteGS(RemoteBase): scheme = 'gs' REGEX = r'^gs://(?P.*)$' - REQUIRES = RemoteBase.REQUIRES + [storage] + REQUIRES = {'google.cloud.storage': storage} PARAM_ETAG = 'etag' def __init__(self, project, config): diff --git a/dvc/remote/s3.py b/dvc/remote/s3.py index 2d1416295..54eeebf20 100644 --- a/dvc/remote/s3.py +++ b/dvc/remote/s3.py @@ -35,7 +35,7 @@ class Callback(object): class RemoteS3(RemoteBase): scheme = 's3' REGEX = r'^s3://(?P.*)$' - REQUIRES = RemoteBase.REQUIRES + [boto3] + REQUIRES = {'boto3': boto3} PARAM_ETAG = 'etag' def __init__(self, project, config): diff --git a/dvc/remote/ssh.py b/dvc/remote/ssh.py index 211aa54d1..2944c0736 100644 --- a/dvc/remote/ssh.py +++ b/dvc/remote/ssh.py @@ -45,7 +45,7 @@ class RemoteSSH(RemoteBase): #NOTE: temporarily only absolute paths are allowed REGEX = r'^ssh://((?P.*)@)?(?P[^/]*):(?P/.*)$' - REQUIRES = RemoteBase.REQUIRES + [paramiko] + REQUIRES = {'paramiko': paramiko} PARAM_MD5 = 'md5' def __init__(self, project, config):