Skip to content

Commit

Permalink
Merge pull request #3161 from efiop/pydrive2
Browse files Browse the repository at this point in the history
dvc: use pydrive2 instead of pydrive
  • Loading branch information
efiop authored Jan 15, 2020
2 parents 0be0931 + 97a29a1 commit d2f81da
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions dvc/remote/gdrive.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class GDriveMissedCredentialKeyError(DvcException):
@decorator
def _wrap_pydrive_retriable(call):
from apiclient import errors
from pydrive.files import ApiRequestError
from pydrive2.files import ApiRequestError

try:
result = call()
Expand All @@ -61,7 +61,7 @@ def _wrap_pydrive_retriable(call):
class RemoteGDrive(RemoteBASE):
scheme = Schemes.GDRIVE
path_cls = CloudURLInfo
REQUIRES = {"pydrive": "pydrive"}
REQUIRES = {"pydrive2": "pydrive2"}
GDRIVE_USER_CREDENTIALS_DATA = "GDRIVE_USER_CREDENTIALS_DATA"
DEFAULT_USER_CREDENTIALS_FILE = "gdrive-user-credentials.json"

Expand Down Expand Up @@ -177,11 +177,11 @@ def cached_ids(self):
@property
@wrap_with(threading.RLock())
def drive(self):
from pydrive.auth import RefreshError
from pydrive2.auth import RefreshError

if not hasattr(self, "_gdrive"):
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
from pydrive2.auth import GoogleAuth
from pydrive2.drive import GoogleDrive

if os.getenv(RemoteGDrive.GDRIVE_USER_CREDENTIALS_DATA):
with open(
Expand Down Expand Up @@ -227,7 +227,7 @@ def drive(self):
self.gdrive_user_credentials_path, str(exc)
)
)
# Handle pydrive.auth.AuthenticationError and others auth failures
# Handle pydrive2.auth.AuthenticationError and others auth failures
except Exception as exc:
raise DvcException(
"Google Drive authentication failed"
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def run(self):
# google-api-python-client is internal dependency of pydrive. After merge of
# https://github.com/gsuitedevs/PyDrive/pull/180 into pydrive's master,
# usage of google-api-python-client can be removed from DVC.
gdrive = ["pydrive>=1.3.1", "google-api-python-client>=1.2"]
gdrive = ["pydrive2>=1.4.0", "google-api-python-client>=1.2"]
s3 = ["boto3>=1.9.201"]
azure = ["azure-storage-blob==2.1.0"]
oss = ["oss2==2.6.1"]
Expand Down

0 comments on commit d2f81da

Please sign in to comment.