Skip to content

Commit 313c2c3

Browse files
committed
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.
1 parent a99f269 commit 313c2c3

File tree

4 files changed

+3
-7
lines changed

4 files changed

+3
-7
lines changed

gcloud/logging/_gax.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import json
1818

19-
# pylint: disable=import-error
2019
from google.gax import CallOptions
2120
from google.gax import INITIAL_PAGE
2221
from google.gax.errors import GaxError
@@ -27,7 +26,6 @@
2726
from google.logging.v2.log_entry_pb2 import LogEntry
2827
from google.protobuf.json_format import Parse
2928
from grpc.beta.interfaces import StatusCode
30-
# pylint: enable=import-error
3129

3230
from gcloud.exceptions import Conflict
3331
from gcloud.exceptions import NotFound

gcloud/pubsub/_gax.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,13 @@
1414

1515
"""GAX wrapper for Pubsub API requests."""
1616

17-
# pylint: disable=import-error
1817
from google.gax import CallOptions
1918
from google.gax import INITIAL_PAGE
2019
from google.gax.errors import GaxError
2120
from google.gax.grpc import exc_to_code
2221
from google.pubsub.v1.pubsub_pb2 import PubsubMessage
2322
from google.pubsub.v1.pubsub_pb2 import PushConfig
2423
from grpc.beta.interfaces import StatusCode
25-
# pylint: enable=import-error
2624

2725
from gcloud.exceptions import Conflict
2826
from gcloud.exceptions import NotFound

scripts/pylintrc_default

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ load-plugins=pylint.extensions.check_docs
7777
# return int(value)
7878
# else:
7979
# return float(value)
80+
# - import-error: imports are checked via tests.
8081
# - wrong-import-position: This error is overzealous. It assumes imports are
8182
# completed whenever something non-trivial is
8283
# defined, e.g.
@@ -100,6 +101,7 @@ disable =
100101
similarities,
101102
star-args,
102103
redefined-variable-type,
104+
import-error,
103105
wrong-import-position,
104106
no-name-in-module,
105107
missing-raises-doc,

tox.ini

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,9 @@ commands =
143143
python {toxinidir}/scripts/pycodestyle_on_repo.py
144144
python {toxinidir}/scripts/run_pylint.py
145145
deps =
146-
{[testing]deps}
146+
{[testenv]deps}
147147
pycodestyle
148148
pylint >= 1.6.4
149-
setenv =
150-
PYTHONPATH = {toxinidir}/_testing
151149
passenv = {[testenv:system-tests]passenv}
152150

153151
[testenv:system-tests]

0 commit comments

Comments
 (0)