From 88cb57637426546bcde2a59d69dda38fbdc7cd25 Mon Sep 17 00:00:00 2001 From: Eric Wolak Date: Mon, 4 Jun 2018 11:11:17 -0700 Subject: [PATCH] Make apiclient.sample_tools optional It depends heavily on oauth2client, which has been dropped as a required dependency --- apiclient/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apiclient/__init__.py b/apiclient/__init__.py index 62800d61407..41828dd2157 100644 --- a/apiclient/__init__.py +++ b/apiclient/__init__.py @@ -10,7 +10,12 @@ from googleapiclient import http from googleapiclient import mimeparse from googleapiclient import model -from googleapiclient import sample_tools +try: + from googleapiclient import sample_tools +except ImportError: + # Silently ignore, because the vast majority of consumers won't use it and + # it has deep dependence on oauth2client, an optional dependency. + sample_tools = None from googleapiclient import schema __version__ = googleapiclient.__version__