mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-27 07:03:36 -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
|
||||
|
||||
direct: "DirectSession"
|
||||
|
||||
# Set direct notify categories now that we have config
|
||||
directNotify.setDconfigLevels()
|
||||
|
||||
|
@ -11,6 +11,7 @@ so that I can just type: ``inspect(anObject)`` any time.
|
||||
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']
|
||||
|
||||
@ -31,7 +32,7 @@ def inspect(anObject):
|
||||
|
||||
### private
|
||||
|
||||
_InspectorMap: "dict[str, str]"
|
||||
_InspectorMap: dict[str, str]
|
||||
|
||||
|
||||
def inspectorFor(anObject):
|
||||
|
@ -1,3 +1,5 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import wx
|
||||
from wx.lib.agw import fourwaysplitter as FWS
|
||||
|
||||
@ -9,8 +11,6 @@ from direct.task.TaskManagerGlobal import taskMgr
|
||||
from .WxAppShell import WxAppShell
|
||||
from .ViewPort import Viewport, ViewportManager
|
||||
|
||||
from typing import Optional
|
||||
|
||||
ID_FOUR_VIEW = 401
|
||||
ID_TOP_VIEW = 402
|
||||
ID_FRONT_VIEW = 403
|
||||
@ -27,7 +27,7 @@ class WxPandaShell(WxAppShell):
|
||||
copyright = ('Copyright 2010 Disney Online Studios.' +
|
||||
'\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_TOP_VIEW: ("Top View", None),
|
||||
ID_FRONT_VIEW: ("Front View", None),
|
||||
|
@ -1,7 +1,7 @@
|
||||
import os
|
||||
import pathlib
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
|
||||
@ -10,15 +10,16 @@ def main():
|
||||
direct_src = root / 'direct' / 'src'
|
||||
mypy_config = root / 'mypy.ini'
|
||||
with tempfile.TemporaryDirectory() as temp_dir:
|
||||
os.environ['MYPYPATH'] = temp_dir
|
||||
direct_copy = pathlib.Path(temp_dir, 'direct')
|
||||
shutil.copytree(direct_src, direct_copy)
|
||||
subprocess.run([
|
||||
command = [
|
||||
'mypy',
|
||||
str(direct_copy),
|
||||
str(direct_copy.resolve()),
|
||||
'--config-file',
|
||||
str(mypy_config),
|
||||
])
|
||||
str(mypy_config.resolve()),
|
||||
]
|
||||
result = subprocess.run(command, cwd=temp_dir)
|
||||
sys.exit(result.returncode)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Loading…
x
Reference in New Issue
Block a user