From 77d8a6909c364c7caf0dc88ecbb74c8a90d19a27 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 6 May 2022 10:24:57 -0400 Subject: [PATCH] chore: remove unused imports (#1790) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: remove unused imports * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- apiclient/__init__.py | 1 - describe.py | 2 +- googleapiclient/discovery_cache/__init__.py | 3 --- googleapiclient/discovery_cache/file_cache.py | 1 - samples/adexchangeseller/get_all_alerts.py | 1 - samples/adexchangeseller/get_all_dimensions.py | 1 - samples/adexchangeseller/get_all_metrics.py | 1 - samples/adexchangeseller/get_all_preferred_deals.py | 1 - samples/analytics/hello_analytics_api_v3.py | 1 - samples/analytics/management_v3_reference.py | 1 - samples/appengine/main.py | 2 -- samples/storage_serviceaccount_appengine/main.py | 4 ---- scripts/buildprbody.py | 1 - scripts/buildprbody_test.py | 2 -- tests/test_discovery.py | 2 -- tests/test_discovery_cache.py | 1 - 16 files changed, 1 insertion(+), 24 deletions(-) diff --git a/apiclient/__init__.py b/apiclient/__init__.py index 0af0d776602..e7f205af3d7 100644 --- a/apiclient/__init__.py +++ b/apiclient/__init__.py @@ -1,6 +1,5 @@ """Retain apiclient as an alias for googleapiclient.""" -import googleapiclient from googleapiclient import channel, discovery, errors, http, mimeparse, model try: diff --git a/describe.py b/describe.py index 506e251dd04..e5ca214ecec 100755 --- a/describe.py +++ b/describe.py @@ -34,7 +34,7 @@ import uritemplate -from googleapiclient.discovery import DISCOVERY_URI, build, build_from_document +from googleapiclient.discovery import DISCOVERY_URI, build_from_document from googleapiclient.http import build_http DISCOVERY_DOC_DIR = ( diff --git a/googleapiclient/discovery_cache/__init__.py b/googleapiclient/discovery_cache/__init__.py index a2771cd7e5b..36e5879a2e1 100644 --- a/googleapiclient/discovery_cache/__init__.py +++ b/googleapiclient/discovery_cache/__init__.py @@ -16,7 +16,6 @@ from __future__ import absolute_import -import datetime import logging import os @@ -37,8 +36,6 @@ def autodetect(): """ if "APPENGINE_RUNTIME" in os.environ: try: - from google.appengine.api import memcache - from . import appengine_memcache return appengine_memcache.cache diff --git a/googleapiclient/discovery_cache/file_cache.py b/googleapiclient/discovery_cache/file_cache.py index 84d24c18dcf..3bdf93a87df 100644 --- a/googleapiclient/discovery_cache/file_cache.py +++ b/googleapiclient/discovery_cache/file_cache.py @@ -27,7 +27,6 @@ import logging import os import tempfile -import threading try: from oauth2client.contrib.locked_file import LockedFile diff --git a/samples/adexchangeseller/get_all_alerts.py b/samples/adexchangeseller/get_all_alerts.py index f15ef51f5d9..742ff676bb4 100644 --- a/samples/adexchangeseller/get_all_alerts.py +++ b/samples/adexchangeseller/get_all_alerts.py @@ -22,7 +22,6 @@ __author__ = 'sgomes@google.com (Sérgio Gomes)' -import argparse import sys from googleapiclient import sample_tools diff --git a/samples/adexchangeseller/get_all_dimensions.py b/samples/adexchangeseller/get_all_dimensions.py index 0c6bec74527..fad8dfaad7e 100644 --- a/samples/adexchangeseller/get_all_dimensions.py +++ b/samples/adexchangeseller/get_all_dimensions.py @@ -22,7 +22,6 @@ __author__ = 'sgomes@google.com (Sérgio Gomes)' -import argparse import sys from googleapiclient import sample_tools diff --git a/samples/adexchangeseller/get_all_metrics.py b/samples/adexchangeseller/get_all_metrics.py index 0f2df2276c9..56807bef033 100644 --- a/samples/adexchangeseller/get_all_metrics.py +++ b/samples/adexchangeseller/get_all_metrics.py @@ -22,7 +22,6 @@ __author__ = 'sgomes@google.com (Sérgio Gomes)' -import argparse import sys from googleapiclient import sample_tools diff --git a/samples/adexchangeseller/get_all_preferred_deals.py b/samples/adexchangeseller/get_all_preferred_deals.py index 3ef38a4a3d3..c2b64ab56c7 100644 --- a/samples/adexchangeseller/get_all_preferred_deals.py +++ b/samples/adexchangeseller/get_all_preferred_deals.py @@ -22,7 +22,6 @@ __author__ = 'sgomes@google.com (Sérgio Gomes)' -import argparse import sys from googleapiclient import sample_tools diff --git a/samples/analytics/hello_analytics_api_v3.py b/samples/analytics/hello_analytics_api_v3.py index 783594f1d3f..078c4d2871c 100755 --- a/samples/analytics/hello_analytics_api_v3.py +++ b/samples/analytics/hello_analytics_api_v3.py @@ -44,7 +44,6 @@ __author__ = 'api.nickm@gmail.com (Nick Mihailovski)' -import argparse import sys from googleapiclient.errors import HttpError diff --git a/samples/analytics/management_v3_reference.py b/samples/analytics/management_v3_reference.py index afd07fc4da2..d0330d952a0 100755 --- a/samples/analytics/management_v3_reference.py +++ b/samples/analytics/management_v3_reference.py @@ -54,7 +54,6 @@ __author__ = 'api.nickm@gmail.com (Nick Mihailovski)' -import argparse import sys from googleapiclient.errors import HttpError diff --git a/samples/appengine/main.py b/samples/appengine/main.py index d2a3223a7f4..4ee27b4abbc 100644 --- a/samples/appengine/main.py +++ b/samples/appengine/main.py @@ -26,9 +26,7 @@ import httplib2 -import logging import os -import pickle from googleapiclient import discovery from oauth2client import client diff --git a/samples/storage_serviceaccount_appengine/main.py b/samples/storage_serviceaccount_appengine/main.py index 21ec3f838e4..663a2ccaa9b 100644 --- a/samples/storage_serviceaccount_appengine/main.py +++ b/samples/storage_serviceaccount_appengine/main.py @@ -36,14 +36,10 @@ __author__ = 'marccohen@google.com (Marc Cohen)' import httplib2 -import logging -import os -import pickle import re from google.appengine.api import memcache from google.appengine.ext import webapp -from google.appengine.ext.webapp import template from google.appengine.ext.webapp.util import run_wsgi_app from oauth2client.contrib.appengine import AppAssertionCredentials diff --git a/scripts/buildprbody.py b/scripts/buildprbody.py index b205287b04e..d70f23b6de1 100644 --- a/scripts/buildprbody.py +++ b/scripts/buildprbody.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from enum import IntEnum import pathlib from changesummary import ChangeType diff --git a/scripts/buildprbody_test.py b/scripts/buildprbody_test.py index 3cc0ba5840e..6f6d70b0834 100644 --- a/scripts/buildprbody_test.py +++ b/scripts/buildprbody_test.py @@ -17,11 +17,9 @@ __author__ = "partheniou@google.com (Anthonios Partheniou)" import pathlib -import shutil import unittest from buildprbody import BuildPrBody -from changesummary import ChangeType SCRIPTS_DIR = pathlib.Path(__file__).parent.resolve() CHANGE_SUMMARY_DIR = SCRIPTS_DIR / "test_resources" / "buildprbody_resources" diff --git a/tests/test_discovery.py b/tests/test_discovery.py index 63d1a71b0c0..36a0d524f26 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -40,7 +40,6 @@ import google.api_core.exceptions import google.auth.credentials from google.auth.exceptions import MutualTLSChannelError -from google.auth.transport import mtls import google_auth_httplib2 import httplib2 import mock @@ -79,7 +78,6 @@ UnknownFileType, ) from googleapiclient.http import ( - BatchHttpRequest, HttpMock, HttpMockSequence, MediaFileUpload, diff --git a/tests/test_discovery_cache.py b/tests/test_discovery_cache.py index cd533187307..d9b43470b27 100644 --- a/tests/test_discovery_cache.py +++ b/tests/test_discovery_cache.py @@ -23,7 +23,6 @@ import mock from googleapiclient.discovery_cache import DISCOVERY_DOC_MAX_AGE -from googleapiclient.discovery_cache.base import Cache try: from googleapiclient.discovery_cache.file_cache import Cache as FileCache