Skip to content

Commit 817224a

Browse files
committed
Consolidate linting and type checking configs into pyproject.toml
1 parent 2f300cc commit 817224a

4 files changed

Lines changed: 162 additions & 214 deletions

File tree

sdks/python/.isort.cfg

Lines changed: 0 additions & 58 deletions
This file was deleted.

sdks/python/pyproject.toml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,165 @@ requires = [
4444

4545
# legacy installation is needed to generate `apache_beam.portability.api` package.
4646
build-backend = "setuptools.build_meta"
47+
48+
[tool.isort]
49+
py_version = 310
50+
line_length = 120
51+
old_finders = true
52+
order_by_type = true
53+
force_single_line = true
54+
combine_star = true
55+
src_paths = ["apache_beam"]
56+
extra_standard_library = ["dataclasses"]
57+
known_third_party = ["yaml"]
58+
skip = [
59+
"apiclient.py",
60+
"avroio_test.py",
61+
"cloudpickle.py",
62+
"datastore_wordcount.py",
63+
"datastoreio_test.py",
64+
"doctests_test.py",
65+
"fast_coders_test.py",
66+
"hadoopfilesystem.py",
67+
"iobase_test.py",
68+
"main_test.py",
69+
"model.py",
70+
"preprocess.py",
71+
"process_tfma.py",
72+
"render_test.py",
73+
"slow_coders_test.py",
74+
"taxi.py",
75+
"tfdv_analyze_and_validate.py",
76+
"yaml/main.py",
77+
"yaml_testing_test.py",
78+
"bigquery_v2_client.py",
79+
"bigquery_v2_messages.py",
80+
"dataflow_v1b3_client.py",
81+
"dataflow_v1b3_messages.py",
82+
"storage_v1_client.py",
83+
"storage_v1_messages.py",
84+
"proto2_coder_test_messages_pb2.py",
85+
"cloudbuild_v1_client.py",
86+
"cloudbuild_v1_messages.py",
87+
"boto3_client.py",
88+
]
89+
skip_glob = [
90+
"*.pxd",
91+
"*.pyx",
92+
"*pb2*.py",
93+
"**/examples/**/*.py",
94+
"**/portability/api/**/*.py",
95+
"**/portability/api/__init__.py",
96+
]
97+
98+
[tool.ruff]
99+
exclude = [
100+
".bzr",
101+
".direnv",
102+
".eggs",
103+
".git",
104+
".git-rewrite",
105+
".hg",
106+
".ipynb_checkpoints",
107+
".mypy_cache",
108+
".nox",
109+
".pants.d",
110+
".pyenv",
111+
".pytest_cache",
112+
".pytype",
113+
".ruff_cache",
114+
".svn",
115+
".tox",
116+
".venv",
117+
".vscode",
118+
"__pypackages__",
119+
"_build",
120+
"buck-out",
121+
"build",
122+
"dist",
123+
"node_modules",
124+
"site-packages",
125+
"venv",
126+
"*.pxd",
127+
"*.pyx",
128+
"*pb2*.py",
129+
"**/examples/**/*.py",
130+
"**/examples/**/*.ipynb",
131+
"**/portability/api/**/*.py",
132+
"**/portability/api/__init__.py",
133+
]
134+
target-version = "py310"
135+
src = ["apache_beam"]
136+
137+
[tool.ruff.lint]
138+
select = ["E9", "PL", "F821", "F822", "F823"]
139+
ignore = [
140+
"PLC0415",
141+
"PLR2004",
142+
"PLR0913",
143+
"PLR0912",
144+
"PLW0108",
145+
"PLW2901",
146+
"PLR0915",
147+
"PLR1714",
148+
"PLR0911",
149+
"PLR5501",
150+
"PLW0603",
151+
"PLR1730",
152+
"PLW1641",
153+
"PLW0602",
154+
"PLC1802",
155+
"PLC3002",
156+
"PLW0642",
157+
"PLR1733",
158+
"PLR0402",
159+
"PLC0132",
160+
"PLC0206",
161+
"PLC0207",
162+
"PLR1704",
163+
"PLR1711",
164+
"PLW0406",
165+
"PLW3301",
166+
"PLR2044",
167+
]
168+
fixable = ["ALL"]
169+
unfixable = []
170+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
171+
172+
[tool.pyrefly]
173+
project-includes = ["apache_beam"]
174+
python-version = "3.10.0"
175+
ignore-missing-imports = ["*"]
176+
untyped-def-behavior = "skip-and-infer-return-any"
177+
178+
[tool.pyrefly.errors]
179+
missing-attribute = "ignore"
180+
invalid-annotation = "ignore"
181+
redundant-condition = "ignore"
182+
untyped-import = "ignore"
183+
bad-param-name-override = "ignore"
184+
bad-override = "ignore"
185+
bad-argument-type = "ignore"
186+
unsupported-operation = "ignore"
187+
implicit-import = "ignore"
188+
bad-function-definition = "ignore"
189+
bad-return = "ignore"
190+
unbound-name = "ignore"
191+
no-matching-overload = "ignore"
192+
bad-assignment = "ignore"
193+
missing-argument = "ignore"
194+
bad-index = "ignore"
195+
invalid-type-var = "ignore"
196+
unknown-name = "ignore"
197+
not-a-type = "ignore"
198+
deprecated = "ignore"
199+
not-callable = "ignore"
200+
invalid-argument = "ignore"
201+
invalid-inheritance = "ignore"
202+
not-iterable = "ignore"
203+
unexpected-keyword = "ignore"
204+
bad-specialization = "ignore"
205+
bad-context-manager = "ignore"
206+
invalid-yield = "ignore"
207+
bad-argument-count = "ignore"
208+
bad-typed-dict-key = "ignore"

sdks/python/pyrefly.toml

Lines changed: 0 additions & 60 deletions
This file was deleted.

sdks/python/ruff.toml

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)