mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-08 15:28:26 +01:00
remote: print which dependencies we are missing
Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+7
-4
@@ -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
@@ -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
@@ -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
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user