Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,7 @@ tests/data/user-key.json

# PyCharm configuration:
.idea

# Generated files
pylintrc
pylintrc.test
71 changes: 71 additions & 0 deletions pylint.config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Copyright 2016 Google Inc.

This comment was marked as spam.

This comment was marked as spam.

#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""This module is used to config gcp-devrel-py-tools run-pylint."""

import copy

library_additions = {
'MESSAGES CONTROL': {
'disable': [
'I',
'import-error',
'no-member',
'protected-access',
'redefined-variable-type',
'similarities',
'no-else-return',
],
},
}

library_replacements = {
'MASTER': {
'ignore': ['CVS', '.git', '.cache', '.tox', '.nox'],
'load-plugins': 'pylint.extensions.check_docs',
},
'REPORTS': {
'reports': 'no',
},
'BASIC': {
'method-rgx': '[a-z_][a-z0-9_]{2,40}$',
'function-rgx': '[a-z_][a-z0-9_]{2,40}$',
},
'TYPECHECK': {
'ignored-modules': ['six', 'google.protobuf'],
},
'DESIGN': {
'min-public-methods': '0',
'max-args': '10',
'max-attributes': '15',
},
}

test_additions = copy.deepcopy(library_additions)
test_additions['MESSAGES CONTROL']['disable'].extend([
'missing-docstring',
'no-self-use',
'redefined-outer-name',
'unused-argument',
'no-name-in-module',
])
test_replacements = copy.deepcopy(library_replacements)
test_replacements.setdefault('BASIC', {})
test_replacements['BASIC'].update({
'good-names': ['i', 'j', 'k', 'ex', 'Run', '_', 'fh', 'pytestmark'],
'method-rgx': '[a-z_][a-z0-9_]{2,80}$',
'function-rgx': '[a-z_][a-z0-9_]{2,80}$',
})

ignored_files = ()
3 changes: 0 additions & 3 deletions scripts/.gitignore

This file was deleted.

260 changes: 0 additions & 260 deletions scripts/run_pylint.py

This file was deleted.

14 changes: 0 additions & 14 deletions scripts/travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,3 @@ fi
# Run tox.
echo "Running tox..."
tox

# Run tox for sub-packages.
if [[ $TOXENV != "docs" && -z $SYSTEM_TEST ]]; then
echo "Running tox for google_auth_httplib2..."
cd additional_packages/google_auth_httplib2
# --workdir is specified to avoid path names being too long, which
# causes subprocess calls to hit the execve character limit.
# See https://github.com/pypa/virtualenv/issues/596
tox --workdir ~/.tox-httplib2
cd $ROOT
echo "Running tox for google_auth_oauthlib..."
cd additional_packages/google_auth_oauthlib
tox --workdir ~/.tox-oauthlib
fi
6 changes: 6 additions & 0 deletions tests/transport/test_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def refresh(self, request):

class MockAdapter(requests.adapters.BaseAdapter):
def __init__(self, responses, headers=None):
super(MockAdapter, self).__init__()
self.responses = responses
self.requests = []
self.headers = headers or {}
Expand All @@ -57,6 +58,11 @@ def send(self, request, **kwargs):
self.requests.append(request)
return self.responses.pop(0)

def close(self): # pragma: NO COVER
# pylint wants this to be here because it's abstract in the base
# class, but requests never actually calls it.
return


def make_response(status=http_client.OK, data=None):
response = requests.Response()
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,13 @@ commands =
--import-order-style=google \
--application-import-names="google,tests,system_tests" \
google tests
python {toxinidir}/scripts/run_pylint.py \
gcp-devrel-py-tools run-pylint \
--config pylint.config.py \
--library-filesets google \
--test-filesets tests system_tests
deps =
flake8
flake8-import-order
pylint
docutils
gcp-devrel-py-tools