Skip to content
Snippets Groups Projects
Commit 28bdde34 authored by Mehrdad Afshari's avatar Mehrdad Afshari Committed by GitHub
Browse files

Merge pull request #11369 from mehrdada/pylint-expansion

Expand pylint to grpc_health and grpc_reflection
parents ec21e993 5bc11d55
No related branches found
No related tags found
No related merge requests found
...@@ -28,8 +28,6 @@ ...@@ -28,8 +28,6 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
"""Reference implementation for reflection in gRPC Python.""" """Reference implementation for reflection in gRPC Python."""
import threading
import grpc import grpc
from google.protobuf import descriptor_pb2 from google.protobuf import descriptor_pb2
from google.protobuf import descriptor_pool from google.protobuf import descriptor_pool
...@@ -120,6 +118,7 @@ class ReflectionServicer(reflection_pb2_grpc.ServerReflectionServicer): ...@@ -120,6 +118,7 @@ class ReflectionServicer(reflection_pb2_grpc.ServerReflectionServicer):
])) ]))
def ServerReflectionInfo(self, request_iterator, context): def ServerReflectionInfo(self, request_iterator, context):
# pylint: disable=unused-argument
for request in request_iterator: for request in request_iterator:
if request.HasField('file_by_filename'): if request.HasField('file_by_filename'):
yield self._file_by_filename(request.file_by_filename) yield self._file_by_filename(request.file_by_filename)
...@@ -152,4 +151,4 @@ def enable_server_reflection(service_names, server, pool=None): ...@@ -152,4 +151,4 @@ def enable_server_reflection(service_names, server, pool=None):
pool: DescriptorPool object to use (descriptor_pool.Default() if None). pool: DescriptorPool object to use (descriptor_pool.Default() if None).
""" """
reflection_pb2_grpc.add_ServerReflectionServicer_to_server( reflection_pb2_grpc.add_ServerReflectionServicer_to_server(
ReflectionServicer(service_names, pool), server) ReflectionServicer(service_names, pool=pool), server)
...@@ -31,18 +31,22 @@ ...@@ -31,18 +31,22 @@
set -ex set -ex
# change to root directory # change to root directory
cd $(dirname $0)/../.. cd "$(dirname "$0")/../.."
DIRS=src/python/grpcio/grpc DIRS=(
'src/python/grpcio/grpc'
'src/python/grpcio_reflection/grpc_reflection'
'src/python/grpcio_health_checking/grpc_health'
)
VIRTUALENV=python_pylint_venv VIRTUALENV=python_pylint_venv
virtualenv $VIRTUALENV virtualenv $VIRTUALENV
PYTHON=`realpath $VIRTUALENV/bin/python` PYTHON=$(realpath $VIRTUALENV/bin/python)
$PYTHON -m pip install pylint==1.6.5 $PYTHON -m pip install pylint==1.6.5
for dir in $DIRS; do for dir in "${DIRS[@]}"; do
$PYTHON -m pylint --rcfile=.pylintrc -rn $dir || exit $? $PYTHON -m pylint --rcfile=.pylintrc -rn "$dir" || exit $?
done done
exit 0 exit 0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment