mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
tests: Fix mypy test (#1551)
This commit is contained in:
parent
0a7afb37d9
commit
0380a60e58
@ -64,8 +64,6 @@ hidden = NodePath("hidden")
|
|||||||
|
|
||||||
loader: Loader
|
loader: Loader
|
||||||
|
|
||||||
direct: "DirectSession"
|
|
||||||
|
|
||||||
# Set direct notify categories now that we have config
|
# Set direct notify categories now that we have config
|
||||||
directNotify.setDconfigLevels()
|
directNotify.setDconfigLevels()
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ so that I can just type: ``inspect(anObject)`` any time.
|
|||||||
See :ref:`inspection-utilities` for more information.
|
See :ref:`inspection-utilities` for more information.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
__all__ = ['inspect', 'inspectorFor', 'Inspector', 'ModuleInspector', 'ClassInspector', 'InstanceInspector', 'FunctionInspector', 'InstanceMethodInspector', 'CodeInspector', 'ComplexInspector', 'DictionaryInspector', 'SequenceInspector', 'SliceInspector', 'InspectorWindow']
|
__all__ = ['inspect', 'inspectorFor', 'Inspector', 'ModuleInspector', 'ClassInspector', 'InstanceInspector', 'FunctionInspector', 'InstanceMethodInspector', 'CodeInspector', 'ComplexInspector', 'DictionaryInspector', 'SequenceInspector', 'SliceInspector', 'InspectorWindow']
|
||||||
|
|
||||||
@ -31,7 +32,7 @@ def inspect(anObject):
|
|||||||
|
|
||||||
### private
|
### private
|
||||||
|
|
||||||
_InspectorMap: "dict[str, str]"
|
_InspectorMap: dict[str, str]
|
||||||
|
|
||||||
|
|
||||||
def inspectorFor(anObject):
|
def inspectorFor(anObject):
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import wx
|
import wx
|
||||||
from wx.lib.agw import fourwaysplitter as FWS
|
from wx.lib.agw import fourwaysplitter as FWS
|
||||||
|
|
||||||
@ -9,8 +11,6 @@ from direct.task.TaskManagerGlobal import taskMgr
|
|||||||
from .WxAppShell import WxAppShell
|
from .WxAppShell import WxAppShell
|
||||||
from .ViewPort import Viewport, ViewportManager
|
from .ViewPort import Viewport, ViewportManager
|
||||||
|
|
||||||
from typing import Optional
|
|
||||||
|
|
||||||
ID_FOUR_VIEW = 401
|
ID_FOUR_VIEW = 401
|
||||||
ID_TOP_VIEW = 402
|
ID_TOP_VIEW = 402
|
||||||
ID_FRONT_VIEW = 403
|
ID_FRONT_VIEW = 403
|
||||||
@ -27,7 +27,7 @@ class WxPandaShell(WxAppShell):
|
|||||||
copyright = ('Copyright 2010 Disney Online Studios.' +
|
copyright = ('Copyright 2010 Disney Online Studios.' +
|
||||||
'\nAll Rights Reserved.')
|
'\nAll Rights Reserved.')
|
||||||
|
|
||||||
MENU_TEXTS: dict[int, tuple[str, Optional[str]]] = {
|
MENU_TEXTS: dict[int, tuple[str, str | None]] = {
|
||||||
ID_FOUR_VIEW: ("Four Views", None),
|
ID_FOUR_VIEW: ("Four Views", None),
|
||||||
ID_TOP_VIEW: ("Top View", None),
|
ID_TOP_VIEW: ("Top View", None),
|
||||||
ID_FRONT_VIEW: ("Front View", None),
|
ID_FRONT_VIEW: ("Front View", None),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import os
|
|
||||||
import pathlib
|
import pathlib
|
||||||
import shutil
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
|
|
||||||
|
|
||||||
@ -10,15 +10,16 @@ def main():
|
|||||||
direct_src = root / 'direct' / 'src'
|
direct_src = root / 'direct' / 'src'
|
||||||
mypy_config = root / 'mypy.ini'
|
mypy_config = root / 'mypy.ini'
|
||||||
with tempfile.TemporaryDirectory() as temp_dir:
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
os.environ['MYPYPATH'] = temp_dir
|
|
||||||
direct_copy = pathlib.Path(temp_dir, 'direct')
|
direct_copy = pathlib.Path(temp_dir, 'direct')
|
||||||
shutil.copytree(direct_src, direct_copy)
|
shutil.copytree(direct_src, direct_copy)
|
||||||
subprocess.run([
|
command = [
|
||||||
'mypy',
|
'mypy',
|
||||||
str(direct_copy),
|
str(direct_copy.resolve()),
|
||||||
'--config-file',
|
'--config-file',
|
||||||
str(mypy_config),
|
str(mypy_config.resolve()),
|
||||||
])
|
]
|
||||||
|
result = subprocess.run(command, cwd=temp_dir)
|
||||||
|
sys.exit(result.returncode)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user