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/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/README.md b/README.md index 32eb8ecc..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) @@ -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 diff --git a/opencv b/opencv index 62252d15..b1cf5501 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 +Subproject commit b1cf5501233405de3ea5926d1d688e421b337458 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/setup.py b/setup.py index b0490ca2..9dcc030e 100644 --- a/setup.py +++ b/setup.py @@ -365,8 +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(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(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 - with open('scripts/__init__.py', '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: diff --git a/travis_config.sh b/travis_config.sh index 937e5a2d..6d6cc06b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -12,16 +12,16 @@ 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 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 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