-
Notifications
You must be signed in to change notification settings - Fork 799
/
mypy.ini
59 lines (53 loc) · 2.47 KB
/
mypy.ini
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
[mypy]
show_column_numbers = true
; Target the oldest supported version in editors and default CLI
python_version = 3.8
strict = true
implicit_reexport = true
; Necessary to avoid "same module name" issues
explicit_package_bases = true
; Must specify top-level packages and scripts folders for mypy to work with explicit_package_bases
mypy_path =
$MYPY_CONFIG_FILE_DIR/com,
$MYPY_CONFIG_FILE_DIR/win32/Lib,
$MYPY_CONFIG_FILE_DIR/Pythonwin,
$MYPY_CONFIG_FILE_DIR/AutoDuck,
$MYPY_CONFIG_FILE_DIR/win32/scripts/VersionStamp,
; TODO: Gradually type classes and functions until we can turn back check_untyped_defs to true.
; For now this allows us to at least put mypy in place by massively reducing checked code
check_untyped_defs = false
; Implicit return types !
disallow_untyped_calls = false
disallow_untyped_defs = false
disallow_incomplete_defs = false
disable_error_code =
; Module has no attribute; (Dynamic modules will be hard to type without first-party stubs, ie: pythoncom.*)
attr-defined,
; Class cannot subclass "..." (has type "Any"); (IDEM)
; TODO: Use typeshed's types-pywin32 stubs after a few more fixes there
misc,
; Name "..." is not defined; (IDEM, leave undefined/unbound to Flake8/Ruff/pyright)
name-defined,
; Cannot assign to a method (we do lots of monkey patching)
method-assign,
exclude = (?x)(
^build/
; Vendored
| ^Pythonwin/Scintilla/
; Forked IDLE extensions predating Python 2.3. They now live in idlelib in https://github.com/python/cpython/tree/main/Lib/idlelib
| ^Pythonwin/pywin/idle/
; TODO: Ignoring non-public APIs until all public API is typed
| ([Tt]est|[Dd]emos?)/
)
; C-modules that will need type-stubs
[mypy-adsi.*,dde,exchange,mapi,perfmon,servicemanager,win32api,win32console,win32clipboard,win32comext.adsi.adsi,win32event,win32evtlog,win32file,win32gui,win32help,win32pdh,win32process,win32ras,win32security,win32service,win32trace,win32ui,win32uiole,win32wnet,_win32sysloader,_winxptheme]
ignore_missing_imports = True
; Most of win32com re-exports win32comext
; Test is a local untyped module in win32comext.axdebug
; pywin32_system32 is an empty module created in setup.py to store dlls
[mypy-win32com.*,Test,pywin32_system32]
ignore_missing_imports = True
; Distutils being removed from stdlib currently causes some issues on Python 3.12
; https://github.com/mhammond/pywin32/issues/2119
[mypy-distutils.*]
ignore_missing_imports = True