-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Expand file tree
/
Copy pathpyproject.toml
More file actions
218 lines (208 loc) · 6.28 KB
/
pyproject.toml
File metadata and controls
218 lines (208 loc) · 6.28 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.
#
# since we rely on setuptools and according to https://peps.python.org/pep-0518/#build-system-table
# this is the minimum requirements for the build system to execute.
[build-system]
requires = [
"setuptools",
"wheel>=0.36.0",
# Note: after upgrading to grpcio-tools, we must bump protobuf to >=5.0.
# Currently Blocked on old dependencies of Beam tft extra:
# https://github.com/apache/beam/issues/37854
"grpcio-tools==1.62.1; python_version <= '3.12'",
"grpcio-tools==1.71.0; python_version >= '3.13'",
"mypy-protobuf==3.5.0",
# Avoid https://github.com/pypa/virtualenv/issues/2006
"distlib==0.3.9",
# Numpy headers
"numpy>=1.14.3,<2.5.0", # Update setup.py as well.
# having cython here will create wheels that are platform dependent.
"cython>=3.0,<4",
## deps for generating external transform wrappers:
# also update PyYaml bounds in sdks:python:generateExternalTransformsConfig
'pyyaml>=3.12,<7.0.0',
# also update Jinja2 bounds in test-suites/xlang/build.gradle (look for xlangWrapperValidation task)
"jinja2>=2.7.1,<4.0.0",
'yapf==0.43.0'
]
# legacy installation is needed to generate `apache_beam.portability.api` package.
build-backend = "setuptools.build_meta"
[tool.isort]
py_version = 310
line_length = 120
old_finders = true
order_by_type = true
force_single_line = true
combine_star = true
src_paths = ["apache_beam"]
extra_standard_library = ["dataclasses"]
known_third_party = ["yaml"]
skip = [
"apiclient.py",
"avroio_test.py",
"cloudpickle.py",
"datastore_wordcount.py",
"datastoreio_test.py",
"doctests_test.py",
"fast_coders_test.py",
"hadoopfilesystem.py",
"iobase_test.py",
"main_test.py",
"model.py",
"preprocess.py",
"process_tfma.py",
"render_test.py",
"slow_coders_test.py",
"taxi.py",
"tfdv_analyze_and_validate.py",
"yaml/main.py",
"yaml_testing_test.py",
"bigquery_v2_client.py",
"bigquery_v2_messages.py",
"dataflow_v1b3_client.py",
"dataflow_v1b3_messages.py",
"storage_v1_client.py",
"storage_v1_messages.py",
"proto2_coder_test_messages_pb2.py",
"cloudbuild_v1_client.py",
"cloudbuild_v1_messages.py",
"boto3_client.py",
]
skip_glob = [
"*.pxd",
"*.pyx",
"*pb2*.py",
"**/examples/**/*.py",
"**/portability/api/**/*.py",
"**/portability/api/__init__.py",
]
[tool.ruff]
exclude = [
".bzr",
".direnv",
".eggs",
".git",
".git-rewrite",
".hg",
".ipynb_checkpoints",
".mypy_cache",
".nox",
".pants.d",
".pyenv",
".pytest_cache",
".pytype",
".ruff_cache",
".svn",
".tox",
".venv",
".vscode",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"node_modules",
"site-packages",
"venv",
"*.pxd",
"*.pyx",
"*pb2*.py",
"**/examples/**/*.py",
"**/examples/**/*.ipynb",
"**/portability/api/**/*.py",
"**/portability/api/__init__.py",
]
target-version = "py310"
src = ["apache_beam"]
[tool.ruff.lint]
select = ["E9", "PL", "F821", "F822", "F823", "UP006"]
ignore = [
# Ignored Pylint Checks
"PLC0415", # import-outside-toplevel
"PLR2004", # magic-value-comparison
"PLR0913", # too-many-arguments
"PLR0912", # too-many-branches
"PLW0108", # unnecessary-lambda
"PLW2901", # redefined-loop-name
"PLR0915", # too-many-statements
"PLR1714", # repeated-equality-comparison
"PLR0911", # too-many-return-statements
"PLR5501", # collapsible-else-if
"PLW0603", # global-statement
"PLR1730", # if-stmt-min-max
"PLW1641", # eq-without-hash
"PLW0602", # global-variable-not-assigned
"PLC1802", # len-test
"PLC3002", # unnecessary-direct-lambda-call
"PLW0642", # self-or-cls-assignment
"PLR1733", # unnecessary-dict-index-lookup
"PLR0402", # manual-from-import
"PLC0132", # type-param-name-mismatch
"PLC0206", # dict-index-missing-items
"PLC0207", # missing-maxsplit-arg
"PLR1704", # redefined-argument-from-local
"PLR1711", # useless-return
"PLW0406", # import-self
"PLW3301", # nested-min-max
"PLR2044", # empty-comment
]
# Allow fix for all enabled rules (when --fix) is provided.
fixable = ["ALL"]
unfixable = []
# Allow unused variables when underscore-prefixed.
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
[tool.pyrefly]
project-includes = ["apache_beam"]
python-version = "3.10.0"
ignore-missing-imports = ["*"]
untyped-def-behavior = "skip-and-infer-return-any"
[tool.pyrefly.errors]
missing-attribute = "ignore"
invalid-annotation = "ignore"
redundant-condition = "ignore"
untyped-import = "ignore"
# Beam-specific supressions to keep pyrefly green
# These are in descending order of instances.
#
# TODO(https://github.com/apache/beam/issues/37699): Reduce the number of
# ignored checks.
bad-param-name-override = "ignore"
bad-override = "ignore"
bad-argument-type = "ignore"
unsupported-operation = "ignore"
implicit-import = "ignore"
bad-function-definition = "ignore"
bad-return = "ignore"
unbound-name = "ignore"
no-matching-overload = "ignore"
bad-assignment = "ignore"
missing-argument = "ignore"
bad-index = "ignore"
invalid-type-var = "ignore"
unknown-name = "ignore"
not-a-type = "ignore"
deprecated = "ignore"
not-callable = "ignore"
invalid-argument = "ignore"
invalid-inheritance = "ignore"
not-iterable = "ignore"
unexpected-keyword = "ignore"
bad-specialization = "ignore"
bad-context-manager = "ignore"
invalid-yield = "ignore"
bad-argument-count = "ignore"
bad-typed-dict-key = "ignore"