-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathpyproject.toml
More file actions
153 lines (120 loc) · 4.23 KB
/
pyproject.toml
File metadata and controls
153 lines (120 loc) · 4.23 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
# ########################
# ##### PYRIGHT
# ########################
# [Docs root]
# https://github.com/microsoft/pyright/tree/main/docs
# [Config option reference]
# https://github.com/microsoft/pyright/blob/main/docs/configuration.md
# Pyright does not have a docs site, but the documentation (a collection of
# markdown files in the GH repo, linked above) is pretty thorough.
[tool.pyright]
typeCheckingMode = "standard"
include = [
"docs/sphinx/_ext/dagster-sphinx",
"python_modules",
"examples",
"integration_tests",
"scripts",
]
# Unfortunately pyright does not offer a way to extend the default exclusions, so we have to
# reiterate them here if we want to add anything else.
exclude = [
"**/node_modules",
"**/__pycache__",
"**/__generated__",
"**/vendor",
"**/_vendored",
"**/.tox",
".git",
"**/.venv*",
"**/build",
]
extraPaths = [
".buildkite/buildkite-shared"
]
# These two settings point pyright to a python environment to resolve imports against. This virtual
# environment is defined in the `pyright` tox environment in the tox section below-- that
# environment must be built before pyright can run correctly.
venv = ".venv"
venvPath = "pyright/master"
# Minimum version of Python on which code must run. This determines the standard library stubs used by
# pyright.
pythonVersion = "3.10"
# Disable reading type annotations from libraries that are not explicitly marked as typed (i.e. that
# include a py.typed file). All imports from these libraries are given the `Unknown` type (i.e.
# `Any`). This setting does not affect `py.typed` libraries.
useLibraryCodeForTypes = false
# We use ruff for this.
reportInvalidStringEscapeSequence = false
# As of 2023-02-02, there are still many `py.typed` libs that are not compliant with the standards
# for defining a public API.
reportPrivateImportUsage = false
# Since we only use pyright, there is no need to suppress type errors that pyright does not
# recognize.
reportUnnecessaryTypeIgnoreComment = "warning"
# Skip analyzing unannotated code in examples to facilitate terse code.
executionEnvironments = [
{ root = "examples", analyzeUnannotatedFunctions=false },
{ root = "python_modules" },
{ root = "integration_tests" }
]
# ########################
# ##### PYTEST
# ########################
[tool.pytest.ini_options]
filterwarnings = [
"ignore::DeprecationWarning",
"ignore::UserWarning",
"ignore::pytest.PytestCollectionWarning",
]
markers = [
"unit: Fast unit tests with no external dependencies",
"integration: Tests requiring real git operations or other I/O",
"e2e: End-to-end tests requiring GitHub authentication",
"slow: Tests that take more than 1 second",
]
timeout = 240
addopts = "-ra"
# ########################
# ##### RUFF
# ########################
#
# The canonical ruff configuration is in ./config/ruff.toml. This file extends it with
# OSS-specific settings (excludes, per-file-ignores).
[tool.ruff]
extend = "./config/ruff.toml"
# *.py, *.ipy are included by default
extend-include = ["*.ipynb"]
extend-exclude = [
"*/__generated__/*",
"*/dagster_airflow/vendor/*",
"*/_vendored/*",
"*/snapshots/*",
"python_modules/libraries/dagstermill/dagstermill_tests/notebooks/cli_test_scaffold.ipynb",
]
[tool.ruff.lint]
# we only want to format notebooks, not lint them
exclude = ["*.ipynb"]
[tool.ruff.lint.per-file-ignores]
# Don't format docstrings in alembic migrations.
"**/alembic/versions/*.py" = ["D"]
"examples/docs_snippets/docs_snippets/guides/etl/transform-dbt/dbt_definitions*.py" = ["I001"]
# Modules where it is expected for there to be no __init.py__
"**/*test*/**/" = ["INP001"]
"**/setup.py" = ["INP001"]
"**/conftest.py" = ["INP001"]
"examples/**" = ["INP001"]
"docs/**" = ["INP001"]
"**/scripts/**" = ["INP001"]
"python_modules/dagster/dagster/_core/storage/alembic/env.py" = ["INP001"]
"python_modules/libraries/dagster-airlift/kitchen-sink/**" = ["INP001"]
# There is an __init__.py.tmpl
"python_modules/dagster/dagster/_generate/templates/REPO_NAME_PLACEHOLDER/REPO_NAME_PLACEHOLDER/assets.py" = ["INP001"]
[tool.ruff.format]
exclude = ["examples/docs_snippets/docs_snippets/guides/etl/transform-dbt/dbt_definitions*.py"]
[tool.dagster]
module_name = "dagster_test.toys.repo"
[dependency-groups]
dev = [
"erk>=0.6.0",
]