From 71bad8c44157907595dfe50ec36904d00a30466a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 17:56:25 +0300 Subject: [PATCH 1/8] Fixed a build from the source --- MANIFEST.in | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 45cb6c40..b429eae0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,3 +9,4 @@ recursive-include docker * recursive-include opencv * recursive-include opencv_contrib * recursive-include patches * +recursive-include scripts *.py diff --git a/setup.py b/setup.py index b0490ca2..f2cd93e9 100644 --- a/setup.py +++ b/setup.py @@ -366,7 +366,8 @@ def _classify_installed_files_override( print("Copying files from CMake output") # add lines from the old __init__.py file to the config file - with open('scripts/__init__.py', 'r') as custom_init: + with open('%s/scripts/__init__.py' + % os.path.split(os.path.abspath(__file__))[0], 'r') as custom_init: custom_init_data = custom_init.read() with open('%spython/cv2/config-%s.%s.py' % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: From 4d0bc7d528058b2e0fbcd44538ba6e4c8a69b49f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 18:07:48 +0300 Subject: [PATCH 2/8] Added 3.10 python version in the description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 32eb8ecc..da4e3605 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.7 - 3.8 - 3.9 +- 3.10 ### Backward compatibility From b408641e253f2853f2d6310c2b3c5ad522b595a8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 02:36:06 +0300 Subject: [PATCH 3/8] Moving to auditwheel==5.0.0 (default in the latest manylinux image) --- patch_auditwheel_whitelist.py | 7 +++---- travis_config.sh | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index d0cbf5b2..b32da17a 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -5,12 +5,11 @@ policies = None -with open(join(dirname(abspath(policy.__file__)), "policy.json")) as f: +with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: policies = json.load(f) for p in policies: - if p["name"] == "manylinux2014": - p["lib_whitelist"].append("libxcb.so.1") + p["lib_whitelist"].append("libxcb.so.1") -with open(join(dirname(abspath(policy.__file__)), "policy.json"), "w") as f: +with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: f.write(json.dumps(policies)) diff --git a/travis_config.sh b/travis_config.sh index 937e5a2d..2eb81faa 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -17,11 +17,11 @@ function bdist_wheel_cmd { CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then - TOOLS_PATH=/opt/_internal/tools - /opt/python/cp37-cp37m/bin/python -m venv $TOOLS_PATH + # this path can be changed in the latest manylinux image + TOOLS_PATH=/opt/_internal/pipx/venvs/auditwheel + /opt/python/cp39-cp39/bin/python -m venv $TOOLS_PATH source $TOOLS_PATH/bin/activate - python$PYTHON_VERSION -m pip install auditwheel==3.2.0 - python$PYTHON_VERSION patch_auditwheel_whitelist.py + python patch_auditwheel_whitelist.py # to avoid issues with numpy wheels rm /io/wheelhouse/numpy* deactivate From 31dde8a15b162bd7ce0bab48c071629f461acc0e Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Mon, 8 Nov 2021 09:57:24 +0800 Subject: [PATCH 4/8] Fix typos --- LICENSE-3RD-PARTY.txt | 6 +++--- README.md | 2 +- travis_config.sh | 2 +- travis_osx_brew_cache.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 87c0514e..1db522f7 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -840,7 +840,7 @@ This license applies to above binaries in the directory cv2/. * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions + * the following conditions are adhered to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms @@ -865,7 +865,7 @@ This license applies to above binaries in the directory cv2/. * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library + * The word 'cryptographic' can be left out if the routines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: @@ -883,7 +883,7 @@ This license applies to above binaries in the directory cv2/. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * The licence and distribution terms for any publically available version or + * The licence and distribution terms for any publicly available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] diff --git a/README.md b/README.md index da4e3605..522cc005 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it mak ## Documentation for opencv-python -[![Windows Buld Status](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml) +[![Windows Build Status](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml) [![(Linux Build status)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_linux.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_linux.yml) [![(Mac OS Build status)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_macos.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_macos.yml) diff --git a/travis_config.sh b/travis_config.sh index 2eb81faa..6d6cc06b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -12,7 +12,7 @@ function build_wheel { function bdist_wheel_cmd { # copied from multibuild's common_utils.sh - # add osx deployment target so it doesnt default to 10.6 + # add osx deployment target so it doesn't default to 10.6 local abs_wheelhouse=$1 CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 401265f2..1a2a1c6c 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -249,7 +249,7 @@ function _brew_install_and_cache_within_time_limit { for dep in $DEPS; do #TIME_LIMIT only has to be met if we'll be actually building the main project this iteration, i.e. after the "root" module installation #While we don't know that yet, we can make better use of Travis-given time with a laxer limit - #We still can't overrun TIME_HARD_LIMIT as that would't leave time to save the cache + #We still can't overrun TIME_HARD_LIMIT as that wouldn't leave time to save the cache _brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || return $? done From 85992312c5383bc94d0b6d43db0ac3ba378c53b1 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 15:38:20 +0300 Subject: [PATCH 5/8] Changed defining path to scripts/__init__.py file --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f2cd93e9..63179184 100644 --- a/setup.py +++ b/setup.py @@ -366,8 +366,7 @@ def _classify_installed_files_override( print("Copying files from CMake output") # add lines from the old __init__.py file to the config file - with open('%s/scripts/__init__.py' - % os.path.split(os.path.abspath(__file__))[0], 'r') as custom_init: + 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.%s.py' % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: From c50150e3a34cab34f51e412830cd2d8f0270aecb Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 14:14:30 +0300 Subject: [PATCH 6/8] Defined 3.4.16 tag for opencv submodule --- opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencv b/opencv index 62252d15..b1cf5501 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 +Subproject commit b1cf5501233405de3ea5926d1d688e421b337458 From 19ed0019b1272fcf6edbc9abcb88b9d06fbab200 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 15:24:13 +0300 Subject: [PATCH 7/8] Added lines for a proper work using pylint and an autocomplete in IDE --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 63179184..87f6c214 100644 --- a/setup.py +++ b/setup.py @@ -365,6 +365,18 @@ def _classify_installed_files_override( print("Copying files from CMake output") + # lines for a proper work using pylint and an autocomplete in IDE + with open("%spython/cv2/__init__.py" + % cmake_install_dir, 'r') as opencv_init: + opencv_init_lines = opencv_init.readlines() + extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n') + free_line_after_imports = 5 + opencv_init_lines.insert(free_line_after_imports, extra_imports) + + with open("%spython/cv2/__init__.py" + % cmake_install_dir, 'w') as opencv_final_init: + opencv_final_init.writelines(opencv_init_lines) + # 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() From 87e4f4d21cb267b222cbe69c082042d2a037836c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 18:41:19 +0300 Subject: [PATCH 8/8] Changed a string substitution to os.path.join --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 87f6c214..9dcc030e 100644 --- a/setup.py +++ b/setup.py @@ -366,15 +366,13 @@ def _classify_installed_files_override( print("Copying files from CMake output") # lines for a proper work using pylint and an autocomplete in IDE - with open("%spython/cv2/__init__.py" - % cmake_install_dir, 'r') as opencv_init: + with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init: opencv_init_lines = opencv_init.readlines() extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n') free_line_after_imports = 5 opencv_init_lines.insert(free_line_after_imports, extra_imports) - with open("%spython/cv2/__init__.py" - % cmake_install_dir, 'w') as opencv_final_init: + with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'w') as opencv_final_init: opencv_final_init.writelines(opencv_init_lines) # add lines from the old __init__.py file to the config file