forked from dagster-io/dagster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
224 lines (173 loc) · 6.95 KB
/
pyproject.toml
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
219
220
221
222
223
224
# ########################
# ##### BLACK
# ########################
# [Docs root]
# https://black.readthedocs.io/en/stable/
# [Config option reference]
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#command-line-options
[tool.black]
line-length = 100
# Enable "preview" mode-- this adds style rules likely to be incorporated into black's next major
# release. The reason for enabling this, as of 2022-12-04, is to turn on formatting of long string
# literals.
preview = true
# Black will refuse to run if it's not this version.
required-version = "22.12.0"
# Ensure black's output will be compatible with all listed versions.
target-version = ['py37', 'py38', 'py39', 'py310', 'py311']
# ########################
# ##### MYPY
# ########################
# [Docs root]
# https://mypy.readthedocs.io/en/stable/index.html
# [Config option reference]
# https://mypy.readthedocs.io/en/stable/config_file.html#the-mypy-configuration-file
[tool.mypy]
# Allow variables to be redefined with arbitrary types even if they already are typed.
allow_redefinition = true
# Allow for use of type annotations in local variables inside function bodies even when the
# signature is not annotated.
disable_error_code = ['annotation-unchecked']
# Ignore cases where mypy cannot resolve *the types* for a given import. Note that this is different
# than not being able to resolve the import at runtime. A module can be installed, but mypy will
# consider it unresolveable if it does not either (a) have a `py.typed` marker file; (b) have
# a corresponding stub package (i.e. named `types-XXX`) available to mypy. Because Dagster uses
# has several dependencies that do not satisfy either criterion, mypy will by default emit errors
# when it encounters imports of those dependencies. Since there's no way to fix these, we silence
# them.
ignore_missing_imports = true
# If a type stub package is missing from the environment but available on typeshed, automatically
# install it. Note that without `--non-interactive` this will prompt the user.
install_types = true
# Allow PEP-420-style namespace packages. Without this enabled, different parts of a namespace
# package will trigger "Duplicate module" errors.
namespace_packages = true
# Print codes (e.g. "[arg-type]") for each error in output.
show_error_codes = true
[tool.pytest.ini_options]
filterwarnings = [
"ignore::dagster.ExperimentalWarning",
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::pytest.PytestCollectionWarning",
]
# ########################
# ##### RUFF
# ########################
# [Docs root]
# https://github.com/charliermarsh/ruff#ruff
# [Config option reference]
# https://github.com/charliermarsh/ruff#reference
#
# As of 2022-12-05, the entire documentation of Ruff is in its very long
# README.
[tool.ruff]
extend-exclude = [
"*/__generated__/*",
"*/dagster_airflow/vendor/*",
"*/snapshots/*",
]
ignore = [
# (non-google docstring) These docstring rules are collectively incompatible
# with the Google-style docstrings we use. List taken from:
# https://github.com/charliermarsh/ruff#does-ruff-support-numpy--or-google-style-docstrings
"D203",
"D204",
"D213",
"D215",
"D400",
"D404",
"D406",
"D407",
"D408",
"D409",
"D413",
# (missing public docstrings) These work off of the Python sense of "public", rather than our
# bespoke definition based off of `@public`. When ruff supports custom plugins then we can write
# appropriate rules to require docstrings for `@public`.
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
# (module level import not at top) There are several places where we use e.g.
# warnings.filterwarings calls before imports.
"E402",
# (line too long): This fires for comments, which black won't wrap.
# Disabling until there is an autoformat solution available for comments.
"E501",
# (no type comparison): There are a few places where we use `== type(None)` which are more clear
# than the equivalent `isinstance` check.
'E721',
# (bare exception): There are many places where we want to catch a maximally generic exception.
'E722',
# (no assign lambda): existing code assigns lambdas in a few places. With black formatting
# requiring extra empty lines between defs, disallowing lambda assignment can make code less
# readable.
"E731",
# (no redundant alias) Allow redundant import aliases for explicit re-exports.
"PLC0414",
# (use from for submodule imports) Sometimes it is clearer to import a submodule directly.
"PLR0402",
##### TEMPORARY DISABLES
# (assorted docstring rules) There are too many violations of these to enable
# right now, but we should enable after fixing the violations.
"D200", # (one-line docstring should fit)
"D205", # (blank line after summary)
"D212", # (multi-line docstring summary should start at 1st line)
"D415", # (docstring summary should end with a period)
"D417", # (missing arg in docstring)
# (indent docstring rules) These rules should be enabled when ruff lands
# on/off style comments, which would allow turning them off for specific
# docstrings.
"D207", # (under-indented docstring)
"D208", # (over-indented docstring)
"D402", # (first line should not be the function's "signature")
# (disallow print statements) Allowing until there are file-scoped error-specific ignores and we
# can bulk-convert our pylint disables.
"T201", # (no print call)
"T203", # (no pprint call)
]
# Match black. Note that this also checks comment line length, but black does not format comments.
line-length = 100
# By default, ruff only uses all "E" (pycodestyle) and "F" (pyflakes) rules.
# Here we append to the defaults.
select = [
# (pydocstyle) Docstring-related rules. See above ignore section for selected
# exclusions that sculpt the rules to fit Google-style docstrings. See:
# https://github.com/charliermarsh/ruff#does-ruff-support-numpy--or-google-style-docstrings
"D",
# (pycodestyle) use all pycodestyle rules
"E",
# (pyflakes) use all pyflakes rules
"F",
# (isort) detect improperly sorted imports
"I001",
# (pylint) use all pylint rules (ruff currently implements only a subset of
# pylint's rules)
"PLC",
"PLE",
"PLR",
"PLW",
# (no commented out code) keep commented out code blocks out of the codebase
# "ERA001",
# (ruff-specific) Enable all ruff-specific checks (i.e. not ports of
# functionality from an existing linter).
"RUF",
# (disallow print statements) keep debugging statements out of the codebase
"T",
]
# Fail if Ruff is not running this version.
required-version = "0.0.212"
[tool.ruff.isort]
# Combine multiple `from foo import bar as baz` statements with the same source
# (`foo`) into a single statement.
combine-as-imports = true
# Imports of the form `from foo import bar as baz` show one `import bar as baz`
# per line. Useful for __init__.py files that just re-export symbols.
force-wrap-aliases = true
[tool.dagster]
module_name = "dagster_test.toys.repo"