Skip to content

Commit

Permalink
Fixed import issues in ocx and app pywin Demos
Browse files Browse the repository at this point in the history
  • Loading branch information
Avasam committed Jun 5, 2024
1 parent f82f936 commit b55f76e
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Coming in build 307, as yet unreleased
--------------------------------------

### pywin32
* Fixed import issues in ocx and app pywin Demos (#2291, @Avasam)
* Fixed accidentally trying to raise a `str` instead of an `Exception` in (#2270, @Avasam)
* `Pythonwin/pywin/debugger/debugger.py`
* `Pythonwin/pywin/framework/dlgappcore.py`
Expand Down
4 changes: 1 addition & 3 deletions Pythonwin/pywin/Demos/app/demoutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ def NeedApp():


if __name__ == "__main__":
import demoutils

demoutils.NotAScript()
NotAScript()
Empty file.
4 changes: 1 addition & 3 deletions Pythonwin/pywin/Demos/ocx/demoutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,4 @@ def NeedApp():


if __name__ == "__main__":
from . import demoutils

demoutils.NotAScript()
NotAScript()
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/ocx/ocxserialtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def test():


if __name__ == "__main__":
from . import demoutils
import demoutils

if demoutils.NeedGoodGUI():
test()
2 changes: 1 addition & 1 deletion Pythonwin/pywin/Demos/ocx/ocxtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def demo():


if __name__ == "__main__":
from . import demoutils
import demoutils

if demoutils.NeedGoodGUI():
testall()
18 changes: 12 additions & 6 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,15 @@ implicit_reexport = true
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/AutoDuck,
$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/Pythonwin/pywin/Demos,
$MYPY_CONFIG_FILE_DIR/win32/Demos,
$MYPY_CONFIG_FILE_DIR/win32/Demos/security,
$MYPY_CONFIG_FILE_DIR/win32/Demos/service,
$MYPY_CONFIG_FILE_DIR/win32/Demos/win32wnet,
$MYPY_CONFIG_FILE_DIR/win32/Lib,
$MYPY_CONFIG_FILE_DIR/win32/scripts/VersionStamp,

; TODO: Gradually type classes and functions until we can turn back check_untyped_defs to true.
Expand Down Expand Up @@ -47,14 +52,15 @@ exclude = (?x)(
)

; C-modules that will need type-stubs
[mypy-adsi.*,dde,exchange,exchdapi,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]
[mypy-adsi.*,dde,exchange,exchdapi,mapi,mmapfile,perfmon,servicemanager,timer,win32api,win32console,win32clipboard,win32comext.adsi.adsi,win32cred,win32event,win32evtlog,win32file,win32gui,win32help,win32net,win32pdh,win32pipe,win32print,win32process,win32profile,win32ras,win32security,win32service,win32trace,win32transaction,win32ts,win32ui,win32uiole,win32wnet,_win32sysloader,_winxptheme]
ignore_missing_imports = True

; pywin32_system32 is an empty module created in setup.py to store dlls
; OpenGL is untyped
; Test is a local untyped module in win32comext.axdebug
; verstamp is installed from win32verstamp.py called in setup.py
; 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-verstamp,win32com.*,Test,pywin32_system32]
[mypy-pywin32_system32,OpenGL.*,Test,verstamp,win32com.*]
ignore_missing_imports = True

; Distutils being removed from stdlib currently causes some issues on Python 3.12
Expand Down

0 comments on commit b55f76e

Please sign in to comment.