...
 
Commits (2)
    https://gitcode.net/opencv/opencv-python/-/commit/e10f83dba27433c035c11eab73a9ebd927b54300 Handle setup with and without PYTHON3_LIMITED_API. 2023-03-15T15:24:34+03:00 Alexander Smorkalov alexander.smorkalov@xperience.ai https://gitcode.net/opencv/opencv-python/-/commit/6b73d90fc3e50ba6858926d299b49f0228e19d68 Merge pull request #820 from asmorkalov/as/config_py_path 2023-03-16T10:00:43+03:00 Alexander Smorkalov 2536374+asmorkalov@users.noreply.github.com Handle setup with and without PYTHON3_LIMITED_API
......@@ -395,8 +395,14 @@ class RearrangeCMakeOutput(object):
# add lines from the old __init__.py file to the config file
with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init:
custom_init_data = custom_init.read()
with open('%spython/cv2/config-%s.py'
% (cmake_install_dir, sys.version_info[0]), 'w') as opencv_init_config:
# OpenCV generates config with different name for case with PYTHON3_LIMITED_API=ON
config_py = os.path.join(cmake_install_dir, 'python', 'cv2', 'config-%s.%s.py'
% (sys.version_info[0], sys.version_info[1]))
if not os.path.exists(config_py):
config_py = os.path.join(cmake_install_dir, 'python', 'cv2', 'config-%s.py' % sys.version_info[0])
with open(config_py, 'w') as opencv_init_config:
opencv_init_config.write(custom_init_data)
for package_name, relpaths_re in cls.package_paths_re.items():
......