|
1 | 1 | [project] |
2 | 2 | name = "gradient" |
3 | | -version = "3.0.0-beta.5" |
| 3 | +version = "3.0.0-beta.6" |
4 | 4 | description = "The official Python library for the Gradient API" |
5 | 5 | dynamic = ["readme"] |
6 | 6 | license = "Apache-2.0" |
@@ -54,7 +54,6 @@ dev-dependencies = [ |
54 | 54 | "dirty-equals>=0.6.0", |
55 | 55 | "importlib-metadata>=6.7.0", |
56 | 56 | "rich>=13.7.1", |
57 | | - "nest_asyncio==1.6.0", |
58 | 57 | "pytest-xdist>=3.6.1", |
59 | 58 | ] |
60 | 59 |
|
@@ -144,6 +143,58 @@ reportOverlappingOverload = false |
144 | 143 | reportImportCycles = false |
145 | 144 | reportPrivateUsage = false |
146 | 145 |
|
| 146 | +[tool.mypy] |
| 147 | +pretty = true |
| 148 | +show_error_codes = true |
| 149 | + |
| 150 | +# Exclude _files.py because mypy isn't smart enough to apply |
| 151 | +# the correct type narrowing and as this is an internal module |
| 152 | +# it's fine to just use Pyright. |
| 153 | +# |
| 154 | +# We also exclude our `tests` as mypy doesn't always infer |
| 155 | +# types correctly and Pyright will still catch any type errors. |
| 156 | +exclude = ['src/gradient/_files.py', '_dev/.*.py', 'tests/.*'] |
| 157 | + |
| 158 | +strict_equality = true |
| 159 | +implicit_reexport = true |
| 160 | +check_untyped_defs = true |
| 161 | +no_implicit_optional = true |
| 162 | + |
| 163 | +warn_return_any = true |
| 164 | +warn_unreachable = true |
| 165 | +warn_unused_configs = true |
| 166 | + |
| 167 | +# Turn these options off as it could cause conflicts |
| 168 | +# with the Pyright options. |
| 169 | +warn_unused_ignores = false |
| 170 | +warn_redundant_casts = false |
| 171 | + |
| 172 | +disallow_any_generics = true |
| 173 | +disallow_untyped_defs = true |
| 174 | +disallow_untyped_calls = true |
| 175 | +disallow_subclassing_any = true |
| 176 | +disallow_incomplete_defs = true |
| 177 | +disallow_untyped_decorators = true |
| 178 | +cache_fine_grained = true |
| 179 | + |
| 180 | +# By default, mypy reports an error if you assign a value to the result |
| 181 | +# of a function call that doesn't return anything. We do this in our test |
| 182 | +# cases: |
| 183 | +# ``` |
| 184 | +# result = ... |
| 185 | +# assert result is None |
| 186 | +# ``` |
| 187 | +# Changing this codegen to make mypy happy would increase complexity |
| 188 | +# and would not be worth it. |
| 189 | +disable_error_code = "func-returns-value,overload-cannot-match" |
| 190 | + |
| 191 | +# https://github.com/python/mypy/issues/12162 |
| 192 | +[[tool.mypy.overrides]] |
| 193 | +module = "black.files.*" |
| 194 | +ignore_errors = true |
| 195 | +ignore_missing_imports = true |
| 196 | + |
| 197 | + |
147 | 198 | [tool.ruff] |
148 | 199 | line-length = 120 |
149 | 200 | output-format = "grouped" |
|
0 commit comments