Skip to content

Commit d20cc39

Browse files
committed
Use dev wheels of OpenCV 4.8 to include cv2.typing at runtime
1 parent 6c3c781 commit d20cc39

13 files changed

+856
-484
lines changed

res/opencv_python_headless-4.7.0+772599a-cp37-abi3-win_amd64.whl renamed to res/opencv_python_headless-4.8.0+4f81552-cp37-abi3-win_amd64.whl

35.9 MB
Binary file not shown.

scripts/requirements.txt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,18 @@ certifi
77
ImageHash>=4.3.1 # Contains type information + setup as package not module
88
git+https://github.com/boppreh/keyboard.git#egg=keyboard # Fix install on macos and linux-ci https://github.com/boppreh/keyboard/pull/568
99
numpy>=1.23.2 # Python 3.11 wheels
10-
# wheel-0-1-0-x64 from https://github.com/opencv/opencv-python/actions/runs/5227795017
11-
./res/opencv_python_headless-4.7.0+772599a-cp37-abi3-win_amd64.whl # New typing + OBS Camera fixes
10+
# From https://github.com/opencv/opencv-python/actions/runs/5461702800
11+
./res/opencv_python_headless-4.8.0+4f81552-cp37-abi3-win_amd64.whl
12+
# opencv-python-headless>=4.8.0.74 # New typing + OBS Camera fixes
1213
packaging
1314
Pillow>=9.2 # gnome-screeshot checks
1415
psutil
1516
PyAutoGUI
16-
PyWinCtl>=0.0.42 # py.typed
17-
PySide6-Essentials>=6.5.1 # fixes incomplete tuple return types https://bugreports.qt.io/browse/PYSIDE-2285
17+
PyWinCtl>=0.0.42 # py.typed
18+
PySide6-Essentials>=6.5.1 # fixes incomplete tuple return types https://bugreports.qt.io/browse/PYSIDE-2285
1819
requests<=2.28.1 # 2.28.2 has issues with PyInstaller https://github.com/pyinstaller/pyinstaller-hooks-contrib/issues/534
1920
toml
20-
typing-extensions>=4.4.0 # @override decorator support
21+
typing-extensions>=4.4.0 # @override decorator support
2122
#
2223
# Build and compile resources
2324
pyinstaller>=5.5 # Python 3.11 support

src/AutoSplit.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
from collections.abc import Callable
99
from time import time
1010
from types import FunctionType
11-
from typing import TYPE_CHECKING, NoReturn
11+
from typing import NoReturn
1212

1313
import certifi
1414
import cv2
15+
import cv2.typing
1516
from psutil import process_iter
1617
from PySide6 import QtCore, QtGui
1718
from PySide6.QtTest import QTest
@@ -49,9 +50,6 @@
4950
open_file,
5051
)
5152

52-
if TYPE_CHECKING:
53-
import cv2.typing
54-
5553
CHECK_FPS_ITERATIONS = 10
5654
DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = 2
5755

src/AutoSplitImage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
from typing import TYPE_CHECKING
77

88
import cv2
9+
import cv2.typing
910
import numpy as np
1011

1112
import error_messages
1213
from compare import COMPARE_METHODS_BY_INDEX, check_if_image_has_transparency
1314
from utils import BGR_CHANNEL_COUNT, MAXBYTE, ColorChannel, ImageShape, is_valid_image
1415

1516
if TYPE_CHECKING:
16-
import cv2.typing
1717

1818
from AutoSplit import AutoSplit
1919

src/capture_method/BitBltCaptureMethod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from typing import TYPE_CHECKING, cast
66

77
import cv2
8+
import cv2.typing
89
import numpy as np
910
import pywintypes
1011
import win32con
@@ -16,7 +17,6 @@
1617
from utils import BGRA_CHANNEL_COUNT, get_window_bounds, is_valid_hwnd, try_delete_dc
1718

1819
if TYPE_CHECKING:
19-
import cv2.typing
2020

2121
from AutoSplit import AutoSplit
2222

src/capture_method/CaptureMethodBase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
from typing import TYPE_CHECKING
44

55
import cv2
6+
import cv2.typing
67

78
from utils import is_valid_hwnd
89

910
if TYPE_CHECKING:
10-
import cv2.typing
1111

1212
from AutoSplit import AutoSplit
1313

src/capture_method/VideoCaptureDeviceCaptureMethod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import cv2
77
import cv2.Error
8+
import cv2.typing
89
import numpy as np
910
from pygrabber.dshow_graph import FilterGraph
1011
from typing_extensions import override
@@ -14,7 +15,6 @@
1415
from utils import ImageShape, is_valid_image
1516

1617
if TYPE_CHECKING:
17-
import cv2.typing
1818

1919
from AutoSplit import AutoSplit
2020

src/capture_method/WindowsGraphicsCaptureMethod.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing import TYPE_CHECKING, cast
55

66
import cv2
7+
import cv2.typing
78
import numpy as np
89
from typing_extensions import override
910
from win32 import win32gui
@@ -17,7 +18,6 @@
1718
from utils import BGRA_CHANNEL_COUNT, WGC_MIN_BUILD, WINDOWS_BUILD_NUMBER, get_direct3d_device, is_valid_hwnd
1819

1920
if TYPE_CHECKING:
20-
import cv2.typing
2121

2222
from AutoSplit import AutoSplit
2323

src/compare.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
11
from __future__ import annotations
22

33
from math import sqrt
4-
from typing import TYPE_CHECKING
54

65
import cv2
6+
import cv2.typing
77
import imagehash
88
from PIL import Image
99

1010
from utils import BGRA_CHANNEL_COUNT, MAXBYTE, ColorChannel, ImageShape, is_valid_image
1111

12-
if TYPE_CHECKING:
13-
import cv2.typing
14-
1512
MAXRANGE = MAXBYTE + 1
1613
CHANNELS: list[int] = [ColorChannel.Red, ColorChannel.Green, ColorChannel.Blue]
1714
HISTOGRAM_SIZE = [8, 8, 8]

src/region_selection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from typing import TYPE_CHECKING
88

99
import cv2
10+
import cv2.typing
1011
import numpy as np
1112
from PySide6 import QtCore, QtGui, QtWidgets
1213
from PySide6.QtTest import QTest
@@ -31,8 +32,8 @@
3132

3233
user32 = ctypes.windll.user32
3334

35+
3436
if TYPE_CHECKING:
35-
import cv2.typing
3637

3738
from AutoSplit import AutoSplit
3839

0 commit comments

Comments
 (0)