forked from grpc/grpc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Python] Migrate from yapf to black (grpc#33138)
- Switched from yapf to black - Reconfigure isort for black - Resolve black/pylint idiosyncrasies Note: I used `--experimental-string-processing` because black was producing "implicit string concatenation", similar to what described here: psf/black#1837. While currently this feature is experimental, it will be enabled by default: psf/black#2188. After running black with the new string processing so that the generated code merges these `"hello" " world"` strings concatenations, then I removed `--experimental-string-processing` for stability, and regenerated the code again. To the reviewer: don't even try to open "Files Changed" tab 😄 It's better to review commit-by-commit, and ignore `run black and isort`.
- Loading branch information
1 parent
c6f1950
commit 99196e0
Showing
573 changed files
with
42,016 additions
and
29,841 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
[tool.black] | ||
line-length = 80 | ||
target-version = [ | ||
"py37", | ||
"py38", | ||
"py39", | ||
"py310", | ||
"py311", | ||
] | ||
extend-exclude = ''' | ||
# A regex preceded with ^/ will apply only to files and directories | ||
# in the root of the project. | ||
( | ||
site-packages | ||
| test/cpp/naming/resolver_component_tests_runner.py # AUTO-GENERATED | ||
# AUTO-GENERATED from a template: | ||
| grpc_version.py | ||
| src/python/grpcio/grpc_core_dependencies.py | ||
| src/python/grpcio/grpc/_grpcio_metadata.py | ||
# AUTO-GENERATED BY make_grpcio_tools.py | ||
| tools/distrib/python/grpcio_tools/protoc_lib_deps.py | ||
| .*_pb2.py # autogenerated Protocol Buffer files | ||
| .*_pb2_grpc.py # autogenerated Protocol Buffer gRPC files | ||
) | ||
''' | ||
|
||
[tool.isort] | ||
profile = "black" | ||
line_length = 80 | ||
src_paths = [ | ||
"examples/python/data_transmission", | ||
"examples/python/async_streaming", | ||
"tools/run_tests/xds_k8s_test_driver", | ||
"src/python/grpcio_tests", | ||
"tools/run_tests", | ||
] | ||
known_first_party = [ | ||
"examples", | ||
"src", | ||
] | ||
known_third_party = ["grpc"] | ||
skip_glob = [ | ||
"third_party/*", | ||
"*/env/*", | ||
"*pb2*.py", | ||
"*pb2*.pyi", | ||
"**/site-packages/**/*", | ||
] | ||
single_line_exclusions = ["typing"] | ||
force_single_line = true | ||
force_sort_within_sections = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.