...
 
Commits (3)
    https://gitcode.net/opencv/opencv-python/-/commit/3dee384cd4ccaba03f7ff86a21916efb97b4cc67 Try to add pyi files to package. 2023-06-01T13:49:12+03:00 Alexander Smorkalov alexander.smorkalov@xperience.ai https://gitcode.net/opencv/opencv-python/-/commit/e4da6a05bb3158c44de46425d3b675e9548f3438 Update OpenCV to current 4.x to get PR #20370 2023-06-08T19:39:31+03:00 Alexander Smorkalov alexander.smorkalov@xperience.ai https://gitcode.net/opencv/opencv-python/-/commit/b534ea27a65acc766575bdface4abc984178eee8 Merge pull request #853 from asmorkalov/as/add_pyi_to_package 2023-06-10T09:20:19+03:00 Alexander Smorkalov 2536374+asmorkalov@users.noreply.github.com Try to add pyi files to package
Subproject commit 725e440d278aca07d35a5e8963ef990572b07316
Subproject commit 2104d61d4a3fb363e5c7d29a8d14eac038e2b3b2
Subproject commit e247b680a6bd396f110274b6c214406a93171350
Subproject commit 8dfeed73b9389ba09411498dc1e923431d7fe292
Subproject commit 5abbd7e0546bbb34ae7487170383d3e571fb1dd1
Subproject commit 847035ec7e1d388def99ecee4905fb9b01d1cabf
......@@ -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 @@ class RearrangeCMakeOutput(object):
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 @@ class RearrangeCMakeOutput(object):
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:
......