Skip to content

Commit

Permalink
Support for latest opencv-python release (#1278)
Browse files Browse the repository at this point in the history
  • Loading branch information
JJReyka authored Nov 7, 2021
1 parent 7af77fe commit 3fc992f
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions cx_Freeze/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,23 @@ def load__ctypes(finder: ModuleFinder, module: Module) -> None:
finder.IncludeFiles(dll_path, Path("lib", dll_name))


def load_cv2(finder: ModuleFinder, module: Module) -> None:
"""
Versions of cv2 (opencv-python) above 4.5.3 require additional
configuration files.
Additionally, on Linux the opencv_python.libs directory is not
copied across for versions above 4.5.3 unless the cv2 package is
included.
"""
finder.IncludePackage('cv2')

dest_dir = Path("lib", "cv2")
cv2_dir = module.path[0]
for path in cv2_dir.glob("config*.py"):
finder.IncludeFiles(path, dest_dir / path.name)


def load_cx_Oracle(finder: ModuleFinder, module: Module) -> None:
"""
The cx_Oracle module implicitly imports datetime; make sure this
Expand Down

0 comments on commit 3fc992f

Please sign in to comment.