Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
202 lines (177 loc) · 5.02 KB
/
Copy pathpyproject.toml
File metadata and controls
202 lines (177 loc) · 5.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
# Copyright 2025 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.
[build-system]
requires = [
"setuptools>=77.0.1",
"wheel",
"Cython~=3.2",
]
build-backend = "setuptools.build_meta"
[project]
name = "grpcio"
license = "Apache-2.0"
description = "HTTP/2-based RPC framework"
readme = {file = "src/python/grpcio/README.rst", content-type = "text/x-rst"}
authors = [{name = "The gRPC Authors", email = "grpc-io@googlegroups.com"}]
dynamic = [
"classifiers",
"dependencies",
"optional-dependencies",
"requires-python",
"version",
]
[project.urls]
Homepage = "https://grpc.io"
"Source Code" = "https://github.com/grpc/grpc"
"Bug Tracker" = "https://github.com/grpc/grpc/issues"
Documentation = "https://grpc.github.io/grpc/python"
[tool.setuptools.dynamic]
version = {attr = "grpc_version.VERSION"}
[tool.setuptools.packages.find]
where = ["src/python/grpcio"]
[tool.setuptools.package-dir]
"" = "src/python/grpcio"
[tool.setuptools.package-data]
# Binaries that may or may not be present in the final installation, but are
# mentioned here for completeness.
"grpc._cython" = [
"_credentials/roots.pem",
"_windows/grpc_c.32.python",
"_windows/grpc_c.64.python",
]
[tool.setuptools.exclude-package-data]
# Exclude cython source and intermediate files from the .whl file
"*" = [
"*.pyx",
"*.cpp",
"*.pxd",
"*.pxi",
]
[tool.pyright]
typeCheckingMode = "strict"
reportUnnecessaryComparison = "none"
reportConstantRedefinition = "none"
reportUnusedFunction = "none"
reportUnusedVariable = "none"
reportIncompleteStub = "none"
reportUnusedClass = "none"
include = [
"src/python/grpcio/grpc/aio"
]
exclude = [
"**/third_party",
"**/build",
"**/grpc_root",
"**/__pycache__",
"**/.git",
"**/bazel-*",
"src/python/grpcio/commands.py",
"src/python/grpcio/_spawn_patch.py"
]
[[tool.pyright.executionEnvironments]]
root = "src/python/grpcio"
[[tool.pyright.executionEnvironments]]
root = "src/python/grpcio_tests"
extraPaths = ["src/python/grpcio"]
[tool.black]
line-length = 80
target-version = [
"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 = 310
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", "collections.abc", "typing_extensions"]
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