Skip to content

Commit 9088c7b

Browse files
authored
Chore: Port mypy config to pyproject.toml (#3994)
1 parent 2b8a844 commit 9088c7b

2 files changed

Lines changed: 54 additions & 105 deletions

File tree

pyproject.toml

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ dependencies = [
2525
"tenacity",
2626
"time-machine",
2727
]
28-
classifiers=[
28+
classifiers = [
2929
"Intended Audience :: Developers",
3030
"Intended Audience :: Science/Research",
3131
"License :: OSI Approved :: Apache Software License",
@@ -146,10 +146,62 @@ fallback_version = "0.0.0"
146146
local_scheme = "no-local-version"
147147

148148
[tool.setuptools.packages.find]
149-
include=["sqlmesh", "sqlmesh.*", "web*"]
149+
include = ["sqlmesh", "sqlmesh.*", "web*"]
150150

151151
[tool.setuptools.package-data]
152152
web = ["client/dist/**"]
153153
"*" = ["py.typed"]
154154

155+
# MyPy Rules
156+
[tool.mypy]
157+
plugins = "pydantic.mypy"
158+
no_implicit_optional = true
159+
disallow_untyped_defs = true
155160

161+
[[tool.mypy.overrides]]
162+
module = [
163+
"examples.*.macros.*",
164+
"tests.*",
165+
"sqlmesh.migrations.*"
166+
]
167+
disallow_untyped_defs = false
168+
# Sometimes it's helpful to use types within an "untyped" function because it allows IDE assistance
169+
# Unfortunately this causes MyPy to print an annoying 'By default the bodies of untyped functions are not checked'
170+
# warning so we disable that warning here
171+
disable_error_code = "annotation-unchecked"
172+
173+
[[tool.mypy.overrides]]
174+
module = [
175+
"api.*",
176+
"airflow.*",
177+
"astor.*",
178+
"IPython.*",
179+
"hyperscript.*",
180+
"py.*",
181+
"ruamel.*",
182+
"setuptools.*",
183+
"graphviz.*",
184+
"ipywidgets.*",
185+
"google.*",
186+
"snowflake.*",
187+
"redshift_connector",
188+
"databricks.*",
189+
"faker.*",
190+
"agate.*",
191+
"databricks_cli.*",
192+
"mysql.*",
193+
"pymssql.*",
194+
"psycopg2.*",
195+
"langchain.*",
196+
"pytest_lazyfixture.*",
197+
"dbt.adapters.*",
198+
"slack_sdk.*",
199+
"py4j.*",
200+
"boto3.*",
201+
"trino.*",
202+
"bs4.*",
203+
"pydantic_core.*",
204+
"dlt.*",
205+
"bigframes.*",
206+
]
207+
ignore_missing_imports = true

setup.cfg

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

0 commit comments

Comments
 (0)