Merge pull request #21384 from lidizheng/pytype

[Aio] Add pytype as one of our sanity tests
pull/21454/head
Lidi Zheng 5 years ago committed by GitHub
commit 04d48f4179
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .gitignore
  2. 8
      setup.cfg
  3. 2
      src/python/grpcio_tests/tests_aio/benchmark/server.py
  4. 19
      tools/distrib/check_pytype.sh
  5. 1
      tools/run_tests/sanity/sanity_tests.yaml

1
.gitignore vendored

@ -22,6 +22,7 @@ py3[0-9]_native/
a.out
src/python/grpcio_*/LICENSE
src/python/grpcio_status/grpc_status/google/rpc/status.proto
.pytype
# Node installation output
node_modules

@ -18,3 +18,11 @@ based_on_style = google
[metadata]
license_files = LICENSE
[pytype]
inputs =
src/python/grpcio/grpc/experimental
src/python/grpcio_tests/tests_aio
disable =
import-error

@ -37,7 +37,7 @@ class BenchmarkServer(benchmark_service_pb2_grpc.BenchmarkServiceServicer):
async def _start_async_server():
server = aio.server()
port = server.add_insecure_port(('localhost:%s' % 50051).encode('ASCII'))
port = server.add_insecure_port('localhost:%s' % 50051)
servicer = BenchmarkServer()
benchmark_service_pb2_grpc.add_BenchmarkServiceServicer_to_server(
servicer, server)

@ -0,0 +1,19 @@
#! /bin/bash -ex
# Copyright 2019 The gRPC Authors
#
# 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.
JOBS=$(nproc) || JOBS=4
python3 -m pip install pytype==2019.11.27
python3 -m pytype --keep-going -j "$JOBS" --strict-import --config "setup.cfg"

@ -20,6 +20,7 @@
- script: tools/distrib/check_include_guards.py
- script: tools/distrib/check_trailing_newlines.sh
- script: tools/distrib/check_upb_output.sh
- script: tools/distrib/check_pytype.sh
- script: tools/distrib/clang_format_code.sh
- script: tools/distrib/clang_tidy_code.sh
- script: tools/distrib/pylint_code.sh

Loading…
Cancel
Save