openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
mypy.ini
50lines · modecode
| 1 | [mypy] |
| 2 | pretty = True |
| 3 | show_error_codes = True |
| 4 | |
| 5 | # Exclude _files.py because mypy isn't smart enough to apply |
| 6 | # the correct type narrowing and as this is an internal module |
| 7 | # it's fine to just use Pyright. |
| 8 | # |
| 9 | # We also exclude our `tests` as mypy doesn't always infer |
| 10 | # types correctly and Pyright will still catch any type errors. |
| 11 | exclude = ^(src/openai/_files\.py|_dev/.*\.py|tests/.*)$ |
| 12 | |
| 13 | strict_equality = True |
| 14 | implicit_reexport = True |
| 15 | check_untyped_defs = True |
| 16 | no_implicit_optional = True |
| 17 | |
| 18 | warn_return_any = True |
| 19 | warn_unreachable = True |
| 20 | warn_unused_configs = True |
| 21 | |
| 22 | # Turn these options off as it could cause conflicts |
| 23 | # with the Pyright options. |
| 24 | warn_unused_ignores = False |
| 25 | warn_redundant_casts = False |
| 26 | |
| 27 | disallow_any_generics = True |
| 28 | disallow_untyped_defs = True |
| 29 | disallow_untyped_calls = True |
| 30 | disallow_subclassing_any = True |
| 31 | disallow_incomplete_defs = True |
| 32 | disallow_untyped_decorators = True |
| 33 | cache_fine_grained = True |
| 34 | |
| 35 | # By default, mypy reports an error if you assign a value to the result |
| 36 | # of a function call that doesn't return anything. We do this in our test |
| 37 | # cases: |
| 38 | # ``` |
| 39 | # result = ... |
| 40 | # assert result is None |
| 41 | # ``` |
| 42 | # Changing this codegen to make mypy happy would increase complexity |
| 43 | # and would not be worth it. |
| 44 | disable_error_code = func-returns-value,overload-cannot-match |
| 45 | |
| 46 | # https://github.com/python/mypy/issues/12162 |
| 47 | [mypy.overrides] |
| 48 | module = "black.files.*" |
| 49 | ignore_errors = true |
| 50 | ignore_missing_imports = true |
| 51 | |