mirror of
https://github.com/grpc/grpc.git
synced 2026-01-24 10:53:30 +08:00
This will avoid exceeding the Windows 150-character path length limit when we upgrade the xDS protos. Closes #41261 PiperOrigin-RevId: 847800132
100 lines
2.5 KiB
TOML
100 lines
2.5 KiB
TOML
[tool.black]
|
|
line-length = 80
|
|
target-version = [
|
|
"py39",
|
|
"py310",
|
|
"py311",
|
|
"py312",
|
|
"py313",
|
|
]
|
|
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
|
|
| python_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
|
|
# AUTO-GENERATED BY make_grpcio_observability.py
|
|
| src/python/grpcio_observability/observability_lib_deps.py
|
|
| .*_pb2.py # autogenerated Protocol Buffer files
|
|
| .*_pb2_grpc.py # autogenerated Protocol Buffer gRPC files
|
|
# AUTO-GENERATED By py_xds_protos/build_xds_protos.py
|
|
| py_xds_protos/.*
|
|
)
|
|
'''
|
|
|
|
[tool.isort]
|
|
profile = "black"
|
|
py_version = 39
|
|
follow_links = false
|
|
|
|
line_length = 80
|
|
src_paths = [
|
|
"examples/python/data_transmission",
|
|
"examples/python/async_streaming",
|
|
"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/**/*",
|
|
"py_xds_protos/*",
|
|
"**/.venv-*",
|
|
]
|
|
single_line_exclusions = ["typing"]
|
|
force_single_line = true
|
|
force_sort_within_sections = true
|
|
|
|
# TODO(xuanwn): include all files in src/python/grpcio/grpc
|
|
[tool.pytype]
|
|
python_version = "3.11"
|
|
|
|
# Setup settings for Pytype
|
|
# NOTE(lidiz) Adding examples one by one due to pytype aggressive error:
|
|
# ninja: error: build.ninja:178: multiple rules generate helloworld_pb2.pyi [-w dupbuild=err]
|
|
inputs = [
|
|
"src/python/grpcio/grpc/experimental",
|
|
"src/python/grpcio/grpc",
|
|
"src/python/grpcio_tests/tests_aio",
|
|
"src/python/grpcio_observability/grpc_observability",
|
|
"examples/python/auth",
|
|
"examples/python/helloworld"
|
|
]
|
|
exclude = [
|
|
"**/*_pb2.py",
|
|
"src/python/grpcio/grpc/framework",
|
|
"src/python/grpcio/grpc/aio",
|
|
"src/python/grpcio/grpc/beta",
|
|
"src/python/grpcio/grpc/__init__.py",
|
|
"src/python/grpcio/grpc/_simple_stubs.py",
|
|
]
|
|
|
|
# NOTE(lidiz)
|
|
# import-error: C extension triggers import-error.
|
|
# module-attr: pytype cannot understand the namespace packages by Google.
|
|
# attribute-error: Data classes in grpc module doesn't specify attributes.
|
|
disable = [
|
|
"import-error",
|
|
"module-attr",
|
|
"attribute-error",
|
|
]
|
|
|
|
jobs = 'auto'
|
|
|
|
strict_import = true
|
|
keep_going = true
|