Commit Graph

22 Commits

Author SHA1 Message Date
Lidi Zheng 697c438df6
[PSM interop] Introduce isort/pylint to the GKE framework (#29476)
* [PSM interop] Introduce isort/pylint to the GKE framework

* Update the rpc_types

* Update variable type annotation style in tests/*.py
2022-05-03 11:05:04 -07:00
Lidi Zheng 2231c2ba77
Introduce Python import sorting to our sanity test suite (#26768)
* Add isort_code.sh to sanity tests

* Run tools/distrib/isort_code.sh

* Fine tune the import order for relative imports

* Make pylint and project generation happy

* Fix a few corner cases

* Use --check instead of --diff

* The import order impacts test result somehow

* Make isort print diff and check output at the same time

* Let tools/run_tests/python_utils be firstparty library

* Run isort against latest HEAD
2021-07-26 12:31:21 -07:00
Sergii Tkachenko ff9a426b2a Python style: suppress pylint bad-continuation for yapf compatibility 2021-01-13 14:06:05 -05:00
Lidi Zheng 8f64f9528f Add ignore to .pylintrc-tests 2018-12-11 16:37:44 -08:00
Lidi Zheng f6ce4e361b Remove the ignore-pattern in .pylintrc-tests 2018-12-11 16:28:26 -08:00
Lidi Zheng 8cb2d0546d Upgrade sanity Docker image to debian:stretch
* Use latest pylint in Python 3.7 (they dropped support for PY2)
* Make latest pylint happy
* Forced to upgrade to shellcheck 0.4.4
* Make shellcheck 0.4.4 happy
* Adopt reviewers' advice to reduce global disabled rules
2018-12-10 16:21:49 -08:00
Eric Gribkoff f8cf7ee56d Support gRPC Python client-side fork with epoll1
A process may fork after invoking grpc_init() and use gRPC in the child
if and only if the child process first destroys all gRPC resources
inherited from the parent process and invokes grpc_shutdown().
Subsequent to this, the child will be able to re-initialize and use
gRPC. After fork, the parent process will be able to continue to use
existing gRPC resources such as channels and calls without interference
from the child process.

To facilitate gRPC Python applications meeting the above constraints,
gRPC Python will automatically destroy and shutdown all gRPC Core
resources in the child's post-fork handler, including cancelling
in-flight calls (see detailed design below). From the client's
perspective, the child process is now free to create new channels and
use gRPC.
2018-08-22 10:34:54 -07:00
Mehrdad Afshari 7cd4ee7a42 Change notes on suppressions 2018-06-08 08:31:23 -07:00
Mehrdad Afshari adedd43b09 Disable additional pylint warnings due to upgrade 2018-06-07 23:40:03 -07:00
Mehrdad Afshari dd9697fef8 Eliminate broad-except suppression 2018-04-19 10:39:39 -07:00
Mehrdad Afshari 1611946161 Eliminate bare-except suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari 4cc8ea9be1 Eliminate old-style-class suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari fc3bb7c1f9 Eliminate wildcard-import suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari 86d04c2e34 Eliminate function-redefined suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari bc947ada75 Eliminate unnecessary-lambda suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari 4c87620da2 Eliminate undefined-variable suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari a6bf3ccac8 Eliminate non-iterator-returned suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari a7926f9a4c Eliminate undefined-loop-variable suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari 327b3fb6f8 Eliminate raising-bad-type suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari ce8e2fcd16 Eliminate unreachable suppression 2018-04-19 10:39:38 -07:00
Mehrdad Afshari 35c7e8c833 Eliminate bad-continuation suppression 2018-04-19 10:39:37 -07:00
Mehrdad Afshari b9424d07e2 Run pylint on Python test code
The test modules were not under pylint jurisdiction,
and actual bugs have been found in tests that would
have been prevented had we run static analysis on
the test code as we do on the core modules.

This is the first step to enable pylint on tests.
Due to numerous warnings since the code is not ready
and needs refactoring, a new `.pylintrc`
specific to tests is added that suppresses a number
of valid warnings.  The goal is stepwise elimination
of each class of warning while refactoring the code
such that it will not emit any warnings in future
commits, always keeping the sanity checks passing
and keeping the disruption minimal.
2018-04-18 13:38:25 -07:00