Deprecate types-pywin32 in favor of pywin32-stubs

This commit is contained in:
belono 2023-10-12 16:55:23 +02:00
parent fe1b677f35
commit 72a1a10faa
3 changed files with 6 additions and 6 deletions

View File

@ -68,11 +68,13 @@ cups =
pycups; platform_system!='Windows'
win32 =
pywin32; platform_system=='Windows'
pywin32-stubs; platform_system=='Windows'
all =
pyusb>=1.0.0
pyserial
pycups; platform_system!='Windows'
pywin32; platform_system=='Windows'
pywin32-stubs; platform_system=='Windows'
[flake8]
exclude = .git,.tox,.github,.eggs,__pycache__,doc/conf.py,build,dist,capabilities-data,test,src/escpos/constants.py

View File

@ -20,8 +20,8 @@ _DEP_WIN32PRINT = False
try:
import _win32typing
import pywintypes
import win32helper.win32typing as _win32typing # pywin32-stubs package
import win32print
_DEP_WIN32PRINT = True
@ -92,9 +92,7 @@ class Win32Raw(Escpos):
"""Available Windows printers."""
return {
printer["pPrinterName"]: printer
for printer in win32print.EnumPrinters(
win32print.PRINTER_ENUM_NAME, None, 4
)
for printer in win32print.EnumPrinters(win32print.PRINTER_ENUM_NAME, "", 4)
}
@dependency_win32print
@ -124,7 +122,7 @@ class Win32Raw(Escpos):
] = win32print.OpenPrinter(self.printer_name)
if self.device:
self.current_job = win32print.StartDocPrinter(
self.device, (job_name, None, "RAW"), 1
self.device, 1, (job_name, None, "RAW")
)
win32print.StartPagePrinter(self.device)
except (AssertionError, pywintypes.error) as e:

View File

@ -57,7 +57,7 @@ deps = mypy
types-appdirs
types-Pillow
types-pyserial
types-pywin32
; types-pywin32
hypothesis>=6.83
jaconv
commands = mypy src test