未验证 提交 b534ea27 编写于 作者: A Alexander Smorkalov 提交者: GitHub

Merge pull request #853 from asmorkalov/as/add_pyi_to_package

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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册