openai/openai-python

Public

mirrored from https://github.com/openai/openai-pythonAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
de9532c19b6abb360608479997795f3aeb570b45

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

mypy.ini

50lines · modecode

1[mypy]
2pretty = True
3show_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.
11exclude = ^(src/openai/_files\.py|_dev/.*\.py|tests/.*)$
12
13strict_equality = True
14implicit_reexport = True
15check_untyped_defs = True
16no_implicit_optional = True
17
18warn_return_any = True
19warn_unreachable = True
20warn_unused_configs = True
21
22# Turn these options off as it could cause conflicts
23# with the Pyright options.
24warn_unused_ignores = False
25warn_redundant_casts = False
26
27disallow_any_generics = True
28disallow_untyped_defs = True
29disallow_untyped_calls = True
30disallow_subclassing_any = True
31disallow_incomplete_defs = True
32disallow_untyped_decorators = True
33cache_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.
44disable_error_code = func-returns-value,overload-cannot-match
45
46# https://github.com/python/mypy/issues/12162
47[mypy.overrides]
48module = "black.files.*"
49ignore_errors = true
50ignore_missing_imports = true
51