diff --git a/pyproject.toml b/pyproject.toml index 81a4b40b11a..33a43c78352 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,7 @@ test = [ "types-setuptools>=57.0.0", "types-tabulate>=0.1.0", "types-tqdm>=4.64.6", + "types_pywin32>=305.0.0.7" ] docs = [ "autodocsumm>=0.2.9", @@ -211,7 +212,6 @@ module = [ "mcl_RF_Switch_Controller64", "mcl_RF_Switch_Controller_NET45", "opencensus.ext.azure.*", - "pythoncom", "pyqtgraph.*", "pywinusb.*", "ruamel", @@ -219,9 +219,6 @@ module = [ "spyder_kernels.customize", "System.IO", "uncertainties", - "win32com.*", - "win32con", - "win32gui", "wrapt", "zhinst.qcodes", ] diff --git a/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/private/commandhandler.py b/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/private/commandhandler.py index e2e8ab6e9e5..44485c11a70 100644 --- a/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/private/commandhandler.py +++ b/qcodes/instrument_drivers/QuantumDesign/DynaCoolPPMS/private/commandhandler.py @@ -10,10 +10,9 @@ import win32com.client from pythoncom import VT_BYREF, VT_I4, VT_R8 except ImportError as e: - message = ('To use the DynaCool Driver, please install win32com.' - ' Installation can be done with pip install pypiwin32com') + message = "To use the DynaCool Driver, please install pywin32." log.exception(message) - raise ImportError(message) + raise ImportError(message) from e CmdArgs = namedtuple('CmdArgs', 'cmd args') diff --git a/qcodes/utils/qt_helpers.py b/qcodes/utils/qt_helpers.py index d7d918c8b50..94cdfad2397 100644 --- a/qcodes/utils/qt_helpers.py +++ b/qcodes/utils/qt_helpers.py @@ -25,8 +25,9 @@ def foreground_qt_window(window: "QMainWindow") -> None: # use the idea from # https://stackoverflow.com/questions/12118939/how-to-make-a-pyqt4-window-jump-to-the-front SetWindowPos( - window.winId(), # pyright: ignore[reportGeneralTypeIssues] - win32con.HWND_TOPMOST, # = always on top. only reliable way to bring it to the front on windows + int(window.winId()), + win32con.HWND_TOPMOST, + # = always on top. only reliable way to bring it to the front on windows 0, 0, 0, @@ -34,8 +35,9 @@ def foreground_qt_window(window: "QMainWindow") -> None: win32con.SWP_NOMOVE | win32con.SWP_NOSIZE | win32con.SWP_SHOWWINDOW, ) SetWindowPos( - window.winId(), # pyright: ignore[reportGeneralTypeIssues] - win32con.HWND_NOTOPMOST, # disable the always on top, but leave window at its top position + int(window.winId()), + win32con.HWND_NOTOPMOST, + # disable the always on top, but leave window at its top position 0, 0, 0,