From 313c2c3a51e6590e7ceafdbf8b2bd10712c2bb58 Mon Sep 17 00:00:00 2001 From: Tres Seaver Date: Thu, 11 Aug 2016 17:36:48 -0400 Subject: [PATCH] Install 'grpc' deps for 'lint'; suppress 'pylint' import checks. Rationale: pylint tries to guess at imports in the 'google' namespace, and fails miserably. We test that those imports are valid all the time in unit tests anyway, so just disable them in pylint. --- gcloud/logging/_gax.py | 2 -- gcloud/pubsub/_gax.py | 2 -- scripts/pylintrc_default | 2 ++ tox.ini | 4 +--- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gcloud/logging/_gax.py b/gcloud/logging/_gax.py index b4be46e68879..b0f87153b2e4 100644 --- a/gcloud/logging/_gax.py +++ b/gcloud/logging/_gax.py @@ -16,7 +16,6 @@ import json -# pylint: disable=import-error from google.gax import CallOptions from google.gax import INITIAL_PAGE from google.gax.errors import GaxError @@ -27,7 +26,6 @@ from google.logging.v2.log_entry_pb2 import LogEntry from google.protobuf.json_format import Parse from grpc.beta.interfaces import StatusCode -# pylint: enable=import-error from gcloud.exceptions import Conflict from gcloud.exceptions import NotFound diff --git a/gcloud/pubsub/_gax.py b/gcloud/pubsub/_gax.py index 9f9e8ef7eee6..b56e6bf9a602 100644 --- a/gcloud/pubsub/_gax.py +++ b/gcloud/pubsub/_gax.py @@ -14,7 +14,6 @@ """GAX wrapper for Pubsub API requests.""" -# pylint: disable=import-error from google.gax import CallOptions from google.gax import INITIAL_PAGE from google.gax.errors import GaxError @@ -22,7 +21,6 @@ from google.pubsub.v1.pubsub_pb2 import PubsubMessage from google.pubsub.v1.pubsub_pb2 import PushConfig from grpc.beta.interfaces import StatusCode -# pylint: enable=import-error from gcloud.exceptions import Conflict from gcloud.exceptions import NotFound diff --git a/scripts/pylintrc_default b/scripts/pylintrc_default index df64b2784a50..b42b776992b4 100644 --- a/scripts/pylintrc_default +++ b/scripts/pylintrc_default @@ -77,6 +77,7 @@ load-plugins=pylint.extensions.check_docs # return int(value) # else: # return float(value) +# - import-error: imports are checked via tests. # - wrong-import-position: This error is overzealous. It assumes imports are # completed whenever something non-trivial is # defined, e.g. @@ -100,6 +101,7 @@ disable = similarities, star-args, redefined-variable-type, + import-error, wrong-import-position, no-name-in-module, missing-raises-doc, diff --git a/tox.ini b/tox.ini index ae7245686e6b..040c3835a5bc 100644 --- a/tox.ini +++ b/tox.ini @@ -143,11 +143,9 @@ commands = python {toxinidir}/scripts/pycodestyle_on_repo.py python {toxinidir}/scripts/run_pylint.py deps = - {[testing]deps} + {[testenv]deps} pycodestyle pylint >= 1.6.4 -setenv = - PYTHONPATH = {toxinidir}/_testing passenv = {[testenv:system-tests]passenv} [testenv:system-tests]