diff --git a/opencv b/opencv index 725e440d..2104d61d 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 725e440d278aca07d35a5e8963ef990572b07316 +Subproject commit 2104d61d4a3fb363e5c7d29a8d14eac038e2b3b2 diff --git a/opencv_contrib b/opencv_contrib index e247b680..8dfeed73 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit e247b680a6bd396f110274b6c214406a93171350 +Subproject commit 8dfeed73b9389ba09411498dc1e923431d7fe292 diff --git a/opencv_extra b/opencv_extra index 5abbd7e0..847035ec 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 5abbd7e0546bbb34ae7487170383d3e571fb1dd1 +Subproject commit 847035ec7e1d388def99ecee4905fb9b01d1cabf diff --git a/setup.py b/setup.py index 203be547..5107e8ea 100644 --- a/setup.py +++ b/setup.py @@ -129,7 +129,10 @@ def main(): + [ r"python/cv2/.*config.*.py" - ], + ] + + + [ r"python/cv2/py.typed" ] if sys.version_info >= (3, 6) else [] + , "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" ], @@ -392,7 +395,6 @@ def _classify_installed_files_override( p.replace(os.path.sep, "/") for p in install_relpaths ] relpaths_zip = list(zip(fslash_install_relpaths, install_relpaths)) - del install_relpaths, fslash_install_relpaths final_install_relpaths = [] @@ -411,6 +413,19 @@ def _classify_installed_files_override( with open(config_py, 'w') as opencv_init_config: opencv_init_config.write(custom_init_data) + if sys.version_info >= (3, 6): + for p in install_relpaths: + if p.endswith(".pyi"): + target_rel_path = os.path.relpath(p, "python/cv2") + cls._setuptools_wrap._copy_file( + os.path.join(cmake_install_dir, p), + os.path.join(cmake_install_dir, "cv2", target_rel_path), + hide_listing=False, + ) + final_install_relpaths.append(os.path.join("cv2", target_rel_path)) + + del install_relpaths, fslash_install_relpaths + for package_name, relpaths_re in cls.package_paths_re.items(): package_dest_reldir = package_name.replace(".", os.path.sep) for relpath_re in relpaths_re: