Skip to content

Commit

Permalink
remote: implement Google Drive
Browse files Browse the repository at this point in the history
  • Loading branch information
ei-grad committed Jul 6, 2019
1 parent a4720d0 commit 6b758c6
Show file tree
Hide file tree
Showing 18 changed files with 1,191 additions and 0 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -0,0 +1 @@
include dvc/remote/gdrive/google-dvc-client-id.json
9 changes: 9 additions & 0 deletions dvc/config.py
Expand Up @@ -190,6 +190,8 @@ class Config(object): # pylint: disable=too-many-instance-attributes
)
SECTION_CORE_STORAGEPATH = "storagepath"

SECTION_CORE_OAUTH2_FLOW_RUNNER = "oauth2_flow_runner"

SECTION_CORE_SCHEMA = {
Optional(SECTION_CORE_LOGLEVEL): And(
str, Use(str.lower), SECTION_CORE_LOGLEVEL_SCHEMA
Expand All @@ -204,6 +206,7 @@ class Config(object): # pylint: disable=too-many-instance-attributes
Optional(
SECTION_CORE_CHECKSUM_JOBS, default=None
): SECTION_CORE_CHECKSUM_JOBS_SCHEMA,
Optional(SECTION_CORE_OAUTH2_FLOW_RUNNER): Choices("console", "local"),
# backward compatibility
Optional(SECTION_CORE_CLOUD, default=""): SECTION_CORE_CLOUD_SCHEMA,
Optional(SECTION_CORE_STORAGEPATH, default=""): str,
Expand Down Expand Up @@ -240,6 +243,10 @@ class Config(object): # pylint: disable=too-many-instance-attributes
Optional(SECTION_GCP_PROJECTNAME): str,
}

SECTION_GDRIVE_SCOPES = "scopes"
SECTION_GDRIVE_CREDENTIALPATH = SECTION_AWS_CREDENTIALPATH
SECTION_GDRIVE_OAUTH_ID = "oauth_id"

# backward compatibility
SECTION_LOCAL = "local"
SECTION_LOCAL_STORAGEPATH = SECTION_AWS_STORAGEPATH
Expand Down Expand Up @@ -271,6 +278,8 @@ class Config(object): # pylint: disable=too-many-instance-attributes
Optional(SECTION_AWS_USE_SSL, default=True): BOOL_SCHEMA,
Optional(SECTION_AWS_SSE): str,
Optional(SECTION_GCP_PROJECTNAME): str,
Optional(SECTION_GDRIVE_SCOPES): str,
Optional(SECTION_GDRIVE_OAUTH_ID, default="default"): str,
Optional(SECTION_CACHE_TYPE): SECTION_CACHE_TYPE_SCHEMA,
Optional(SECTION_CACHE_PROTECTED, default=False): BOOL_SCHEMA,
Optional(SECTION_REMOTE_USER): str,
Expand Down
2 changes: 2 additions & 0 deletions dvc/data_cloud.py
Expand Up @@ -8,6 +8,7 @@
from dvc.remote import Remote
from dvc.remote.s3 import RemoteS3
from dvc.remote.gs import RemoteGS
from dvc.remote.gdrive import RemoteGDrive
from dvc.remote.azure import RemoteAZURE
from dvc.remote.oss import RemoteOSS
from dvc.remote.ssh import RemoteSSH
Expand All @@ -33,6 +34,7 @@ class DataCloud(object):
CLOUD_MAP = {
"aws": RemoteS3,
"gcp": RemoteGS,
"gdrive": RemoteGDrive,
"azure": RemoteAZURE,
"oss": RemoteOSS,
"ssh": RemoteSSH,
Expand Down
2 changes: 2 additions & 0 deletions dvc/remote/__init__.py
@@ -1,6 +1,7 @@
from __future__ import unicode_literals

from dvc.remote.azure import RemoteAZURE
from dvc.remote.gdrive import RemoteGDrive
from dvc.remote.gs import RemoteGS
from dvc.remote.hdfs import RemoteHDFS
from dvc.remote.local import RemoteLOCAL
Expand All @@ -15,6 +16,7 @@

REMOTES = [
RemoteAZURE,
RemoteGDrive,
RemoteGS,
RemoteHDFS,
RemoteHTTP,
Expand Down

0 comments on commit 6b758c6

Please sign in to comment.