openai/openai-python
Publicmirrored from https://github.com/openai/openai-pythonAvailable
mypy.ini
47lines · 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 | exclude = ^(src/openai/_files\.py|_dev/.*\.py)$ |
| 9 | |
| 10 | strict_equality = True |
| 11 | implicit_reexport = True |
| 12 | check_untyped_defs = True |
| 13 | no_implicit_optional = True |
| 14 | |
| 15 | warn_return_any = True |
| 16 | warn_unreachable = True |
| 17 | warn_unused_configs = True |
| 18 | |
| 19 | # Turn these options off as it could cause conflicts |
| 20 | # with the Pyright options. |
| 21 | warn_unused_ignores = False |
| 22 | warn_redundant_casts = False |
| 23 | |
| 24 | disallow_any_generics = True |
| 25 | disallow_untyped_defs = True |
| 26 | disallow_untyped_calls = True |
| 27 | disallow_subclassing_any = True |
| 28 | disallow_incomplete_defs = True |
| 29 | disallow_untyped_decorators = True |
| 30 | cache_fine_grained = True |
| 31 | |
| 32 | # By default, mypy reports an error if you assign a value to the result |
| 33 | # of a function call that doesn't return anything. We do this in our test |
| 34 | # cases: |
| 35 | # ``` |
| 36 | # result = ... |
| 37 | # assert result is None |
| 38 | # ``` |
| 39 | # Changing this codegen to make mypy happy would increase complexity |
| 40 | # and would not be worth it. |
| 41 | disable_error_code = func-returns-value |
| 42 | |
| 43 | # https://github.com/python/mypy/issues/12162 |
| 44 | [mypy.overrides] |
| 45 | module = "black.files.*" |
| 46 | ignore_errors = true |
| 47 | ignore_missing_imports = true |
| 48 | |