Skip to content

Commit 768d667

Browse files
author
Jon Wayne Parrott
committed
Revert "Fix pylint for the main package" - accidental push
This reverts commit d0479d6.
1 parent d0479d6 commit 768d667

File tree

12 files changed

+17
-33
lines changed

12 files changed

+17
-33
lines changed

core/.flake8

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
[flake8]
2-
import-order-style=google
32
exclude =
43
__pycache__,
54
.git,

core/google/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Google namespace package."""
16-
1715
try:
1816
import pkg_resources
1917
pkg_resources.declare_namespace(__name__)

core/google/cloud/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Google Cloud namespace package."""
16-
1715
try:
1816
import pkg_resources
1917
pkg_resources.declare_namespace(__name__)

core/google/cloud/_helpers.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
This module is not part of the public API surface.
1818
"""
1919

20+
# Avoid the grpc and google.cloud.grpc collision.
2021
from __future__ import absolute_import
2122

2223
import calendar
@@ -31,8 +32,6 @@
3132
import google_auth_httplib2
3233

3334
try:
34-
# pylint: disable=ungrouped-imports
35-
# We must import google.auth.transport.grpc within this try: catch.
3635
import grpc
3736
import google.auth.transport.grpc
3837
except ImportError: # pragma: NO COVER
@@ -105,7 +104,7 @@ def top(self):
105104
:rtype: object
106105
:returns: the top-most item, or None if the stack is empty.
107106
"""
108-
if self._stack:
107+
if len(self._stack) > 0:
109108
return self._stack[-1]
110109

111110

core/google/cloud/_http.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,7 @@ def api_request(self, method, path, query_params=None,
279279
can allow custom behavior, for example, to defer an HTTP request
280280
and complete initialization of the object at a later time.
281281
282-
:raises ~google.cloud.exceptions.GoogleCloudError: if the response code
283-
is not 200 OK.
284-
:raises TypeError: if the response content type is not JSON.
282+
:raises: Exception if the response code is not 200 OK.
285283
:rtype: dict or str
286284
:returns: The API response payload, either as a raw string or
287285
a dictionary if the response is valid JSON.

core/google/cloud/_testing.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,17 @@
1414

1515
"""Shared testing utilities."""
1616

17+
18+
# Avoid the grpc and google.cloud.grpc collision.
1719
from __future__ import absolute_import
1820

1921

2022
class _Monkey(object):
21-
"""Context-manager for replacing module names in the scope of a test."""
23+
# context-manager for replacing module names in the scope of a test.
2224

2325
def __init__(self, module, **kw):
2426
self.module = module
25-
if not kw: # pragma: NO COVER
27+
if len(kw) == 0: # pragma: NO COVER
2628
raise ValueError('_Monkey was used with nothing to monkey-patch')
2729
self.to_restore = {key: getattr(module, key) for key in kw}
2830
for key, value in kw.items():
@@ -66,12 +68,8 @@ def _tempdir_mgr():
6668
return _tempdir_mgr
6769

6870

69-
# pylint: disable=invalid-name
70-
# Retain _tempdir as a constant for backwards compatibility despite
71-
# being an invalid name.
7271
_tempdir = _tempdir_maker()
7372
del _tempdir_maker
74-
# pylint: enable=invalid-name
7573

7674

7775
class _GAXBaseAPI(object):
@@ -81,8 +79,7 @@ class _GAXBaseAPI(object):
8179
def __init__(self, **kw):
8280
self.__dict__.update(kw)
8381

84-
@staticmethod
85-
def _make_grpc_error(status_code, trailing=None):
82+
def _make_grpc_error(self, status_code, trailing=None):
8683
from grpc._channel import _RPCState
8784
from google.cloud.exceptions import GrpcRendezvous
8885

@@ -114,7 +111,6 @@ def __init__(self, *pages, **kwargs):
114111
self.page_token = kwargs.get('page_token')
115112

116113
def next(self):
117-
"""Iterate to the next page."""
118114
import six
119115
return six.next(self._pages)
120116

core/google/cloud/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def from_service_account_json(cls, json_credentials_path, *args, **kwargs):
6464
6565
:rtype: :class:`_ClientFactoryMixin`
6666
:returns: The client created with the retrieved JSON credentials.
67-
:raises TypeError: if there is a conflict with the kwargs
67+
:raises: :class:`TypeError` if there is a conflict with the kwargs
6868
and the credentials created by the factory.
6969
"""
7070
if 'credentials' in kwargs:

core/google/cloud/future/operation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class Operation(base.PollingFuture):
3434
initial operation.
3535
refresh (Callable[[], Operation]): A callable that returns the
3636
latest state of the operation.
37-
cancel (Callable[[], None]): A callable that tries to cancel
37+
cancel (Callable[[], None]), A callable that tries to cancel
3838
the operation.
3939
result_type (type): The protobuf type for the operation's result.
4040
metadata_type (type): The protobuf type for the operation's

core/google/cloud/iam.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,14 @@ def to_api_repr(self):
226226
if self.version is not None:
227227
resource['version'] = self.version
228228

229-
if self._bindings:
229+
if len(self._bindings) > 0:
230230
bindings = resource['bindings'] = []
231231
for role, members in sorted(self._bindings.items()):
232-
if members:
232+
if len(members) > 0:
233233
bindings.append(
234234
{'role': role, 'members': sorted(set(members))})
235235

236-
if not bindings:
236+
if len(bindings) == 0:
237237
del resource['bindings']
238238

239239
return resource

core/google/cloud/iterator.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,7 @@ def _page_iter(self, increment):
242242
results per page while an items iterator will want
243243
to increment per item.
244244
245-
:rtype: :class:`Page`
246-
:returns: pages
245+
Yields :class:`Page` instances.
247246
"""
248247
page = self._next_page()
249248
while page is not None:
@@ -388,8 +387,6 @@ def _get_next_page_response(self):
388387
389388
:rtype: dict
390389
:returns: The parsed JSON response of the next page's contents.
391-
392-
:raises ValueError: If the HTTP method is not ``GET`` or ``POST``.
393390
"""
394391
params = self._get_query_params()
395392
if self._HTTP_METHOD == 'GET':

0 commit comments

Comments
 (0)