From 091603176ecb979090f10f1f91883710c0c4bb3a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 5 Sep 2019 17:32:51 +0300 Subject: [PATCH 001/293] opencv 3.4.6 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 8f1356c3..33b765d7 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 8f1356c3c5b16721349582db461a2051653059e8 +Subproject commit 33b765d7979fd8a6038026aa44f6ff1a9c082b7b diff --git a/opencv_contrib b/opencv_contrib index 7292df62..f26c9836 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 7292df62624ded8af8035231435dfd17c93e1a80 +Subproject commit f26c98365da6af93cb5e49397b571190fca7bb55 From 3c8cf39d6cf44aca31220ced65f76778a20fae54 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 8 Jan 2019 19:12:16 +0200 Subject: [PATCH 002/293] try to disable __STRICT_ANSI__ on 32-bit linux --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 423a0ef2..4f484bef 100644 --- a/setup.py +++ b/setup.py @@ -146,6 +146,8 @@ def main(): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with # devtoolset-2 GCC 4.8.2 or vanilla GCC 4.9.4 # see https://github.com/skvark/opencv-python/issues/138 + if sys.platform.startswith('linux') and not x64: + cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__") # ABI config variables are introduced in PEP 425 if sys.version_info[:2] < (3, 2): From 29ddb368d4fb8b9178f8b7079b5f7bcc844713b4 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 25 Jan 2019 20:17:50 +0200 Subject: [PATCH 003/293] ignore py2.7 deprecation warning --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 19645421..3e755db9 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -179,6 +179,7 @@ before_test: - ps: | cd ${Env:APPVEYOR_BUILD_FOLDER}\tests + $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command" &"${Env:PYTHON}/python.exe" -m pip install --user (ls "../dist/opencv_*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 22efb62f8f5d99cec05b94b62f4bd0ed2e9a3724 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 26 Jan 2019 13:28:17 +0200 Subject: [PATCH 004/293] update travis xcode 8 to 8.3 --- .travis.yml | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6fb537d..7e775d04 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ cache: - $HOME/local_bottle_metadata # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - $HOME/.ccache - + matrix: fast_finish: true include: @@ -41,7 +41,7 @@ matrix: # default builds for MacOS - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -49,7 +49,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 @@ -57,7 +57,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -65,7 +65,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -73,7 +73,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -84,7 +84,7 @@ matrix: # headless builds for MacOS - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -92,7 +92,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 @@ -100,7 +100,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -108,7 +108,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -116,7 +116,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -127,7 +127,7 @@ matrix: # Contrib builds for MacOS - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -135,7 +135,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 @@ -143,7 +143,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -151,7 +151,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -159,7 +159,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -170,7 +170,7 @@ matrix: # headless contrib builds for MacOS - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -178,7 +178,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 @@ -186,7 +186,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -194,7 +194,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -202,7 +202,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -618,7 +618,7 @@ before_install: | source multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - + if [ -n "$IS_OSX" ]; then TAPS="$(brew --repository)/Library/Taps" if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then @@ -629,10 +629,10 @@ before_install: | cd $(dirname '\''{}'\'') git clean -fxd git status' \; - + brew_cache_cleanup fi - + before_install # Not interested in travis internal scripts' output set +x @@ -653,7 +653,7 @@ script: | #otherwise, Travis logic terminates prematurely #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 trap ERR - + test "$rc" -eq 0 before_cache: | @@ -667,10 +667,10 @@ before_cache: | fi brew_cache_cleanup - + fi set +x - + after_success: | # Upload wheels to pypi if requested if [ -n "$TRAVIS_TAG" ]; then From 52ab1f004aa0e3ef3017908039b23773df91f00d Mon Sep 17 00:00:00 2001 From: Christian Vallentin Date: Thu, 31 Jan 2019 15:33:41 +0100 Subject: [PATCH 005/293] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0264fa43..32e5687b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ 1. If you have previous/other manually installed (= not installed via ``pip``) version of OpenCV installed (e.g. cv2 module in the root of Python's site-packages), remove it before installation to avoid conflicts. 2. Select the correct package for your environment: - There are four different packages and you should **select only one of them**. Do not install multiple different packages in the same enviroment. There is no plugin architecture: all the packages use the same namespace (`cv2`). If you installed multiple different packages in the same environment, uninstall them all with ``pip uninstall`` and reinstall only one package. + There are four different packages and you should **select only one of them**. Do not install multiple different packages in the same environment. There is no plugin architecture: all the packages use the same namespace (`cv2`). If you installed multiple different packages in the same environment, uninstall them all with ``pip uninstall`` and reinstall only one package. **a.** Packages for standard desktop environments (Windows, macOS, almost any GNU/Linux distribution) From 27c23744185c6b95217ae64aba874d77743c4a0b Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 17 Feb 2019 21:51:31 +0200 Subject: [PATCH 006/293] Revert "update travis xcode 8 to 8.3" This reverts commit 5288ba5fa2603975d1ee36544b11c2a45b7adc1e. --- .travis.yml | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7e775d04..a6fb537d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ cache: - $HOME/local_bottle_metadata # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - $HOME/.ccache - + matrix: fast_finish: true include: @@ -41,7 +41,7 @@ matrix: # default builds for MacOS - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -49,7 +49,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 @@ -57,7 +57,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -65,7 +65,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -73,7 +73,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -84,7 +84,7 @@ matrix: # headless builds for MacOS - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -92,7 +92,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 @@ -100,7 +100,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -108,7 +108,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -116,7 +116,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -127,7 +127,7 @@ matrix: # Contrib builds for MacOS - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -135,7 +135,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 @@ -143,7 +143,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -151,7 +151,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -159,7 +159,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -170,7 +170,7 @@ matrix: # headless contrib builds for MacOS - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -178,7 +178,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 @@ -186,7 +186,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -194,7 +194,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -202,7 +202,7 @@ matrix: - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx language: generic - osx_image: xcode8.3 + osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -618,7 +618,7 @@ before_install: | source multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - + if [ -n "$IS_OSX" ]; then TAPS="$(brew --repository)/Library/Taps" if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then @@ -629,10 +629,10 @@ before_install: | cd $(dirname '\''{}'\'') git clean -fxd git status' \; - + brew_cache_cleanup fi - + before_install # Not interested in travis internal scripts' output set +x @@ -653,7 +653,7 @@ script: | #otherwise, Travis logic terminates prematurely #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 trap ERR - + test "$rc" -eq 0 before_cache: | @@ -667,10 +667,10 @@ before_cache: | fi brew_cache_cleanup - + fi set +x - + after_success: | # Upload wheels to pypi if requested if [ -n "$TRAVIS_TAG" ]; then From 356a968aa95a6f6038e6af38504cfe51c525f708 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 17 Feb 2019 22:16:54 +0200 Subject: [PATCH 007/293] remove --merge --- config.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.sh b/config.sh index 3bdacd2f..94eaf051 100644 --- a/config.sh +++ b/config.sh @@ -29,24 +29,24 @@ fi if [ -n "$IS_OSX" ]; then source travis_osx_brew_cache.sh - + BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \ "x265 20" \ "cmake 15" \ "ffmpeg_opencv 10" \ ) - + #Contrib adds significantly to project's build time if [ "$ENABLE_CONTRIB" -eq 1 ]; then BREW_TIME_LIMIT=$((BREW_TIME_LIMIT - 10*60)) fi - + function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" - + local REGENERATE if [ -f "$LFF_FORMULA" ]; then local UPSTREAM_VERSION VERSION @@ -82,7 +82,7 @@ if (/^\s*depends_on "(x264|x265|xvid)"$/) {$_=""; next;} ) fi } - + fi function pre_build { @@ -91,8 +91,8 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" - - brew update --merge + + brew update brew_add_local_bottles # Don't query analytical info online on `brew info`, From 10be7e56c0712bb3cc22e3d52766a3f4c1dca3ca Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 19 Feb 2019 19:33:17 +0200 Subject: [PATCH 008/293] Revert "remove --merge" This reverts commit 0e788e25f4a205832dac6c09dccc9180acd29b73. --- config.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.sh b/config.sh index 94eaf051..3bdacd2f 100644 --- a/config.sh +++ b/config.sh @@ -29,24 +29,24 @@ fi if [ -n "$IS_OSX" ]; then source travis_osx_brew_cache.sh - + BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \ "x265 20" \ "cmake 15" \ "ffmpeg_opencv 10" \ ) - + #Contrib adds significantly to project's build time if [ "$ENABLE_CONTRIB" -eq 1 ]; then BREW_TIME_LIMIT=$((BREW_TIME_LIMIT - 10*60)) fi - + function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" - + local REGENERATE if [ -f "$LFF_FORMULA" ]; then local UPSTREAM_VERSION VERSION @@ -82,7 +82,7 @@ if (/^\s*depends_on "(x264|x265|xvid)"$/) {$_=""; next;} ) fi } - + fi function pre_build { @@ -91,8 +91,8 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" - - brew update + + brew update --merge brew_add_local_bottles # Don't query analytical info online on `brew info`, From e78ecbddff746f59d15305469f70447ce910fdb3 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 19 Feb 2019 19:56:42 +0200 Subject: [PATCH 009/293] try --force --- config.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/config.sh b/config.sh index 3bdacd2f..fee87537 100644 --- a/config.sh +++ b/config.sh @@ -29,24 +29,24 @@ fi if [ -n "$IS_OSX" ]; then source travis_osx_brew_cache.sh - + BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \ "x265 20" \ "cmake 15" \ "ffmpeg_opencv 10" \ ) - + #Contrib adds significantly to project's build time if [ "$ENABLE_CONTRIB" -eq 1 ]; then BREW_TIME_LIMIT=$((BREW_TIME_LIMIT - 10*60)) fi - + function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" - + local REGENERATE if [ -f "$LFF_FORMULA" ]; then local UPSTREAM_VERSION VERSION @@ -82,7 +82,7 @@ if (/^\s*depends_on "(x264|x265|xvid)"$/) {$_=""; next;} ) fi } - + fi function pre_build { @@ -91,8 +91,8 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" - - brew update --merge + + brew update --force brew_add_local_bottles # Don't query analytical info online on `brew info`, From c824854d72034a1863a49a72af73988c05cc5e4b Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 23 Mar 2019 20:53:41 +0300 Subject: [PATCH 010/293] Remove redundant language:generic --- .travis.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6fb537d..16b6025f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -40,7 +40,6 @@ matrix: # default builds for MacOS - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 @@ -48,7 +47,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 @@ -56,7 +54,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 @@ -64,7 +61,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 @@ -72,7 +68,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 @@ -83,7 +78,6 @@ matrix: # headless builds for MacOS - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 @@ -91,7 +85,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 @@ -99,7 +92,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 @@ -107,7 +99,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 @@ -115,7 +106,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 @@ -126,7 +116,6 @@ matrix: # Contrib builds for MacOS - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 @@ -134,7 +123,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 @@ -142,7 +130,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 @@ -150,7 +137,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 @@ -158,7 +144,6 @@ matrix: - ENABLE_HEADLESS=0 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 @@ -169,7 +154,6 @@ matrix: # headless contrib builds for MacOS - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=2.7 @@ -177,7 +161,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 @@ -185,7 +168,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 @@ -193,7 +175,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 @@ -201,7 +182,6 @@ matrix: - ENABLE_HEADLESS=1 - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx - language: generic osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 From 008134fed4b9f778d8689763e42246c5de65f20b Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 22 Mar 2019 00:44:02 +0300 Subject: [PATCH 011/293] Move CMAKE_OSX_DEPLOYMENT_TARGET to setup.py --- .travis.yml | 20 -------------------- setup.py | 1 + 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/.travis.yml b/.travis.yml index 16b6025f..5945c9d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,35 +45,30 @@ matrix: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - TEST_DEPENDS=numpy==1.14.5 # headless builds for MacOS @@ -83,35 +78,30 @@ matrix: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - TEST_DEPENDS=numpy==1.14.5 # Contrib builds for MacOS @@ -121,35 +111,30 @@ matrix: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - TEST_DEPENDS=numpy==1.14.5 # headless contrib builds for MacOS @@ -159,35 +144,30 @@ matrix: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - os: osx osx_image: xcode8 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - BDIST_PARAMS="-- -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7" - TEST_DEPENDS=numpy==1.14.5 # default builds for Linux diff --git a/setup.py b/setup.py index 4f484bef..108cdc43 100644 --- a/setup.py +++ b/setup.py @@ -141,6 +141,7 @@ def main(): cmake_args.append("-DWITH_LAPACK=OFF") # Some OSX LAPACK fns are incompatible, see # https://github.com/skvark/opencv-python/issues/21 cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++") + cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7") if sys.platform.startswith('linux'): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with From 059fea0437e12e6673523b9cc352dd012a4f526f Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 22 Mar 2019 01:16:35 +0300 Subject: [PATCH 012/293] * No need for both OPENCV_PYTHON{2,3}_INSTALL_PATH in cmake args * Add explanation to more obscure cmake args --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 108cdc43..fa70f5a3 100644 --- a/setup.py +++ b/setup.py @@ -102,12 +102,16 @@ def main(): # skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3 "-DPYTHON%d_EXECUTABLE=%s" % (sys.version_info[0], sys.executable), "-DBUILD_opencv_python%d=ON" % sys.version_info[0], + + # When off, adds __init__.py and a few more helper .py's. We use our own helper files with a different structure. "-DOPENCV_SKIP_PYTHON_LOADER=ON", - "-DOPENCV_PYTHON2_INSTALL_PATH=python", - "-DOPENCV_PYTHON3_INSTALL_PATH=python", + # Relative dir to install the built module to in the build tree. + # The default is generated from sysconfig, we'd rather have a constant for simplicity + "-DOPENCV_PYTHON%d_INSTALL_PATH=python" % sys.version_info[0], # Otherwise, opencv scripts would want to install `.pyd' right into site-packages, # and skbuild bails out on seeing that "-DINSTALL_CREATE_DISTRIB=ON", + # See opencv/CMakeLists.txt for options and defaults "-DBUILD_opencv_apps=OFF", "-DBUILD_SHARED_LIBS=OFF", From 1b6fa44f5d305e7b71d114841cfcc09647030047 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 21 Mar 2019 16:43:05 +0300 Subject: [PATCH 013/293] Upgrade to Xcode 8.3 --- .travis.yml | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5945c9d5..e7e9a5f0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,38 +33,38 @@ cache: - $HOME/local_bottle_metadata # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - $HOME/.ccache - + matrix: fast_finish: true include: # default builds for MacOS - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -73,31 +73,31 @@ matrix: # headless builds for MacOS - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -106,31 +106,31 @@ matrix: # Contrib builds for MacOS - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -139,31 +139,31 @@ matrix: # headless contrib builds for MacOS - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - os: osx - osx_image: xcode8 + osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -578,7 +578,7 @@ before_install: | source multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - + if [ -n "$IS_OSX" ]; then TAPS="$(brew --repository)/Library/Taps" if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then @@ -589,10 +589,10 @@ before_install: | cd $(dirname '\''{}'\'') git clean -fxd git status' \; - + brew_cache_cleanup fi - + before_install # Not interested in travis internal scripts' output set +x @@ -613,7 +613,7 @@ script: | #otherwise, Travis logic terminates prematurely #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 trap ERR - + test "$rc" -eq 0 before_cache: | @@ -627,10 +627,10 @@ before_cache: | fi brew_cache_cleanup - + fi set +x - + after_success: | # Upload wheels to pypi if requested if [ -n "$TRAVIS_TAG" ]; then From 10c7cfa6fb470b258b0b229bcba03a7824cdcf3b Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Tue, 19 Mar 2019 15:41:56 +0300 Subject: [PATCH 014/293] Diagnostics for a `find -exec git clean` failure --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index e7e9a5f0..130df767 100644 --- a/.travis.yml +++ b/.travis.yml @@ -586,9 +586,10 @@ before_install: | fi find "$TAPS" -type d -name .git -exec \ bash -xec ' - cd $(dirname '\''{}'\'') - git clean -fxd - git status' \; + cd $(dirname '\''{}'\'') || echo "status: $?" + git clean -fxd || echo "status: $?" + sleep 1 || echo "status: $?" + git status || echo "status: $?"' \; || echo "status: $?" brew_cache_cleanup fi From e7a5b665c4af2ec0ba4bf801d890bce04bb43fc1 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Tue, 19 Mar 2019 12:51:03 +0300 Subject: [PATCH 015/293] Fix/improve travis_osx_brew_cache & caching logic * fix built bottle & metadata cleanup when bottle is missing * -e mode for before_cache step * faster finish when already the latest version --- .travis.yml | 4 ++-- travis_osx_brew_cache.sh | 15 +++++++++------ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 130df767..8772517e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -619,7 +619,7 @@ script: | before_cache: | # Cleanup dirs to be cached - set -x + set -e; set -x if [ -n "$IS_OSX" ]; then # When Taps is cached, this dir causes "Error: file exists" on `brew update` @@ -630,7 +630,7 @@ before_cache: | brew_cache_cleanup fi - set +x + set +x; set +e after_success: | # Upload wheels to pypi if requested diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 47d37326..8d2401b2 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -41,6 +41,12 @@ function brew_install_and_cache_within_time_limit { local BUILD_FROM_SOURCE INCLUDE_BUILD + if brew list --versions "$PACKAGE" && ! (brew outdated | grep -qx "$PACKAGE"); then + echo "Already installed and the latest version: $PACKAGE" + return 0 + fi + + _brew_is_bottle_available "$PACKAGE" || BUILD_FROM_SOURCE=1 [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true @@ -152,7 +158,7 @@ function brew_add_local_bottles { ) fi - if [ -n "$BOTTLE" ]; then rm "$BOTTLE"; fi + if [ -n "$BOTTLE" -a -n "$BOTTLE_EXISTS" ]; then rm "$BOTTLE"; fi rm -f "$BOTTLE_LINK" rm "$JSON" @@ -295,17 +301,14 @@ function _brew_is_bottle_available { function _brew_install_and_cache { # Install bottle or make and cache bottle. - # assumes that deps were already installed. + # assumes that deps were already installed + # and not already the latest version local PACKAGE;PACKAGE="${1:?}" local USE_BOTTLE;USE_BOTTLE="${2:?}" local VERB if brew list --versions "$PACKAGE"; then - if ! (brew outdated | grep -qx "$PACKAGE"); then - echo "Already the latest version: $PACKAGE" - return 0 - fi VERB=upgrade else VERB=install From 5916c66207a8eb50d074f70793aa509e0e7bda07 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Tue, 19 Mar 2019 13:10:38 +0300 Subject: [PATCH 016/293] Update caching logic to support new Homebrew in OSX 10.12 * disable auto `brew cleanup` * support formulae with disabled bottles * install alongside to avoid "runtime dependents" update https://discourse.brew.sh/t/can-i-install-a-new-version-without-having-to-upgrade-runtime-dependents/4443 --- config.sh | 4 +-- travis_osx_brew_cache.sh | 59 ++++++++++++++++++++++++++++------------ 2 files changed, 44 insertions(+), 19 deletions(-) diff --git a/config.sh b/config.sh index fee87537..ead68645 100644 --- a/config.sh +++ b/config.sh @@ -92,14 +92,14 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" - brew update --force + brew update brew_add_local_bottles # Don't query analytical info online on `brew info`, # this takes several seconds and we don't need it # see https://docs.brew.sh/Manpage , "info formula" section export HOMEBREW_NO_GITHUB_API=1 - + echo 'Installing QT4' brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4 diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 8d2401b2..c62a6235 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -24,6 +24,11 @@ BREW_TIME_LIMIT=$((30*60)) BREW_TIME_HARD_LIMIT=$((40*60)) +# Auto cleanup can delete locally-built bottles +# when the caching logic isn't prepared for that +export HOMEBREW_NO_INSTALL_CLEANUP=1 + + #Public functions @@ -34,12 +39,12 @@ function brew_install_and_cache_within_time_limit { # Exit with status 2 on any other error. ( eval "$_BREW_ERREXIT" - local PACKAGE; PACKAGE="${1:?}" || return 2 - local TIME_LIMIT;TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || return 2 - local TIME_HARD_LIMIT;TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || return 2 - local TIME_START;TIME_START=${4:-$BREW_TIME_START} || return 2 + local PACKAGE; PACKAGE="${1:?}" || exit 2 + local TIME_LIMIT;TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || exit 2 + local TIME_HARD_LIMIT;TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || exit 2 + local TIME_START;TIME_START=${4:-$BREW_TIME_START} || exit 2 - local BUILD_FROM_SOURCE INCLUDE_BUILD + local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY if brew list --versions "$PACKAGE" && ! (brew outdated | grep -qx "$PACKAGE"); then echo "Already installed and the latest version: $PACKAGE" @@ -47,21 +52,21 @@ function brew_install_and_cache_within_time_limit { fi - _brew_is_bottle_available "$PACKAGE" || BUILD_FROM_SOURCE=1 + _brew_is_bottle_available "$PACKAGE" KEG_ONLY || BUILD_FROM_SOURCE=1 [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true # Whitespace is illegal in package names so converting all whitespace into single spaces due to no quotes is okay. - DEPS=`brew deps "$PACKAGE" $INCLUDE_BUILD` || return 2 + DEPS=`brew deps "$PACKAGE" $INCLUDE_BUILD` || exit 2 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 - brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || return $? + brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || exit $? done - _brew_check_slow_building_ahead "$PACKAGE" "$TIME_START" "$TIME_HARD_LIMIT" || return $? - _brew_install_and_cache "$PACKAGE" "$([[ -z "$INCLUDE_BUILD" ]] && echo 1 || echo 0)" || return 2 - _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || return $? + _brew_check_slow_building_ahead "$PACKAGE" "$TIME_START" "$TIME_HARD_LIMIT" || exit $? + _brew_install_and_cache "$PACKAGE" "$([[ -z "$BUILD_FROM_SOURCE" ]] && echo 1 || echo 0)" "$KEG_ONLY" || exit 2 + _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || exit $? ) \ || if test $? -eq 1; then brew_go_bootstrap_mode; return 1; else return 2; fi #must run this in current process } @@ -288,8 +293,22 @@ function _brew_parse_package_info { function _brew_is_bottle_available { local PACKAGE;PACKAGE="${1:?}" - - local INFO="$(brew info "$PACKAGE" | head -n 1)" + local VAR_KEG_ONLY="$2" + + local INFO;INFO="$(brew info "$PACKAGE" | head -n 1)" + if [ -n "$VAR_KEG_ONLY" ]; then + if grep -qwF '[keg-only]' <<<"$INFO"; then + eval "${VAR_KEG_ONLY}=1" + else + eval "${VAR_KEG_ONLY}=0" + fi + fi + + if grep -qxEe '[[:space:]]*bottle :unneeded' $(brew formula "$PACKAGE"); then + echo "Bottle disabled: $PACKAGE" + return 0 + fi + if grep -qwF '(bottled)' <<<"$INFO"; then echo "Bottle available: $INFO" return 0 @@ -306,10 +325,16 @@ function _brew_install_and_cache { local PACKAGE;PACKAGE="${1:?}" local USE_BOTTLE;USE_BOTTLE="${2:?}" + local KEG_ONLY;KEG_ONLY="${3:?}" local VERB - if brew list --versions "$PACKAGE"; then - VERB=upgrade + if brew list --versions "$PACKAGE" >/dev/null; then + # Install alongside the old version to avoid to have to update "runtime dependents" + # https://discourse.brew.sh/t/can-i-install-a-new-version-without-having-to-upgrade-runtime-dependents/4443 + VERB="install --force" + if [ "$KEG_ONLY" -eq 0 ]; then + brew unlink "$PACKAGE" + fi else VERB=install fi @@ -328,8 +353,8 @@ function _brew_install_and_cache { # doesn't seem to be a documented way to get file names local BOTTLE; BOTTLE=$(grep -Ee '^./' <<<"$OUT") #proper procedure as per https://discourse.brew.sh/t/how-are-bottle-and-postinstall-related-is-it-safe-to-run-bottle-after-postinstall/3410/4 - brew uninstall "$PACKAGE" - brew install "$BOTTLE" + brew uninstall --ignore-dependencies "$PACKAGE" + brew $VERB "$BOTTLE" local JSON; JSON=$(sed -E 's/bottle(.[[:digit:]]+)?\.tar\.gz$/bottle.json/' <<<"$BOTTLE") From 6af897d7dfa15be1abf8fa489a66180215e3579e Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 21 Mar 2019 12:33:04 +0300 Subject: [PATCH 017/293] Install macpython late to avoid conflict with Homebrew python upgrade --- .travis.yml | 2 -- config.sh | 12 +++++++++--- travis_osx_brew_cache.sh | 2 ++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8772517e..632af248 100644 --- a/.travis.yml +++ b/.travis.yml @@ -594,7 +594,6 @@ before_install: | brew_cache_cleanup fi - before_install # Not interested in travis internal scripts' output set +x @@ -602,7 +601,6 @@ install: | # Build and package set -x build_wheel $REPO_DIR $PLAT - if [ -n "$USE_CCACHE" ]; then ccache --show-stats; fi set +x script: | diff --git a/config.sh b/config.sh index ead68645..22d16066 100644 --- a/config.sh +++ b/config.sh @@ -16,6 +16,7 @@ function bdist_wheel_cmd { local abs_wheelhouse=$1 python setup.py bdist_wheel $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse + if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache --show-stats; fi } if [ -n "$IS_OSX" ]; then @@ -99,7 +100,7 @@ function pre_build { # this takes several seconds and we don't need it # see https://docs.brew.sh/Manpage , "info formula" section export HOMEBREW_NO_GITHUB_API=1 - + echo 'Installing QT4' brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4 @@ -108,8 +109,13 @@ function pre_build { echo 'Installing FFmpeg' generate_ffmpeg_formula - brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } - + local IS_BOTTLE_AVAILABLE; _brew_is_bottle_available ffmpeg_opencv && IS_BOTTLE_AVAILABLE=1 || IS_BOTTLE_AVAILABLE=0 + _brew_install_and_cache ffmpeg_opencv "$IS_BOTTLE_AVAILABLE" + #brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } + + # Have to install macpython late to avoid conflict with Homebrew Python update + before_install + else echo "Running for linux" fi diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index c62a6235..261e1d00 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -215,6 +215,8 @@ function brew_go_bootstrap_mode { # Terminate the build but ensure saving the cache echo "Going into cache bootstrap mode" + + BREW_BOOTSTRAP_MODE=1 #Can't just `exit` because that would terminate the build without saving the cache #Have to replace further actions with no-ops From 6e8f51643217805af7cee13cbc148b5356b2284a Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 21 Mar 2019 22:11:08 +0300 Subject: [PATCH 018/293] OSX custom ffmpeg formula: disable GPLed frei0r, librubberband --- config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.sh b/config.sh index 22d16066..59c40ee3 100644 --- a/config.sh +++ b/config.sh @@ -70,8 +70,8 @@ if [ -n "$IS_OSX" ]; then if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;} if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; } if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; } -if (/^\s*depends_on "(x264|x265|xvid)"$/) {$_=""; next;} - if (/^\s*--enable-(gpl|libx264|libx265|libxvid)$/) {$_=""; next;} +if (/^\s*depends_on "(x264|x265|xvid|frei0r|rubberband)"$/) {$_=""; next;} + if (/^\s*--enable-(gpl|libx264|libx265|libxvid|frei0r|librubberband)$/) {$_=""; next;} ' <"$FF_FORMULA" >"$LFF_FORMULA" diff -u "$FF_FORMULA" "$LFF_FORMULA" || test $? -le 1 From cbfa320e02d0c0545244bd053d05e964cb7dfc32 Mon Sep 17 00:00:00 2001 From: Admin Date: Fri, 22 Mar 2019 02:34:10 +0300 Subject: [PATCH 019/293] Adapt setup.py hook for skbuild 0.9.0 --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fa70f5a3..a6494914 100644 --- a/setup.py +++ b/setup.py @@ -268,7 +268,7 @@ def _classify_installed_files_override(self, install_paths, # 'relpath'/'reldir' = relative to CMAKE_INSTALL_DIR/cmake_install_dir # 'path'/'dir' = relative to sourcetree root - cmake_install_dir = os.path.join(cls._setuptools_wrap.CMAKE_INSTALL_DIR, + cmake_install_dir = os.path.join(cls._setuptools_wrap.CMAKE_INSTALL_DIR(), cmake_install_reldir) install_relpaths = [os.path.relpath(p, cmake_install_dir) for p in install_paths] fslash_install_relpaths = [p.replace(os.path.sep, '/') for p in install_relpaths] From b9350e7d17d96fdcb3dfe36cded2a51412a5f7e2 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 22 Mar 2019 23:04:51 +0300 Subject: [PATCH 020/293] Reduce the amount of trace output * Reduce the number of command lines executed in most used functions * List existing versions only when installing --- travis_osx_brew_cache.sh | 51 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 261e1d00..69dbf729 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -1,12 +1,5 @@ # Library to cache downloaded and locally-built Homebrew bottles in Travis OSX build. -_BREW_ERREXIT=' -set -e -o pipefail -trap '\''{ sleep 3; #if we terminale too abruptly, Travis will lose some log output - exit 2; #The trap isn''t called in the parent function, so can''t use `return` here. - #`exit` will terminate the entire build but it seems we have no choice. -}'\'' ERR -set -E' #Should be in Travis' cache BREW_LOCAL_BOTTLE_METADATA="$HOME/local_bottle_metadata" @@ -37,16 +30,17 @@ function brew_install_and_cache_within_time_limit { # use bottle if available, build and cache bottle if not. # Terminate and exit with status 1 if this takes too long. # Exit with status 2 on any other error. - ( eval "$_BREW_ERREXIT" - - local PACKAGE; PACKAGE="${1:?}" || exit 2 - local TIME_LIMIT;TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || exit 2 - local TIME_HARD_LIMIT;TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || exit 2 - local TIME_START;TIME_START=${4:-$BREW_TIME_START} || exit 2 + ( set -eE -o pipefail; trap '{ sleep 3; exit 2; }' ERR + + local PACKAGE TIME_LIMIT TIME_HARD_LIMIT TIME_START + PACKAGE="${1:?}" || exit 2 + TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || exit 2 + TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || exit 2 + TIME_START=${4:-$BREW_TIME_START} || exit 2 local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY - if brew list --versions "$PACKAGE" && ! (brew outdated | grep -qx "$PACKAGE"); then + if brew list --versions "$PACKAGE" >/dev/null && ! (brew outdated | grep -qxF "$PACKAGE"); then echo "Already installed and the latest version: $PACKAGE" return 0 fi @@ -266,8 +260,9 @@ function _brew_parse_package_info { # Get and parse `brew info --json` about a package # and save data into specified variables - local PACKAGE; PACKAGE="${1:?}"; shift - local OS_CODENAME;OS_CODENAME="${1:?}"; shift + local PACKAGE OS_CODENAME + PACKAGE="${1:?}"; shift + OS_CODENAME="${1:?}"; shift local JSON_DATA; JSON_DATA=$(python2.7 -c 'if True: import sys, json, subprocess; j=json.loads(subprocess.check_output(("brew","info","--json=v1",sys.argv[1]))) @@ -325,12 +320,13 @@ function _brew_install_and_cache { # assumes that deps were already installed # and not already the latest version - local PACKAGE;PACKAGE="${1:?}" - local USE_BOTTLE;USE_BOTTLE="${2:?}" - local KEG_ONLY;KEG_ONLY="${3:?}" + local PACKAGE USE_BOTTLE KEG_ONLY + PACKAGE="${1:?}" + USE_BOTTLE="${2:?}" + KEG_ONLY="${3:?}" local VERB - if brew list --versions "$PACKAGE" >/dev/null; then + if brew list --versions "$PACKAGE"; then # Install alongside the old version to avoid to have to update "runtime dependents" # https://discourse.brew.sh/t/can-i-install-a-new-version-without-having-to-upgrade-runtime-dependents/4443 VERB="install --force" @@ -382,10 +378,11 @@ function _brew_check_elapsed_build_time { # If time limit has been reached, # arrange for further build to be skipped and return 1 - local TIME_START;TIME_START="${1:?}" - local TIME_LIMIT;TIME_LIMIT="${2:?}" + local TIME_START TIME_LIMIT ELAPSED_TIME + TIME_START="${1:?}" + TIME_LIMIT="${2:?}" - local ELAPSED_TIME;ELAPSED_TIME=$(($(date +%s) - $TIME_START)) + ELAPSED_TIME=$(($(date +%s) - $TIME_START)) echo "Elapsed time: "$(($ELAPSED_TIME/60))"m (${ELAPSED_TIME}s)" if [[ "$ELAPSED_TIME" -gt $TIME_LIMIT ]]; then @@ -400,10 +397,12 @@ function _brew_check_slow_building_ahead { #If the package's projected build completion is higher than hard limit, # skip it and arrange for further build to be skipped and return 1 - local PACKAGE="${1:?}" - local TIME_START="${2:?}" - local TIME_HARD_LIMIT="${3:?}" + local PACKAGE TIME_START TIME_HARD_LIMIT + PACKAGE="${1:?}" + TIME_START="${2:?}" + TIME_HARD_LIMIT="${3:?}" + local PROJECTED_BUILD_TIME PROJECTED_BUILD_TIME=$(echo "$BREW_SLOW_BUILIDING_PACKAGES" | awk '$1=="'"$PACKAGE"'"{print $2}') [ -z "$PROJECTED_BUILD_TIME" ] && return 0 || true From 7af6a3545e4497fc6ad148cea232dd5ff04a192a Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 23 Mar 2019 02:08:15 +0300 Subject: [PATCH 021/293] Use 2 stages for MacOS builds * Add a dedicated stage to each OSX build to download/build brew packages * Remove bottle building logic and the corresponding trace output from the project build stage --- .travis.yml | 128 +++++++++++++++++++++++++++++++++------ config.sh | 35 +++++++---- travis_osx_brew_cache.sh | 6 +- 3 files changed, 135 insertions(+), 34 deletions(-) diff --git a/.travis.yml b/.travis.yml index 632af248..07febd6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -34,144 +34,232 @@ cache: # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - $HOME/.ccache +# Add more cache stages (s2 etc) and corresponding OSX jobs like s1 +# if brew builds start to take longer than one Travis time limit +stages: + - s1 + - final + matrix: fast_finish: true include: # default builds for MacOS - - os: osx + - &osx-10 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-10 + stage: s1 + - &osx-30 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-30 + stage: s1 + - &osx-40 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-40 + stage: s1 + - &osx-50 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-50 + stage: s1 + - &osx-60 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 + stage: final + - <<: *osx-60 + stage: s1 # headless builds for MacOS - - os: osx + - &osx-70 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-70 + stage: s1 + - &osx-80 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-80 + stage: s1 + - &osx-90 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-90 + stage: s1 + - &osx-100 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-100 + stage: s1 + - &osx-110 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 + stage: final + - <<: *osx-110 + stage: s1 # Contrib builds for MacOS - - os: osx + - &osx-120 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-120 + stage: s1 + - &osx-130 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-130 + stage: s1 + - &osx-140 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-140 + stage: s1 + - &osx-150 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - - os: osx + stage: final + - <<: *osx-150 + stage: s1 + - &osx-160 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 + stage: final + - <<: *osx-160 + stage: s1 # headless contrib builds for MacOS - - os: osx + - &osx-170 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-170 + stage: s1 + - &osx-180 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-180 + stage: s1 + - &osx-190 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-190 + stage: s1 + - &osx-200 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - - os: osx + stage: final + - <<: *osx-200 + stage: s1 + - &osx-210 + os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 + stage: final + - <<: *osx-210 + stage: s1 # default builds for Linux - os: linux + # the following jobs will use the same stage name by default + stage: s1 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 diff --git a/config.sh b/config.sh index 59c40ee3..16a5ad68 100644 --- a/config.sh +++ b/config.sh @@ -37,11 +37,6 @@ if [ -n "$IS_OSX" ]; then "ffmpeg_opencv 10" \ ) - #Contrib adds significantly to project's build time - if [ "$ENABLE_CONTRIB" -eq 1 ]; then - BREW_TIME_LIMIT=$((BREW_TIME_LIMIT - 10*60)) - fi - function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" @@ -92,9 +87,14 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" + + local CACHE_STAGE; (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1 - brew update - brew_add_local_bottles + #after the cache stage, all bottles and Homebrew metadata should be already cached locally + if [ -n "$CACHE_STAGE" ]; then + brew update + brew_add_local_bottles + fi # Don't query analytical info online on `brew info`, # this takes several seconds and we don't need it @@ -104,14 +104,25 @@ function pre_build { echo 'Installing QT4' brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4 - brew_install_and_cache_within_time_limit qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } + if [ -n "$CACHE_STAGE" ]; then + brew_install_and_cache_within_time_limit qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } + else + brew install qt@4 + fi echo 'Installing FFmpeg' - generate_ffmpeg_formula - local IS_BOTTLE_AVAILABLE; _brew_is_bottle_available ffmpeg_opencv && IS_BOTTLE_AVAILABLE=1 || IS_BOTTLE_AVAILABLE=0 - _brew_install_and_cache ffmpeg_opencv "$IS_BOTTLE_AVAILABLE" - #brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } + if [ -n "$CACHE_STAGE" ]; then + generate_ffmpeg_formula + brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } + else + brew install ffmpeg_opencv + fi + + if [ -n "$CACHE_STAGE" ]; then + brew_go_bootstrap_mode 0 + return 0 + fi # Have to install macpython late to avoid conflict with Homebrew Python update before_install diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 69dbf729..3eba10f6 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -10,7 +10,8 @@ BREW_TIME_START=$(($TRAVIS_TIMER_START_TIME/10**9)) # If after a package is built, elapsed time is more than this many seconds, fail the build but save Travis cache # The cutoff moment should leave enough time till Travis' job time limit to process the main project. -BREW_TIME_LIMIT=$((30*60)) +# Since we have moved deps into a separate stage, we don't need to leave time for the project any more +BREW_TIME_LIMIT=$((38*60)) # If a slow-building package is about to be built and the projected build end moment is beyond this many seconds, # skip that build, fail the Travis job and save Travis cache. # This cutoff should leave enough time for before_cache and cache save. @@ -207,6 +208,7 @@ function brew_cache_cleanup { function brew_go_bootstrap_mode { # Can be overridden # Terminate the build but ensure saving the cache + local EXIT_CODE=${1:-1} echo "Going into cache bootstrap mode" @@ -223,7 +225,7 @@ function brew_go_bootstrap_mode { # Travis runs user scripts via `eval` i.e. in the same shell process. # So have to unset errexit in order to get to cache save stage - set +e; return 1 + set +e; return '"$EXIT_CODE"' }' } From 2c8282f816a125cb7f2f6918f69dd37ec36a6fcf Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 23 Mar 2019 22:16:33 +0300 Subject: [PATCH 022/293] Further increase time limits for the cache jobs --- travis_osx_brew_cache.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 3eba10f6..87de4c78 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -11,11 +11,11 @@ BREW_TIME_START=$(($TRAVIS_TIMER_START_TIME/10**9)) # If after a package is built, elapsed time is more than this many seconds, fail the build but save Travis cache # The cutoff moment should leave enough time till Travis' job time limit to process the main project. # Since we have moved deps into a separate stage, we don't need to leave time for the project any more -BREW_TIME_LIMIT=$((38*60)) +BREW_TIME_LIMIT=$((42*60)) # If a slow-building package is about to be built and the projected build end moment is beyond this many seconds, # skip that build, fail the Travis job and save Travis cache. # This cutoff should leave enough time for before_cache and cache save. -BREW_TIME_HARD_LIMIT=$((40*60)) +BREW_TIME_HARD_LIMIT=$((43*60)) # Auto cleanup can delete locally-built bottles From 81e4987e05536977c808093e740607ea7d4d8ffa Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 23 Mar 2019 22:17:44 +0300 Subject: [PATCH 023/293] x265 is not among the custom formula dependencies --- config.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/config.sh b/config.sh index 16a5ad68..c6aae3db 100644 --- a/config.sh +++ b/config.sh @@ -32,7 +32,6 @@ if [ -n "$IS_OSX" ]; then source travis_osx_brew_cache.sh BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \ - "x265 20" \ "cmake 15" \ "ffmpeg_opencv 10" \ ) From 02ab5572128ea5e35b254641906fa899c1da1e0e Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 23 Mar 2019 22:20:33 +0300 Subject: [PATCH 024/293] HOMEBREW_NO_GITHUB_API is more relevant to the lib rather than main logic --- config.sh | 5 ----- travis_osx_brew_cache.sh | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/config.sh b/config.sh index c6aae3db..c31def77 100644 --- a/config.sh +++ b/config.sh @@ -95,11 +95,6 @@ function pre_build { brew_add_local_bottles fi - # Don't query analytical info online on `brew info`, - # this takes several seconds and we don't need it - # see https://docs.brew.sh/Manpage , "info formula" section - export HOMEBREW_NO_GITHUB_API=1 - echo 'Installing QT4' brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4 diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 87de4c78..43625c41 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -22,6 +22,12 @@ BREW_TIME_HARD_LIMIT=$((43*60)) # when the caching logic isn't prepared for that export HOMEBREW_NO_INSTALL_CLEANUP=1 +# Don't query analytical info online on `brew info`, +# this takes several seconds and we don't need it +# see https://docs.brew.sh/Manpage , "info formula" section +export HOMEBREW_NO_GITHUB_API=1 + + #Public functions From ae953ca3c1ce08b9787bbdec3b55cf1cb020a412 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 5 Apr 2019 19:43:01 +0300 Subject: [PATCH 025/293] update README --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 32e5687b..a8556f98 100644 --- a/README.md +++ b/README.md @@ -50,12 +50,20 @@ A: Most likely the issue is related to too old pip and can be fixed by running ` A: If the import fails on Windows, make sure you have [Visual C++ redistributable 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145) installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, [Universal C Runtime](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) might be also required. +Windows N and KN editions do not include Media Feature Pack which is required by OpenCV. If you are using Windows N or KN edition, please install also [Windows Media Feature Pack](https://support.microsoft.com/en-us/help/3145500/media-feature-pack-list-for-windows-n-editions). + If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/skvark/opencv-python/issues/36) for a manual fix. +If you still encounter the error after you have checked all the previous solutions, download [Dependencies](https://github.com/lucasg/Dependencies) and open the ``cv2.pyd`` (located usually at ``C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2``) file with it to debug missing DLL issues. + **Q: I have some other import errors?** A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages). +**Q: Why the packages do not include non-free algorithms?** + +A: Non-free algorithms such as SIFT and SURF are not included in these packages because they are patented and therefore cannot be distributed as built binaries. See this issue for more info: https://github.com/skvark/opencv-python/issues/126 + **Q: Why the package and import are different (opencv-python vs. cv2)?** A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it makes it easier to find the package with search engines. `cv2` (old interface in old OpenCV versions was named as `cv`) is the name that OpenCV developers chose when they created the binding generators. This is kept as the import name to be consistent with different kind of tutorials around the internet. Changing the import name or behaviour would be also confusing to experienced users who are accustomed to the ``import cv2``. From 3025220a9724ed7cb9ec6079dbaa24d67e6029d5 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 8 Apr 2019 18:43:59 +0300 Subject: [PATCH 026/293] add --user flag to pip install --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 07febd6e..22822de6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,7 +39,7 @@ cache: stages: - s1 - final - + matrix: fast_finish: true include: @@ -722,10 +722,10 @@ after_success: | # Upload wheels to pypi if requested if [ -n "$TRAVIS_TAG" ]; then set -x - pip install twine + pip install --user twine if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - pip install --upgrade pyOpenSSL + pip install --user --upgrade pyOpenSSL fi if [[ $ENABLE_CONTRIB == 0 ]]; then From 9aa34f7d3b28ffb5aba380d72586cb44b9bab0c2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 8 Apr 2019 19:02:02 +0300 Subject: [PATCH 027/293] upgrade six... --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 22822de6..c63fdbbb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -723,6 +723,7 @@ after_success: | if [ -n "$TRAVIS_TAG" ]; then set -x pip install --user twine + pip install --user --upgrade six if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then pip install --user --upgrade pyOpenSSL From 2fa617300642390f2ee4011e0ce177dcfba9c003 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 8 Apr 2019 19:33:26 +0300 Subject: [PATCH 028/293] update README --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index a8556f98..10229096 100644 --- a/README.md +++ b/README.md @@ -144,7 +144,9 @@ The default ``manylinux`` images have been extended with some OpenCV dependencie ### Supported Python versions -Python 2.7 is the only supported version in 2.x series. Python 3.x releases follow Numpy releases. For example Python 3.3 is no longer supported by Numpy so support for it has been dropped in ``opencv-python``, too. +Python 2.7 is the only supported version in 2.x series. Python 2.7 support will be dropped in the end of 2019. + +Python 3.x releases follow Numpy releases. For example Python 3.3 is no longer supported by Numpy so support for it has been dropped in ``opencv-python``, too. Currently, builds for following Python versions are provided: From 630df31b430e1b7b06d07e15204978d73323f7bc Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 8 Apr 2019 23:26:50 +0300 Subject: [PATCH 029/293] fix macOS deployment phase --- .travis.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index c63fdbbb..34d989f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -722,11 +722,15 @@ after_success: | # Upload wheels to pypi if requested if [ -n "$TRAVIS_TAG" ]; then set -x - pip install --user twine - pip install --user --upgrade six + + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + pip install --user twine + pip install --user --upgrade six + fi if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - pip install --user --upgrade pyOpenSSL + pip install twine + pip install --upgrade pyOpenSSL fi if [[ $ENABLE_CONTRIB == 0 ]]; then From 54cbe08ad584b279f1cd250ca286d2de819ef7b5 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 00:35:34 +0300 Subject: [PATCH 030/293] Fix values of mismatch detection variables carrying over to the next iteration Happened in https://travis-ci.org/skvark/opencv-python/builds/518836739 S1 jobs --- travis_osx_brew_cache.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 43625c41..6a270678 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -106,8 +106,8 @@ function brew_add_local_bottles { local FORMULA_HAS_BOTTLE; [ -n "$FORMULA_BOTTLE_HASH" ] && FORMULA_HAS_BOTTLE=1 || true - local BOTTLE_LINK BOTTLE; BOTTLE_LINK="${JSON}.bottle.lnk"; - local BOTTLE_EXISTS BOTTLE_MISMATCH VERSION_MISMATCH + local BOTTLE_LINK BOTTLE=""; BOTTLE_LINK="${JSON}.bottle.lnk"; + local BOTTLE_EXISTS= BOTTLE_MISMATCH= VERSION_MISMATCH= # Check that the bottle file exists and is still appropriate for the formula From d3c3882338c2c624ed6aadb325ded83a386cebfe Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 00:46:02 +0300 Subject: [PATCH 031/293] Fix removing old built opencv_ffmpeg when a new upstream formula is available Happened in https://travis-ci.org/skvark/opencv-python/builds/518179810 S1 jobs --- config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.sh b/config.sh index c31def77..2a7e8ec1 100644 --- a/config.sh +++ b/config.sh @@ -92,6 +92,7 @@ function pre_build { #after the cache stage, all bottles and Homebrew metadata should be already cached locally if [ -n "$CACHE_STAGE" ]; then brew update + generate_ffmpeg_formula brew_add_local_bottles fi @@ -107,7 +108,6 @@ function pre_build { echo 'Installing FFmpeg' if [ -n "$CACHE_STAGE" ]; then - generate_ffmpeg_formula brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else brew install ffmpeg_opencv From ea088a936d1596ac31a0ef58303faf6059bb9070 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 01:19:18 +0300 Subject: [PATCH 032/293] Don't print bogus error message when cache warmup is complete --- travis_osx_brew_cache.sh | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 6a270678..eb15618c 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -223,12 +223,19 @@ function brew_go_bootstrap_mode { #Can't just `exit` because that would terminate the build without saving the cache #Have to replace further actions with no-ops + local MESSAGE=""; if [ "$EXIT_CODE" -ne 0 ]; then + MESSAGE='Building dependencies took too long. Restart the build in Travis UI to continue from cache.'; + fi + eval ' function '"$cmd"' { return 0; } function repair_wheelhouse { return 0; } - function install_run { - echo -e "\nBuilding dependencies took too long. Restart the build in Travis UI to continue from cache.\n" - + function install_run {'\ + "$(if [ -n "$MESSAGE" ]; then + echo \ + ' echo -e "\n'"$MESSAGE"'\n"' + fi)"\ + ' # Travis runs user scripts via `eval` i.e. in the same shell process. # So have to unset errexit in order to get to cache save stage set +e; return '"$EXIT_CODE"' From bf365e191e33eaabaa362ceeb4e1111a2e9cc417 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 04:12:14 +0300 Subject: [PATCH 033/293] Fix "Error: broken pipe" if `brew info` gives lots of output --- travis_osx_brew_cache.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index eb15618c..65d4f0a9 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -307,7 +307,9 @@ function _brew_is_bottle_available { local PACKAGE;PACKAGE="${1:?}" local VAR_KEG_ONLY="$2" - local INFO;INFO="$(brew info "$PACKAGE" | head -n 1)" + # `brew info` prints "Error: Broken pipe" if piped directly to `head` and the info is long + # 141 = 128 + SIGPIPE + local INFO;INFO="$((brew info "$PACKAGE" | cat || test $? -eq 141) | head -n 1)" if [ -n "$VAR_KEG_ONLY" ]; then if grep -qwF '[keg-only]' <<<"$INFO"; then eval "${VAR_KEG_ONLY}=1" From df122a018c57a3e3657a538b53710cab3c4b13d4 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 05:22:08 +0300 Subject: [PATCH 034/293] CentOS 5 ccache doesn't have --show-stats --- config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.sh b/config.sh index 2a7e8ec1..af888179 100644 --- a/config.sh +++ b/config.sh @@ -16,7 +16,7 @@ function bdist_wheel_cmd { local abs_wheelhouse=$1 python setup.py bdist_wheel $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse - if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache --show-stats; fi + if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } if [ -n "$IS_OSX" ]; then From 8e23e986a83a5c11b0b348073a419d3678927367 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 02:29:59 +0300 Subject: [PATCH 035/293] Use latest cmake for the main build, too, with better Python support --- config.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config.sh b/config.sh index af888179..3370d221 100644 --- a/config.sh +++ b/config.sh @@ -111,6 +111,10 @@ function pre_build { brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else brew install ffmpeg_opencv + #cmake is a build dependency of ffmpeg so a bottle should be present in cache + if (brew outdated | grep -qxF cmake) || ! (brew list | grep -qxF cmake); then + _brew_install_and_cache cmake 1 0 + fi fi if [ -n "$CACHE_STAGE" ]; then From a22f8bf9f447f9c9ed8f6c4a4a10024f147bf9c7 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 May 2019 23:55:12 +0300 Subject: [PATCH 036/293] JSON format change for formula without any bottles --- travis_osx_brew_cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 65d4f0a9..5eaefe42 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -285,7 +285,7 @@ function _brew_parse_package_info { revision=data["revision"] # in bottle''s json, revision is included into version; here, they are separate print data["versions"]["stable"]+("_"+str(revision) if revision else "") - bottle_data=data["bottle"]["stable"] + bottle_data=data["bottle"].get("stable",{"rebuild":"","files":{}}) print bottle_data["rebuild"] print bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"] #prevent losing trailing blank line to command substitution ' \ From 676971681d846ad0a82b07afc7ccb7bedc1bfe34 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Fri, 3 May 2019 22:34:38 +0300 Subject: [PATCH 037/293] Speed up repeat checks for the same deps --- travis_osx_brew_cache.sh | 85 +++++++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 36 deletions(-) diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 5eaefe42..e3a69cc3 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -27,7 +27,8 @@ export HOMEBREW_NO_INSTALL_CLEANUP=1 # see https://docs.brew.sh/Manpage , "info formula" section export HOMEBREW_NO_GITHUB_API=1 - +#Packages already installed in the current session to avoid checking them again +_BREW_ALREADY_INSTALLED='$' #$ = illegal package name; a blank line would cause macos grep to swallow everything #Public functions @@ -37,39 +38,8 @@ function brew_install_and_cache_within_time_limit { # use bottle if available, build and cache bottle if not. # Terminate and exit with status 1 if this takes too long. # Exit with status 2 on any other error. - ( set -eE -o pipefail; trap '{ sleep 3; exit 2; }' ERR - - local PACKAGE TIME_LIMIT TIME_HARD_LIMIT TIME_START - PACKAGE="${1:?}" || exit 2 - TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || exit 2 - TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || exit 2 - TIME_START=${4:-$BREW_TIME_START} || exit 2 - - local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY - - if brew list --versions "$PACKAGE" >/dev/null && ! (brew outdated | grep -qxF "$PACKAGE"); then - echo "Already installed and the latest version: $PACKAGE" - return 0 - fi - - - _brew_is_bottle_available "$PACKAGE" KEG_ONLY || BUILD_FROM_SOURCE=1 - [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true - - # Whitespace is illegal in package names so converting all whitespace into single spaces due to no quotes is okay. - DEPS=`brew deps "$PACKAGE" $INCLUDE_BUILD` || exit 2 - 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 - brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || exit $? - done - - _brew_check_slow_building_ahead "$PACKAGE" "$TIME_START" "$TIME_HARD_LIMIT" || exit $? - _brew_install_and_cache "$PACKAGE" "$([[ -z "$BUILD_FROM_SOURCE" ]] && echo 1 || echo 0)" "$KEG_ONLY" || exit 2 - _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || exit $? - ) \ - || if test $? -eq 1; then brew_go_bootstrap_mode; return 1; else return 2; fi #must run this in current process + _brew_install_and_cache_within_time_limit $@ \ + || if test $? -eq 1; then brew_go_bootstrap_mode; return 1; else return 2; fi } function brew_add_local_bottles { @@ -246,6 +216,46 @@ function brew_go_bootstrap_mode { #Internal functions +function _brew_install_and_cache_within_time_limit { + # This fn is run with || so errexit can't be enabled + + local PACKAGE TIME_LIMIT TIME_HARD_LIMIT TIME_START MARKED_INSTALLED + PACKAGE="${1:?}" || return 2 + TIME_LIMIT=${2:-$BREW_TIME_LIMIT} || return 2 + TIME_HARD_LIMIT=${3:-$BREW_TIME_HARD_LIMIT} || return 2 + TIME_START=${4:-$BREW_TIME_START} || return 2 + + if grep -qxFf <(cat <<<"$_BREW_ALREADY_INSTALLED") <<<"$PACKAGE"; then + MARKED_INSTALLED=1 + fi + + if [ -n "$MARKED_INSTALLED" ] || (brew list --versions "$PACKAGE" >/dev/null && ! (brew outdated | grep -qxF "$PACKAGE")); then + echo "Already installed and the latest version: $PACKAGE" + if [ -z "$MARKED_INSTALLED" ]; then _brew_mark_installed "$PACKAGE"; fi + return 0 + fi + + local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY + + _brew_is_bottle_available "$PACKAGE" KEG_ONLY || BUILD_FROM_SOURCE=1 + [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true + + # Whitespace is illegal in package names so converting all whitespace into single spaces due to no quotes is okay. + DEPS=`brew deps "$PACKAGE" $INCLUDE_BUILD` || return 2 + DEPS=`grep -vxF <(cat <<<"$_BREW_ALREADY_INSTALLED") <<<"$DEPS"` || test $? -eq 1 || return 2 + 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 + _brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || return $? + done + + _brew_check_slow_building_ahead "$PACKAGE" "$TIME_START" "$TIME_HARD_LIMIT" || return $? + _brew_install_and_cache "$PACKAGE" "$([[ -z "$BUILD_FROM_SOURCE" ]] && echo 1 || echo 0)" "$KEG_ONLY" || return 2 + _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || return $? +} + + function _brew_parse_bottle_json { # Parse JSON file resulting from `brew bottle --json` # and save data into specified variables @@ -386,10 +396,13 @@ function _brew_install_and_cache { echo "$CACHED_BOTTLE" >"$BOTTLE_LINK" fi + + _brew_mark_installed "$PACKAGE" } - - +function _brew_mark_installed { + _BREW_ALREADY_INSTALLED="$_BREW_ALREADY_INSTALLED"$'\n'"${1:?}" +} function _brew_check_elapsed_build_time { # If time limit has been reached, From 87902b0e40fd04ec47bf4d53d4b6cfa342250ad9 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 4 May 2019 11:02:49 +0300 Subject: [PATCH 038/293] Add prefix to all files related to CI rather than project --- .travis.yml | 3 ++- config.sh => travis_config.sh | 0 multibuild_customize.sh => travis_multibuild_customize.sh | 0 3 files changed, 2 insertions(+), 1 deletion(-) rename config.sh => travis_config.sh (100%) rename multibuild_customize.sh => travis_multibuild_customize.sh (100%) diff --git a/.travis.yml b/.travis.yml index 34d989f8..81d2331e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,6 +5,7 @@ env: - TEST_DEPENDS="numpy==1.11.1" # params to bdist_wheel. used to set osx build target. - BDIST_PARAMS="" + - CONFIG_PATH="travis_config.sh" - USE_CCACHE=1 - PLAT=x86_64 - UNICODE_WIDTH=32 @@ -663,7 +664,7 @@ before_install: | if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi source multibuild/travis_steps.sh # This sets -x - source multibuild_customize.sh + source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled diff --git a/config.sh b/travis_config.sh similarity index 100% rename from config.sh rename to travis_config.sh diff --git a/multibuild_customize.sh b/travis_multibuild_customize.sh similarity index 100% rename from multibuild_customize.sh rename to travis_multibuild_customize.sh From 61ddc1a2fbbf8ca56a22b5feb72b1e6ca7daf050 Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 13 Jun 2019 19:57:44 +0300 Subject: [PATCH 039/293] Revert "Use latest cmake for the main build, too, with better Python support This reverts commit d4a51981676eacd6763fac5b183e6267a4305610. cmake 3.14 can't find py3 installation when "python" points to Python 3 while cmake 3.9 can --- travis_config.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index 3370d221..af888179 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -111,10 +111,6 @@ function pre_build { brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else brew install ffmpeg_opencv - #cmake is a build dependency of ffmpeg so a bottle should be present in cache - if (brew outdated | grep -qxF cmake) || ! (brew list | grep -qxF cmake); then - _brew_install_and_cache cmake 1 0 - fi fi if [ -n "$CACHE_STAGE" ]; then From 8f08f38ad6d07544b276663a03ae67febc1991d4 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Tue, 30 Jul 2019 08:27:45 +0200 Subject: [PATCH 040/293] Travis CI: Xenial is now the default Ubuntu in Travis https://blog.travis-ci.com/2019-04-15-xenial-default-build-environment Also: __sudo: required__ no longer is [Travis are now recommending removing the __sudo__ tag](https://blog.travis-ci.com/2018-11-19-required-linux-infrastructure-migration) because the sudo command is always available in Travis CI and there is no longer any way to turn it off. --- .travis.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81d2331e..d1efa36a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,11 +13,9 @@ env: # Host Python is never used language: generic -# Required to invoke docker ourselves as per https://docs.travis-ci.com/user/docker/ -sudo: required services: docker -# https://docs.travis-ci.com/user/reference/trusty/ -dist: trusty +# https://docs.travis-ci.com/user/reference/xenial +dist: xenial # Save some time, we and setup check them out on demand instead # https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth From a229f278b7fa90e6e0099d90b3d17b0e2cc59d1e Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Sat, 17 Aug 2019 16:08:13 +0300 Subject: [PATCH 041/293] Allow passing custom CMake arguments --- README.md | 30 ++++++++++++++++++++---------- setup.py | 6 ++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 10229096..0db6eb08 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,10 @@ The aim of this repository is to provide means to package each new [OpenCV relea ### Build process -The project is structured like a normal Python package with a standard ``setup.py`` file. The build process for a single entry in the build matrices is as follows (see for example ``appveyor.yml`` file): +The project is structured like a normal Python package with a standard ``setup.py`` file. +The build process for a single entry in the build matrices is as follows (see for example ``appveyor.yml`` file): + +0. In Linux and MacOS build: get OpenCV's optional C dependencies that we compile against 1. Checkout repository and submodules @@ -86,25 +89,32 @@ The project is structured like a normal Python package with a standard ``setup.p - Contrib modules are also included as a submodule 2. Find OpenCV version from the sources -3. Install dependencies (numpy) +3. Install Python dependencies + + - ``setup.py`` installs the dependencies itself, so you need to run it in an environment + where you have the rights to install modules with Pip for the running Python + 4. Build OpenCV - tests are disabled, otherwise build time increases too much - there are 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless) - Linux builds run in manylinux Docker containers (CentOS 5) -5. Copy each ``.pyd/.so`` file to cv2 folder of this project and - generate wheel +5. Rearrange OpenCV's build result, add our custom files and generate wheel + +6. Linux and macOS wheels are transformed with auditwheel and delocate, correspondingly - - Linux and macOS wheels are checked with auditwheel and delocate +7. Install the generated wheel +8. Test that Python can import the library and run some sanity checks +9. Use twine to upload the generated wheel to PyPI (only in release builds) -6. Install the generated wheel -7. Test that Python can import the library and run some sanity checks -8. Use twine to upload the generated wheel to PyPI (only in release builds) +Steps 1--5 are handled by ``setup.py bdist_wheel``. -The ``cv2.pyd/.so`` file is normally copied to site-packages. To avoid polluting the root folder this package wraps the statically built binary into cv2 package and ``__init__.py`` file in the package handles the import logic correctly. +The build can be customized with environment variables. +In addition to any variables that OpenCV's build accepts, we recognize: -Since all packages use the same ``cv2`` namespace explained above, uninstall the other package before switching for example from ``opencv-python`` to ``opencv-contrib-python``. +- ``ENABLE_CONTRIB`` and ``ENABLE_HEADLESS``. Set to ``1`` to build the contrib and/or headless version +- ``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build. ### Licensing diff --git a/setup.py b/setup.py index a6494914..29dc1efd 100644 --- a/setup.py +++ b/setup.py @@ -154,6 +154,12 @@ def main(): if sys.platform.startswith('linux') and not x64: cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__") + + if 'CMAKE_ARGS' in os.environ: + import shlex + cmake_args.extend(shlex.split(os.environ['CMAKE_ARGS'])) + del shlex + # ABI config variables are introduced in PEP 425 if sys.version_info[:2] < (3, 2): import warnings From a7019ef748fd3680e844c752fd670e21297da2f0 Mon Sep 17 00:00:00 2001 From: Abhishek Thakur Date: Sun, 18 Aug 2019 16:22:07 +0530 Subject: [PATCH 042/293] Added OpenSSL & various protocol support to FFmpeg backend (#229) * Added OpenSSL & different protocol support to FFmpeg backend - Fixed Docker dependencies (both x86 & x86-64) - Fixes bug #204 * Additional Fixes - updates to OpenSSL build from scratch - removed specific protocol - Added neccessary dependency * Fixed ./Configure command * Updates for docker images: - Added perl build from scratch - Fixed wrong/redundant dependencies/paths - Fixed & updated openssl installation * Fixed Empty continuation lines bug & added comments * fix inconsitent spacing * Don't add perl 5.10 to PATH * fix syntax error * Fixed OpenSSL build fails in i686 Dockerfile due to buggy perl source * Fixing manylinux docker entrypoint for i686 in 32 bit images * ENTRYPOINT not needed, it only affects "docker run" invocations * manylinux1 provides better libcurl for cmake * manylinux1 provides the toolchain and git git install fails in i686, too * cleanup tar invocations * nasm is not installed in manylinux1 * detect i686 in openssl configure * move perl to a separate subtree as it's a private dependency * rm it after library build * comment unusual openssl build step * avoid redundant work in perl build * build each library in a separate dockerfile command for easier debugging * comment custom i686 step * update dockerfile README * opencv now bundles libjpeg-turbo and the separate's onre buid fails dueto expired certificate at https://kent.dl.sourceforge.net --- docker/Dockerfile_i686 | 86 ++++++++++++++++++++++++---------------- docker/Dockerfile_x86_64 | 83 +++++++++++++++++++++----------------- docker/README.md | 3 +- 3 files changed, 99 insertions(+), 73 deletions(-) diff --git a/docker/Dockerfile_i686 b/docker/Dockerfile_i686 index 62366543..98d70324 100644 --- a/docker/Dockerfile_i686 +++ b/docker/Dockerfile_i686 @@ -14,43 +14,74 @@ ENV QTDIR /opt/Qt4.8.7 ENV PATH "$QTDIR/bin:$PATH" RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \ - tar -zxf cmake-3.9.0.tar.gz && \ + tar -xf cmake-3.9.0.tar.gz && \ cd cmake-3.9.0 && \ - yum -y install curl-devel zlib-devel && \ + true '#manylinux1 provides curl-devel equivalent and libcurl statically linked \ + against the same newer OpenSSL as other source-built tools \ + (1.0.2s as of this writing)' && \ + yum -y install zlib-devel && \ ./configure --system-curl && \ - make && \ + make -j4 && \ make install && \ cd .. && \ rm -rf cmake-3.9.0* -RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool make mercurial pkgconfig zlib-devel -y && \ - yum remove nasm -y && \ - mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies +# manylinux provides the toolchain and git; we provide cmake +RUN yum install freetype-devel bzip2-devel zlib-devel -y && \ + mkdir ~/ffmpeg_sources + +# Newer openssl configure requires newer perl +RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \ + tar -xf perl-5.20.1.tar.gz && \ + cd perl-5.20.1 && \ + ./Configure -des -Dprefix="$HOME/openssl_build" && \ + true '#perl build scripts do much redundant work \ + if running "make install" separately' && \ + make install -j4 && \ + cd .. && \ + rm -rf perl-5.20.1* + +RUN cd ~/ffmpeg_sources && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ + tar -xf OpenSSL_1_1_1c.tar.gz && \ + cd openssl-OpenSSL_1_1_1c && \ + true '#in i686, ./config detects x64 in i686 without linux32 \ + when run from "docker build"' && \ + PERL="$HOME/openssl_build/bin/perl" linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ + make -j4 && \ + true '#skip installing documentation' && \ + make install_sw && \ + rm -rf ~/openssl_build + +RUN cd ~/ffmpeg_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar xjvf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar xzvf yasm-1.3.0.tar.gz && \ + tar -xf yasm-1.3.0.tar.gz && \ cd yasm-1.3.0 && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar xjvf ffmpeg-snapshot.tar.bz2 && \ + tar -xf ffmpeg-snapshot.tar.bz2 && \ cd ffmpeg && \ PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j4 && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ @@ -60,30 +91,15 @@ RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib -RUN mkdir libjpeg-turbo && \ - cd libjpeg-turbo && \ - export PATH=~/bin:$PATH && \ - curl -L https://kent.dl.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-1.5.3.tar.gz > libjpeg-turbo-1.5.3.tar.gz && \ - tar xzvf libjpeg-turbo-1.5.3.tar.gz && \ - cd libjpeg-turbo-1.5.3 && \ - export CFLAGS="-fPIC" && \ - export CXXFLAGS="-fPIC" && \ - autoreconf -fiv && \ - ./configure --host=i686-pc-linux-gnu && \ - make && \ - make install && \ - cd ../../ && \ - rm -rf libjpeg-turbo - -ENV JPEG_LIBRARY /opt/libjpeg-turbo/lib32/libjpeg.a -ENV JPEG_INCLUDE_DIR /opt/libjpeg-turbo/include - RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux +#in i686, yum metadata ends up with slightly wrong timestamps +#which inhibits its update +#https://github.com/skvark/opencv-python/issues/148 RUN yum clean all ENV PATH "$HOME/bin:$PATH" diff --git a/docker/Dockerfile_x86_64 b/docker/Dockerfile_x86_64 index e9de76e8..81b59974 100644 --- a/docker/Dockerfile_x86_64 +++ b/docker/Dockerfile_x86_64 @@ -14,43 +14,72 @@ ENV QTDIR /opt/Qt4.8.7 ENV PATH "$QTDIR/bin:$PATH" RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \ - tar -zxf cmake-3.9.0.tar.gz && \ + tar -xf cmake-3.9.0.tar.gz && \ cd cmake-3.9.0 && \ - yum -y install curl-devel zlib-devel && \ + true '#manylinux1 provides curl-devel equivalent and libcurl statically linked \ + against the same newer OpenSSL as other source-built tools \ + (1.0.2s as of this writing)' && \ + yum -y install zlib-devel && \ ./configure --system-curl && \ - make && \ + make -j4 && \ make install && \ cd .. && \ rm -rf cmake-3.9.0* -RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool make mercurial pkgconfig zlib-devel -y && \ - yum remove nasm -y && \ - mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +# https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies +# manylinux provides the toolchain and git; we provide cmake +RUN yum install freetype-devel bzip2-devel zlib-devel -y && \ + mkdir ~/ffmpeg_sources + +# Newer openssl configure requires newer perl +RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \ + tar -xf perl-5.20.1.tar.gz && \ + cd perl-5.20.1 && \ + ./Configure -des -Dprefix="$HOME/openssl_build" && \ + true '#perl build scripts do much redundant work \ + if running "make install" separately' && \ + make install -j4 && \ + cd .. && \ + rm -rf perl-5.20.1* + +RUN cd ~/ffmpeg_sources && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ + tar -xf OpenSSL_1_1_1c.tar.gz && \ + cd openssl-OpenSSL_1_1_1c && \ + PERL="$HOME/openssl_build/bin/perl" ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ + make -j4 && \ + true '#skip installing documentation' && \ + make install_sw && \ + rm -rf ~/openssl_build + +RUN cd ~/ffmpeg_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar xjvf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar xzvf yasm-1.3.0.tar.gz && \ + tar -xf yasm-1.3.0.tar.gz && \ cd yasm-1.3.0 && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j4 && \ - make install && \ - cd ~/ffmpeg_sources && \ + make install + +RUN cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar xjvf ffmpeg-snapshot.tar.bz2 && \ + tar -xf ffmpeg-snapshot.tar.bz2 && \ cd ffmpeg && \ PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j4 && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ @@ -60,28 +89,10 @@ RUN yum install autoconf automake bzip2 cmake freetype-devel gcc gcc-c++ libtool ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib -RUN mkdir libjpeg-turbo && \ - cd libjpeg-turbo && \ - export PATH=~/bin:$PATH && \ - curl -L https://kent.dl.sourceforge.net/project/libjpeg-turbo/1.5.3/libjpeg-turbo-1.5.3.tar.gz > libjpeg-turbo-1.5.3.tar.gz && \ - tar xzvf libjpeg-turbo-1.5.3.tar.gz && \ - cd libjpeg-turbo-1.5.3 && \ - export CFLAGS="-fPIC" && \ - export CXXFLAGS="-fPIC" && \ - autoreconf -fiv && \ - ./configure && \ - make && \ - make install && \ - cd ../../ && \ - rm -rf libjpeg-turbo - -ENV JPEG_LIBRARY /opt/libjpeg-turbo/lib64/libjpeg.a -ENV JPEG_INCLUDE_DIR /opt/libjpeg-turbo/include - RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux -ENV PATH "$HOME/bin:$PATH" \ No newline at end of file +ENV PATH "$HOME/bin:$PATH" diff --git a/docker/README.md b/docker/README.md index 2e8602bf..e31d7a07 100644 --- a/docker/README.md +++ b/docker/README.md @@ -10,6 +10,5 @@ The images have following extra software installed: - Qt 4.8.7 - Cmake 3.9.0 -- FFmpeg with libvpx (latest snapshots at the build time) -- libjpeg-turbo 1.5.3 +- FFmpeg with libvpx (latest snapshots at the build time) and recent openssl - Some missing headers included from more recent Linux to be able to enable V4L / V4L2 support in OpenCV \ No newline at end of file From 9b41acdc769a9247918c55c1435dd60ae47fcaf8 Mon Sep 17 00:00:00 2001 From: native-api Date: Sun, 18 Aug 2019 13:53:51 +0300 Subject: [PATCH 043/293] Including a custom libjpeg is no longer needed (#231) * Including a custom libjpeg is no longer needed Since https://github.com/opencv/opencv/pull/11497, OpenCV bundles its own * (dummy commit to trigger rebuild) --- setup.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/setup.py b/setup.py index 29dc1efd..9fb1e049 100644 --- a/setup.py +++ b/setup.py @@ -133,13 +133,6 @@ def main(): cmake_args.append("-DWITH_V4L=ON") cmake_args.append("-DENABLE_PRECOMPILED_HEADERS=OFF") - if all(v in os.environ for v in ('JPEG_INCLUDE_DIR', 'JPEG_LIBRARY')): - cmake_args += [ - "-DBUILD_JPEG=OFF", - "-DJPEG_INCLUDE_DIR=%s" % os.environ['JPEG_INCLUDE_DIR'], - "-DJPEG_LIBRARY=%s" % os.environ['JPEG_LIBRARY'] - ] - # Fixes for macOS builds if sys.platform == 'darwin': cmake_args.append("-DWITH_LAPACK=OFF") # Some OSX LAPACK fns are incompatible, see From 9f1a4422141babc7bfa244e41cfcde081a4876bf Mon Sep 17 00:00:00 2001 From: native-api Date: Sun, 18 Aug 2019 14:03:02 +0300 Subject: [PATCH 044/293] Use Travis workspaces (#228) * Use one job for MacOS Homebrew builds cache with Travis workspaces * Brew build job needs to both feed to other jobs and cache between builds * Move Linux jobs to the Final stage With only 1 OSX job in S1, the Linux part is now the critical path and holds the build time back --- .travis.yml | 190 +++++++++++++++++++++++----------------------------- 1 file changed, 84 insertions(+), 106 deletions(-) diff --git a/.travis.yml b/.travis.yml index d1efa36a..e6213b1c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,11 +25,6 @@ git: # https://docs.travis-ci.com/user/caching cache: directories: - # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew/ - # used in OSX custom build script dealing with local bottle caching - - $HOME/local_bottle_metadata # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - $HOME/.ccache @@ -43,222 +38,205 @@ matrix: fast_finish: true include: + - os: osx + osx_image: xcode8.3 + stage: s1 + workspaces: + create: + name: brew_cache + paths: + # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew/ + # used in OSX custom build script dealing with local bottle caching + - $HOME/local_bottle_metadata + #workspaces share within the same build, cache shares between builds + cache: + directories: + # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` + - $HOME/.ccache + # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci + - $HOME/Library/Caches/Homebrew + - /usr/local/Homebrew/ + # used in OSX custom build script dealing with local bottle caching + - $HOME/local_bottle_metadata + # default builds for MacOS - - &osx-10 + #further jobs in the list will use the same stage until the next assignment + - stage: final os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-10 - stage: s1 - - &osx-30 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-30 - stage: s1 - - &osx-40 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-40 - stage: s1 - - &osx-50 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-50 - stage: s1 - - &osx-60 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 - stage: final - - <<: *osx-60 - stage: s1 + workspaces: + use: brew_cache # headless builds for MacOS - - &osx-70 - os: osx + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-70 - stage: s1 - - &osx-80 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-80 - stage: s1 - - &osx-90 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-90 - stage: s1 - - &osx-100 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-100 - stage: s1 - - &osx-110 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 - stage: final - - <<: *osx-110 - stage: s1 + workspaces: + use: brew_cache # Contrib builds for MacOS - - &osx-120 - os: osx + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-120 - stage: s1 - - &osx-130 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-130 - stage: s1 - - &osx-140 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-140 - stage: s1 - - &osx-150 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - stage: final - - <<: *osx-150 - stage: s1 - - &osx-160 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 - stage: final - - <<: *osx-160 - stage: s1 + workspaces: + use: brew_cache # headless contrib builds for MacOS - - &osx-170 - os: osx + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-170 - stage: s1 - - &osx-180 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.4 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-180 - stage: s1 - - &osx-190 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-190 - stage: s1 - - &osx-200 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - stage: final - - <<: *osx-200 - stage: s1 - - &osx-210 - os: osx + workspaces: + use: brew_cache + - os: osx osx_image: xcode8.3 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 - stage: final - - <<: *osx-210 - stage: s1 + workspaces: + use: brew_cache # default builds for Linux - os: linux - # the following jobs will use the same stage name by default - stage: s1 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 From 3126712cc7a42e9e59d1d462109cd8d10451e058 Mon Sep 17 00:00:00 2001 From: native-api Date: Tue, 20 Aug 2019 19:54:45 +0300 Subject: [PATCH 045/293] Don't build unused Qt features; use all cores (#236) * Don't build unused Qt features; use all cores * cmake does bootstrapping, too; comment unclear steps * Use Docker comment syntax * tab to space --- docker/Dockerfile_i686 | 140 +++++++++++++++++++++------------------ docker/Dockerfile_x86_64 | 136 +++++++++++++++++++------------------ 2 files changed, 146 insertions(+), 130 deletions(-) diff --git a/docker/Dockerfile_i686 b/docker/Dockerfile_i686 index 98d70324..cc97e661 100644 --- a/docker/Dockerfile_i686 +++ b/docker/Dockerfile_i686 @@ -1,30 +1,38 @@ FROM quay.io/pypa/manylinux1_i686:latest RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \ - tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \ - cd qt-everywhere* && \ - ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license && \ - gmake -j5 && \ - gmake install && \ - cd .. && \ - rm -rf qt-everywhere-opensource-src-4.8.7 && \ - rm qt-everywhere-opensource-src-4.8.7.tar.gz + tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \ + cd qt-everywhere* && \ + #configure does a bootstrap make under the hood + #manylinux1 is too old to have `nproc` + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ + #OpenCV only links against QtCore, QtGui, QtTest + ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license \ + -no-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia \ + -no-webkit -no-script -no-declarative -no-dbus -make libs && \ + make && \ + make install && \ + cd .. && \ + rm -rf qt-everywhere-opensource-src-4.8.7 && \ + rm qt-everywhere-opensource-src-4.8.7.tar.gz ENV QTDIR /opt/Qt4.8.7 ENV PATH "$QTDIR/bin:$PATH" RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \ - tar -xf cmake-3.9.0.tar.gz && \ - cd cmake-3.9.0 && \ - true '#manylinux1 provides curl-devel equivalent and libcurl statically linked \ - against the same newer OpenSSL as other source-built tools \ - (1.0.2s as of this writing)' && \ - yum -y install zlib-devel && \ - ./configure --system-curl && \ - make -j4 && \ - make install && \ - cd .. && \ - rm -rf cmake-3.9.0* + tar -xf cmake-3.9.0.tar.gz && \ + cd cmake-3.9.0 && \ + #manylinux1 provides curl-devel equivalent and libcurl statically linked + # against the same newer OpenSSL as other source-built tools + # (1.0.2s as of this writing) + yum -y install zlib-devel && \ + #configure does a bootstrap make under the hood + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ + ./configure --system-curl && \ + make && \ + make install && \ + cd .. && \ + rm -rf cmake-3.9.0* # https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies # manylinux provides the toolchain and git; we provide cmake @@ -33,69 +41,69 @@ RUN yum install freetype-devel bzip2-devel zlib-devel -y && \ # Newer openssl configure requires newer perl RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \ - tar -xf perl-5.20.1.tar.gz && \ - cd perl-5.20.1 && \ - ./Configure -des -Dprefix="$HOME/openssl_build" && \ - true '#perl build scripts do much redundant work \ - if running "make install" separately' && \ - make install -j4 && \ - cd .. && \ - rm -rf perl-5.20.1* + tar -xf perl-5.20.1.tar.gz && \ + cd perl-5.20.1 && \ + ./Configure -des -Dprefix="$HOME/openssl_build" && \ + #perl build scripts do much redundant work + # if running "make install" separately + make install -j$(getconf _NPROCESSORS_ONLN) && \ + cd .. && \ + rm -rf perl-5.20.1* RUN cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ - tar -xf OpenSSL_1_1_1c.tar.gz && \ - cd openssl-OpenSSL_1_1_1c && \ - true '#in i686, ./config detects x64 in i686 without linux32 \ - when run from "docker build"' && \ - PERL="$HOME/openssl_build/bin/perl" linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ - make -j4 && \ - true '#skip installing documentation' && \ - make install_sw && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ + tar -xf OpenSSL_1_1_1c.tar.gz && \ + cd openssl-OpenSSL_1_1_1c && \ + #in i686, ./config detects x64 in i686 container without linux32 + # when run from "docker build" + PERL="$HOME/openssl_build/bin/perl" linux32 ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + #skip installing documentation + make install_sw && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j4 && \ - make install + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ + tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j4 && \ - make install + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ + tar -xf yasm-1.3.0.tar.gz && \ + cd yasm-1.3.0 && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ - cd libvpx && \ - ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ - make -j4 && \ - make install + git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ - PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ - make -j4 && \ - make install && \ - echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ - ldconfig && \ - rm -rf ~/ffmpeg_sources + curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ + tar -xf ffmpeg-snapshot.tar.bz2 && \ + cd ffmpeg && \ + PATH=~/bin:$PATH && \ + PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + ldconfig && \ + rm -rf ~/ffmpeg_sources ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ - mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ + mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux #in i686, yum metadata ends up with slightly wrong timestamps #which inhibits its update diff --git a/docker/Dockerfile_x86_64 b/docker/Dockerfile_x86_64 index 81b59974..f7b0b081 100644 --- a/docker/Dockerfile_x86_64 +++ b/docker/Dockerfile_x86_64 @@ -1,30 +1,38 @@ FROM quay.io/pypa/manylinux1_x86_64:latest RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensource-src-4.8.7.tar.gz && \ - tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \ - cd qt-everywhere* && \ - ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license && \ - gmake -j5 && \ - gmake install && \ - cd .. && \ - rm -rf qt-everywhere-opensource-src-4.8.7 && \ - rm qt-everywhere-opensource-src-4.8.7.tar.gz + tar -xf qt-everywhere-opensource-src-4.8.7.tar.gz && \ + cd qt-everywhere* && \ + #configure does a bootstrap make under the hood + #manylinux1 is too old to have `nproc` + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ + #OpenCV only links against QtCore, QtGui, QtTest + ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license \ + -no-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia \ + -no-webkit -no-script -no-declarative -no-dbus -make libs && \ + make && \ + make install && \ + cd .. && \ + rm -rf qt-everywhere-opensource-src-4.8.7 && \ + rm qt-everywhere-opensource-src-4.8.7.tar.gz ENV QTDIR /opt/Qt4.8.7 ENV PATH "$QTDIR/bin:$PATH" RUN curl -O -L https://cmake.org/files/v3.9/cmake-3.9.0.tar.gz && \ - tar -xf cmake-3.9.0.tar.gz && \ - cd cmake-3.9.0 && \ - true '#manylinux1 provides curl-devel equivalent and libcurl statically linked \ - against the same newer OpenSSL as other source-built tools \ - (1.0.2s as of this writing)' && \ - yum -y install zlib-devel && \ - ./configure --system-curl && \ - make -j4 && \ - make install && \ - cd .. && \ - rm -rf cmake-3.9.0* + tar -xf cmake-3.9.0.tar.gz && \ + cd cmake-3.9.0 && \ + #manylinux1 provides curl-devel equivalent and libcurl statically linked + # against the same newer OpenSSL as other source-built tools + # (1.0.2s as of this writing) + yum -y install zlib-devel && \ + #configure does a bootstrap make under the hood + export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ + ./configure --system-curl && \ + make && \ + make install && \ + cd .. && \ + rm -rf cmake-3.9.0* # https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#GettheDependencies # manylinux provides the toolchain and git; we provide cmake @@ -33,66 +41,66 @@ RUN yum install freetype-devel bzip2-devel zlib-devel -y && \ # Newer openssl configure requires newer perl RUN curl -O -L https://www.cpan.org/src/5.0/perl-5.20.1.tar.gz && \ - tar -xf perl-5.20.1.tar.gz && \ - cd perl-5.20.1 && \ - ./Configure -des -Dprefix="$HOME/openssl_build" && \ - true '#perl build scripts do much redundant work \ - if running "make install" separately' && \ - make install -j4 && \ - cd .. && \ - rm -rf perl-5.20.1* + tar -xf perl-5.20.1.tar.gz && \ + cd perl-5.20.1 && \ + ./Configure -des -Dprefix="$HOME/openssl_build" && \ + #perl build scripts do much redundant work + # if running "make install" separately + make install -j$(getconf _NPROCESSORS_ONLN) && \ + cd .. && \ + rm -rf perl-5.20.1* RUN cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ - tar -xf OpenSSL_1_1_1c.tar.gz && \ - cd openssl-OpenSSL_1_1_1c && \ - PERL="$HOME/openssl_build/bin/perl" ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ - make -j4 && \ - true '#skip installing documentation' && \ - make install_sw && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ + tar -xf OpenSSL_1_1_1c.tar.gz && \ + cd openssl-OpenSSL_1_1_1c && \ + PERL="$HOME/openssl_build/bin/perl" ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + #skip installing documentation + make install_sw && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j4 && \ - make install + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ + tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j4 && \ - make install + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ + tar -xf yasm-1.3.0.tar.gz && \ + cd yasm-1.3.0 && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ - cd libvpx && \ - ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ - make -j4 && \ - make install + git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ - PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ - make -j4 && \ - make install && \ - echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ - ldconfig && \ - rm -rf ~/ffmpeg_sources + curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ + tar -xf ffmpeg-snapshot.tar.bz2 && \ + cd ffmpeg && \ + PATH=~/bin:$PATH && \ + PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + ldconfig && \ + rm -rf ~/ffmpeg_sources ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib RUN curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/videodev2.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ - curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ - mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-common.h && \ + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/uapi/linux/v4l2-controls.h && \ + curl -O https://raw.githubusercontent.com/torvalds/linux/v4.14/include/linux/compiler.h && \ + mv videodev2.h v4l2-common.h v4l2-controls.h compiler.h /usr/include/linux ENV PATH "$HOME/bin:$PATH" From 5582b2e178920743013f985fe97329a4cee9057e Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 29 Aug 2019 20:23:47 +0300 Subject: [PATCH 046/293] i686 patchelf / auditwheel issue fix (revert back to full Qt build) --- docker/Dockerfile_i686 | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docker/Dockerfile_i686 b/docker/Dockerfile_i686 index cc97e661..d5b315a2 100644 --- a/docker/Dockerfile_i686 +++ b/docker/Dockerfile_i686 @@ -7,9 +7,7 @@ RUN curl -O -L https://download.qt.io/archive/qt/4.8/4.8.7/qt-everywhere-opensou #manylinux1 is too old to have `nproc` export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ #OpenCV only links against QtCore, QtGui, QtTest - ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license \ - -no-sql-sqlite -no-qt3support -no-xmlpatterns -no-multimedia \ - -no-webkit -no-script -no-declarative -no-dbus -make libs && \ + ./configure -prefix /opt/Qt4.8.7 -release -opensource -confirm-license -make && \ make && \ make install && \ cd .. && \ From ca9a5273175315e6652a610b3572c3afd0321e18 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 5 Sep 2019 18:40:28 +0300 Subject: [PATCH 047/293] add note to the README about branches --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 0db6eb08..8c2f9306 100644 --- a/README.md +++ b/README.md @@ -134,10 +134,12 @@ Linux and MacOS wheels ship with [Qt 4.8.7](http://doc.qt.io/qt-4.8/lgpl.html) l ### Releases -A release is made and uploaded to PyPI when a new tag is pushed to master branch. These tags differentiate packages (this repo might have modifications but OpenCV version stays same) and should be incremented sequentially. In practice, release version numbers look like this: +A release is made and uploaded to PyPI when a new tag is pushed to the repo. These tags differentiate packages (this repo might have modifications but OpenCV version stays same) and should be incremented sequentially. In practice, release version numbers look like this: ``cv_major.cv_minor.cv_revision.package_revision`` e.g. ``3.1.0.0`` +The master branch follows OpenCV master branch releases. 3.4 branch follows OpenCV 3.4 bugfix releases. + ### Development builds Every commit to the master branch of this repo will be built. Possible build artifacts use local version identifiers: From efb20ee3de71657726846360395278d7a90d0766 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 7 Sep 2019 14:57:20 +0300 Subject: [PATCH 048/293] add std=c++11 --- setup.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 9fb1e049..994b8198 100644 --- a/setup.py +++ b/setup.py @@ -102,7 +102,7 @@ def main(): # skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3 "-DPYTHON%d_EXECUTABLE=%s" % (sys.version_info[0], sys.executable), "-DBUILD_opencv_python%d=ON" % sys.version_info[0], - + # When off, adds __init__.py and a few more helper .py's. We use our own helper files with a different structure. "-DOPENCV_SKIP_PYTHON_LOADER=ON", # Relative dir to install the built module to in the build tree. @@ -111,7 +111,7 @@ def main(): # Otherwise, opencv scripts would want to install `.pyd' right into site-packages, # and skbuild bails out on seeing that "-DINSTALL_CREATE_DISTRIB=ON", - + # See opencv/CMakeLists.txt for options and defaults "-DBUILD_opencv_apps=OFF", "-DBUILD_SHARED_LIBS=OFF", @@ -137,8 +137,8 @@ def main(): if sys.platform == 'darwin': cmake_args.append("-DWITH_LAPACK=OFF") # Some OSX LAPACK fns are incompatible, see # https://github.com/skvark/opencv-python/issues/21 - cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++") - cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.7") + cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11") + cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8") if sys.platform.startswith('linux'): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with @@ -147,12 +147,12 @@ def main(): if sys.platform.startswith('linux') and not x64: cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__") - + if 'CMAKE_ARGS' in os.environ: import shlex cmake_args.extend(shlex.split(os.environ['CMAKE_ARGS'])) del shlex - + # ABI config variables are introduced in PEP 425 if sys.version_info[:2] < (3, 2): import warnings From 6093cc63cb65431e7d4d8f895dd7e73acd1e5d06 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 7 Sep 2019 16:38:49 +0300 Subject: [PATCH 049/293] remove flag --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 994b8198..e887c74d 100644 --- a/setup.py +++ b/setup.py @@ -137,7 +137,7 @@ def main(): if sys.platform == 'darwin': cmake_args.append("-DWITH_LAPACK=OFF") # Some OSX LAPACK fns are incompatible, see # https://github.com/skvark/opencv-python/issues/21 - cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11") + cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++") cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8") if sys.platform.startswith('linux'): From 358097f6e188e4bd443f79ddc404a263300a05b7 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 7 Sep 2019 19:30:06 +0300 Subject: [PATCH 050/293] try another flag --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index e887c74d..2e730bba 100644 --- a/setup.py +++ b/setup.py @@ -140,6 +140,10 @@ def main(): cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++") cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8") + if sys.platform == 'darwin' and build_contrib: + # see: https://github.com/opencv/opencv_contrib/issues/1388#issuecomment-354403896 + cmake_args.append("-DENABLE_PRECOMPILED_HEADERS=OFF") + if sys.platform.startswith('linux'): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with # devtoolset-2 GCC 4.8.2 or vanilla GCC 4.9.4 From c966038b7247c7f47061717128ab41452ad468bf Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 9 Sep 2019 18:12:57 +0300 Subject: [PATCH 051/293] add -std=c++11 --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2e730bba..bf159995 100644 --- a/setup.py +++ b/setup.py @@ -141,8 +141,7 @@ def main(): cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8") if sys.platform == 'darwin' and build_contrib: - # see: https://github.com/opencv/opencv_contrib/issues/1388#issuecomment-354403896 - cmake_args.append("-DENABLE_PRECOMPILED_HEADERS=OFF") + cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11") if sys.platform.startswith('linux'): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with From 3fed34b192f7b3a557d3992d175144e39116957e Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 9 Sep 2019 21:17:46 +0300 Subject: [PATCH 052/293] no narrowing --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index bf159995..4589bde8 100644 --- a/setup.py +++ b/setup.py @@ -141,7 +141,7 @@ def main(): cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.8") if sys.platform == 'darwin' and build_contrib: - cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11") + cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11 -Wno-c++11-narrowing") if sys.platform.startswith('linux'): cmake_args.append("-DWITH_IPP=OFF") # tests fail with IPP compiled with From 91f64abd93611d48367f8c615f8a6f9bd8b954a8 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Wed, 11 Sep 2019 17:15:54 +0300 Subject: [PATCH 053/293] bump OpenCV version --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 33b765d7..4a7ca5a2 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 33b765d7979fd8a6038026aa44f6ff1a9c082b7b +Subproject commit 4a7ca5a291038a773ea0b67eaf6fbed9ad72170b diff --git a/opencv_contrib b/opencv_contrib index f26c9836..6d656ca0 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f26c98365da6af93cb5e49397b571190fca7bb55 +Subproject commit 6d656ca069afb3a3cb43a3484ee3a2d215982997 From 0d24dcca4a138f9f69aee0a5f8230153e3cc8918 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 23 Aug 2019 14:43:20 +0300 Subject: [PATCH 054/293] patch OpenEXR on 32-bit Linux --- patches/patchOpenEXR | 288 +++++++++++++++++++++++++++++++++++++++++++ setup.py | 2 + 2 files changed, 290 insertions(+) create mode 100644 patches/patchOpenEXR diff --git a/patches/patchOpenEXR b/patches/patchOpenEXR new file mode 100644 index 00000000..52dba087 --- /dev/null +++ b/patches/patchOpenEXR @@ -0,0 +1,288 @@ +diff -ruN opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp +--- opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-22 20:02:54.769176800 +0300 ++++ opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 14:31:17.103949100 +0300 +@@ -1,138 +1,146 @@ +-/////////////////////////////////////////////////////////////////////////// +-// +-// Copyright (c) 2009-2014 DreamWorks Animation LLC. +-// +-// All rights reserved. +-// +-// Redistribution and use in source and binary forms, with or without +-// modification, are permitted provided that the following conditions are +-// met: +-// * Redistributions of source code must retain the above copyright +-// notice, this list of conditions and the following disclaimer. +-// * Redistributions in binary form must reproduce the above +-// copyright notice, this list of conditions and the following disclaimer +-// in the documentation and/or other materials provided with the +-// distribution. +-// * Neither the name of DreamWorks Animation nor the names of +-// its contributors may be used to endorse or promote products derived +-// from this software without specific prior written permission. +-// +-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +-// +-/////////////////////////////////////////////////////////////////////////// +- +-#include "ImfSimd.h" +-#include "ImfSystemSpecific.h" +-#include "ImfNamespace.h" +-#include "OpenEXRConfig.h" +- +-OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER +- +-namespace { +-#if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__ANDROID__) +- +- // Helper functions for gcc + SSE enabled +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) +- { +- __asm__ __volatile__ ( +- "cpuid" +- : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) +- : /* Input */ "a"(n) +- : /* Clobber */); +- } +- +-#else // IMF_HAVE_SSE2 && __GNUC__ +- +- // Helper functions for generic compiler - all disabled +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) +- { +- eax = ebx = ecx = edx = 0; +- } +- +-#endif // IMF_HAVE_SSE2 && __GNUC__ +- +- +-#ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX +- +- void xgetbv(int n, int &eax, int &edx) +- { +- __asm__ __volatile__ ( +- "xgetbv" +- : /* Output */ "=a"(eax), "=d"(edx) +- : /* Input */ "c"(n) +- : /* Clobber */); +- } +- +-#else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX +- +- void xgetbv(int n, int &eax, int &edx) +- { +- eax = edx = 0; +- } +- +-#endif // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX +- +-} // namespace +- +-CpuId::CpuId(): +- sse2(false), +- sse3(false), +- ssse3(false), +- sse4_1(false), +- sse4_2(false), +- avx(false), +- f16c(false) +-{ +- bool osxsave = false; +- int max = 0; +- int eax, ebx, ecx, edx; +- +- cpuid(0, max, ebx, ecx, edx); +- if (max > 0) +- { +- cpuid(1, eax, ebx, ecx, edx); +- sse2 = ( edx & (1<<26) ); +- sse3 = ( ecx & (1<< 0) ); +- ssse3 = ( ecx & (1<< 9) ); +- sse4_1 = ( ecx & (1<<19) ); +- sse4_2 = ( ecx & (1<<20) ); +- osxsave = ( ecx & (1<<27) ); +- avx = ( ecx & (1<<28) ); +- f16c = ( ecx & (1<<29) ); +- +- if (!osxsave) +- { +- avx = f16c = false; +- } +- else +- { +- xgetbv(0, eax, edx); +- // eax bit 1 - SSE managed, bit 2 - AVX managed +- if ((eax & 6) != 6) +- { +- avx = f16c = false; +- } +- } +- } +- +-#if defined(IMF_HAVE_SSE2) && defined(__ANDROID__) +- sse2 = true; +- sse3 = true; +-#ifdef __x86_64__ +- ssse3 = true; +- sse4_1 = true; +-#endif +-#endif +-} +- +-OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT ++/////////////////////////////////////////////////////////////////////////// ++// ++// Copyright (c) 2009-2014 DreamWorks Animation LLC. ++// ++// All rights reserved. ++// ++// Redistribution and use in source and binary forms, with or without ++// modification, are permitted provided that the following conditions are ++// met: ++// * Redistributions of source code must retain the above copyright ++// notice, this list of conditions and the following disclaimer. ++// * Redistributions in binary form must reproduce the above ++// copyright notice, this list of conditions and the following disclaimer ++// in the documentation and/or other materials provided with the ++// distribution. ++// * Neither the name of DreamWorks Animation nor the names of ++// its contributors may be used to endorse or promote products derived ++// from this software without specific prior written permission. ++// ++// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ++// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT ++// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR ++// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT ++// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, ++// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT ++// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE ++// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++// ++/////////////////////////////////////////////////////////////////////////// ++ ++#include "ImfSimd.h" ++#include "ImfSystemSpecific.h" ++#include "ImfNamespace.h" ++#include "OpenEXRConfig.h" ++ ++OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER ++ ++namespace { ++#if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__ANDROID__) ++ ++ // Helper functions for gcc + SSE enabled ++ void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ { ++ #ifdef __i386__ ++ __asm__ __volatile__ ( ++ "pushl %%ebx; cpuid; movl %%ebx, %0; popl %%ebx" ++ : /* Output */ "=m"(ebx), "=a"(eax), "=c"(ecx), "=d"(edx) ++ : /* Input */ "a"(n) ++ : /* Clobber */); ++ #else ++ __asm__ __volatile__ ( ++ "cpuid" ++ : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) ++ : /* Input */ "a"(n) ++ : /* Clobber */); ++ #endif ++ } ++ ++#else // IMF_HAVE_SSE2 && __GNUC__ ++ ++ // Helper functions for generic compiler - all disabled ++ void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ { ++ eax = ebx = ecx = edx = 0; ++ } ++ ++#endif // IMF_HAVE_SSE2 && __GNUC__ ++ ++ ++#ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX ++ ++ void xgetbv(int n, int &eax, int &edx) ++ { ++ __asm__ __volatile__ ( ++ "xgetbv" ++ : /* Output */ "=a"(eax), "=d"(edx) ++ : /* Input */ "c"(n) ++ : /* Clobber */); ++ } ++ ++#else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX ++ ++ void xgetbv(int n, int &eax, int &edx) ++ { ++ eax = edx = 0; ++ } ++ ++#endif // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX ++ ++} // namespace ++ ++CpuId::CpuId(): ++ sse2(false), ++ sse3(false), ++ ssse3(false), ++ sse4_1(false), ++ sse4_2(false), ++ avx(false), ++ f16c(false) ++{ ++ bool osxsave = false; ++ int max = 0; ++ int eax, ebx, ecx, edx; ++ ++ cpuid(0, max, ebx, ecx, edx); ++ if (max > 0) ++ { ++ cpuid(1, eax, ebx, ecx, edx); ++ sse2 = ( edx & (1<<26) ); ++ sse3 = ( ecx & (1<< 0) ); ++ ssse3 = ( ecx & (1<< 9) ); ++ sse4_1 = ( ecx & (1<<19) ); ++ sse4_2 = ( ecx & (1<<20) ); ++ osxsave = ( ecx & (1<<27) ); ++ avx = ( ecx & (1<<28) ); ++ f16c = ( ecx & (1<<29) ); ++ ++ if (!osxsave) ++ { ++ avx = f16c = false; ++ } ++ else ++ { ++ xgetbv(0, eax, edx); ++ // eax bit 1 - SSE managed, bit 2 - AVX managed ++ if ((eax & 6) != 6) ++ { ++ avx = f16c = false; ++ } ++ } ++ } ++ ++#if defined(IMF_HAVE_SSE2) && defined(__ANDROID__) ++ sse2 = true; ++ sse3 = true; ++#ifdef __x86_64__ ++ ssse3 = true; ++ sse4_1 = true; ++#endif ++#endif ++} ++ ++OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT diff --git a/setup.py b/setup.py index 4589bde8..f6684f91 100644 --- a/setup.py +++ b/setup.py @@ -149,6 +149,8 @@ def main(): # see https://github.com/skvark/opencv-python/issues/138 if sys.platform.startswith('linux') and not x64: cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__") + # patch openEXR when building on i386, see: https://github.com/openexr/openexr/issues/128 + subprocess.check_call(["patch", "-p0", "<", "patches/patchOpenEXR"]) if 'CMAKE_ARGS' in os.environ: From c36d98e09e3c89d44ab30543fba7d3ad0744f465 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 23 Aug 2019 08:20:11 -0400 Subject: [PATCH 055/293] fix patch file --- patches/patchOpenEXR | 304 ++++--------------------------------------- 1 file changed, 22 insertions(+), 282 deletions(-) diff --git a/patches/patchOpenEXR b/patches/patchOpenEXR index 52dba087..6633e844 100644 --- a/patches/patchOpenEXR +++ b/patches/patchOpenEXR @@ -1,288 +1,28 @@ diff -ruN opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp ---- opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-22 20:02:54.769176800 +0300 -+++ opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 14:31:17.103949100 +0300 -@@ -1,138 +1,146 @@ --/////////////////////////////////////////////////////////////////////////// --// --// Copyright (c) 2009-2014 DreamWorks Animation LLC. --// --// All rights reserved. --// --// Redistribution and use in source and binary forms, with or without --// modification, are permitted provided that the following conditions are --// met: --// * Redistributions of source code must retain the above copyright --// notice, this list of conditions and the following disclaimer. --// * Redistributions in binary form must reproduce the above --// copyright notice, this list of conditions and the following disclaimer --// in the documentation and/or other materials provided with the --// distribution. --// * Neither the name of DreamWorks Animation nor the names of --// its contributors may be used to endorse or promote products derived --// from this software without specific prior written permission. --// --// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS --// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT --// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR --// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT --// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, --// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT --// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, --// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY --// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT --// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE --// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. --// --/////////////////////////////////////////////////////////////////////////// -- --#include "ImfSimd.h" --#include "ImfSystemSpecific.h" --#include "ImfNamespace.h" --#include "OpenEXRConfig.h" -- --OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER -- --namespace { --#if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__ANDROID__) -- -- // Helper functions for gcc + SSE enabled -- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) -- { +--- opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 08:11:43.536117200 -0400 ++++ opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 08:16:58.337879800 -0400 +@@ -44,11 +44,19 @@ + // Helper functions for gcc + SSE enabled + void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) + { - __asm__ __volatile__ ( - "cpuid" - : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) - : /* Input */ "a"(n) - : /* Clobber */); -- } -- --#else // IMF_HAVE_SSE2 && __GNUC__ -- -- // Helper functions for generic compiler - all disabled -- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) -- { -- eax = ebx = ecx = edx = 0; -- } -- --#endif // IMF_HAVE_SSE2 && __GNUC__ -- -- --#ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -- -- void xgetbv(int n, int &eax, int &edx) -- { -- __asm__ __volatile__ ( -- "xgetbv" -- : /* Output */ "=a"(eax), "=d"(edx) -- : /* Input */ "c"(n) -- : /* Clobber */); -- } -- --#else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -- -- void xgetbv(int n, int &eax, int &edx) -- { -- eax = edx = 0; -- } -- --#endif // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -- --} // namespace -- --CpuId::CpuId(): -- sse2(false), -- sse3(false), -- ssse3(false), -- sse4_1(false), -- sse4_2(false), -- avx(false), -- f16c(false) --{ -- bool osxsave = false; -- int max = 0; -- int eax, ebx, ecx, edx; -- -- cpuid(0, max, ebx, ecx, edx); -- if (max > 0) -- { -- cpuid(1, eax, ebx, ecx, edx); -- sse2 = ( edx & (1<<26) ); -- sse3 = ( ecx & (1<< 0) ); -- ssse3 = ( ecx & (1<< 9) ); -- sse4_1 = ( ecx & (1<<19) ); -- sse4_2 = ( ecx & (1<<20) ); -- osxsave = ( ecx & (1<<27) ); -- avx = ( ecx & (1<<28) ); -- f16c = ( ecx & (1<<29) ); -- -- if (!osxsave) -- { -- avx = f16c = false; -- } -- else -- { -- xgetbv(0, eax, edx); -- // eax bit 1 - SSE managed, bit 2 - AVX managed -- if ((eax & 6) != 6) -- { -- avx = f16c = false; -- } -- } -- } -- --#if defined(IMF_HAVE_SSE2) && defined(__ANDROID__) -- sse2 = true; -- sse3 = true; --#ifdef __x86_64__ -- ssse3 = true; -- sse4_1 = true; --#endif --#endif --} -- --OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT -+/////////////////////////////////////////////////////////////////////////// -+// -+// Copyright (c) 2009-2014 DreamWorks Animation LLC. -+// -+// All rights reserved. -+// -+// Redistribution and use in source and binary forms, with or without -+// modification, are permitted provided that the following conditions are -+// met: -+// * Redistributions of source code must retain the above copyright -+// notice, this list of conditions and the following disclaimer. -+// * Redistributions in binary form must reproduce the above -+// copyright notice, this list of conditions and the following disclaimer -+// in the documentation and/or other materials provided with the -+// distribution. -+// * Neither the name of DreamWorks Animation nor the names of -+// its contributors may be used to endorse or promote products derived -+// from this software without specific prior written permission. -+// -+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -+// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -+// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -+// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -+// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -+// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -+// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -+// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -+// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -+// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -+// -+/////////////////////////////////////////////////////////////////////////// -+ -+#include "ImfSimd.h" -+#include "ImfSystemSpecific.h" -+#include "ImfNamespace.h" -+#include "OpenEXRConfig.h" -+ -+OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_ENTER -+ -+namespace { -+#if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__ANDROID__) -+ -+ // Helper functions for gcc + SSE enabled -+ void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) -+ { -+ #ifdef __i386__ -+ __asm__ __volatile__ ( -+ "pushl %%ebx; cpuid; movl %%ebx, %0; popl %%ebx" -+ : /* Output */ "=m"(ebx), "=a"(eax), "=c"(ecx), "=d"(edx) -+ : /* Input */ "a"(n) -+ : /* Clobber */); -+ #else -+ __asm__ __volatile__ ( -+ "cpuid" -+ : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) -+ : /* Input */ "a"(n) -+ : /* Clobber */); -+ #endif -+ } -+ -+#else // IMF_HAVE_SSE2 && __GNUC__ -+ -+ // Helper functions for generic compiler - all disabled -+ void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) -+ { -+ eax = ebx = ecx = edx = 0; -+ } -+ -+#endif // IMF_HAVE_SSE2 && __GNUC__ -+ -+ -+#ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -+ -+ void xgetbv(int n, int &eax, int &edx) -+ { -+ __asm__ __volatile__ ( -+ "xgetbv" -+ : /* Output */ "=a"(eax), "=d"(edx) -+ : /* Input */ "c"(n) -+ : /* Clobber */); -+ } -+ -+#else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -+ -+ void xgetbv(int n, int &eax, int &edx) -+ { -+ eax = edx = 0; -+ } -+ -+#endif // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX -+ -+} // namespace -+ -+CpuId::CpuId(): -+ sse2(false), -+ sse3(false), -+ ssse3(false), -+ sse4_1(false), -+ sse4_2(false), -+ avx(false), -+ f16c(false) -+{ -+ bool osxsave = false; -+ int max = 0; -+ int eax, ebx, ecx, edx; -+ -+ cpuid(0, max, ebx, ecx, edx); -+ if (max > 0) -+ { -+ cpuid(1, eax, ebx, ecx, edx); -+ sse2 = ( edx & (1<<26) ); -+ sse3 = ( ecx & (1<< 0) ); -+ ssse3 = ( ecx & (1<< 9) ); -+ sse4_1 = ( ecx & (1<<19) ); -+ sse4_2 = ( ecx & (1<<20) ); -+ osxsave = ( ecx & (1<<27) ); -+ avx = ( ecx & (1<<28) ); -+ f16c = ( ecx & (1<<29) ); -+ -+ if (!osxsave) -+ { -+ avx = f16c = false; -+ } -+ else -+ { -+ xgetbv(0, eax, edx); -+ // eax bit 1 - SSE managed, bit 2 - AVX managed -+ if ((eax & 6) != 6) -+ { -+ avx = f16c = false; -+ } -+ } -+ } -+ -+#if defined(IMF_HAVE_SSE2) && defined(__ANDROID__) -+ sse2 = true; -+ sse3 = true; -+#ifdef __x86_64__ -+ ssse3 = true; -+ sse4_1 = true; -+#endif -+#endif -+} -+ -+OPENEXR_IMF_INTERNAL_NAMESPACE_SOURCE_EXIT ++ #ifdef __i386__ ++ __asm__ __volatile__ ( ++ "pushl %%ebx; cpuid; movl %%ebx, %0; popl %%ebx" ++ : /* Output */ "=m"(ebx), "=a"(eax), "=c"(ecx), "=d"(edx) ++ : /* Input */ "a"(n) ++ : /* Clobber */); ++ #else ++ __asm__ __volatile__ ( ++ "cpuid" ++ : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) ++ : /* Input */ "a"(n) ++ : /* Clobber */); ++ #endif + } + + #else // IMF_HAVE_SSE2 && __GNUC__ From 45a77d6c6e24519de68e08f71742f078526623c4 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 25 Aug 2019 15:57:26 +0300 Subject: [PATCH 056/293] fix subprocess call --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f6684f91..5f67e56b 100644 --- a/setup.py +++ b/setup.py @@ -150,7 +150,7 @@ def main(): if sys.platform.startswith('linux') and not x64: cmake_args.append("-DCMAKE_CXX_FLAGS=-U__STRICT_ANSI__") # patch openEXR when building on i386, see: https://github.com/openexr/openexr/issues/128 - subprocess.check_call(["patch", "-p0", "<", "patches/patchOpenEXR"]) + subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True) if 'CMAKE_ARGS' in os.environ: From 22e5ae842115a00a2f8a4d34b82c6f8eb767433f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 25 Aug 2019 10:55:31 -0400 Subject: [PATCH 057/293] fix patch --- patches/patchOpenEXR | 66 ++++++++++++++++++++++++++++++++------------ 1 file changed, 49 insertions(+), 17 deletions(-) diff --git a/patches/patchOpenEXR b/patches/patchOpenEXR index 6633e844..e2a1ffc7 100644 --- a/patches/patchOpenEXR +++ b/patches/patchOpenEXR @@ -1,28 +1,60 @@ diff -ruN opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp ---- opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 08:11:43.536117200 -0400 -+++ opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-23 08:16:58.337879800 -0400 -@@ -44,11 +44,19 @@ +--- opencv/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-25 10:40:57.596395000 -0400 ++++ opencv_patched/3rdparty/openexr/IlmImf/ImfSystemSpecific.cpp 2019-08-25 10:53:15.331689900 -0400 +@@ -40,21 +40,19 @@ + + namespace { + #if defined(IMF_HAVE_SSE2) && defined(__GNUC__) && !defined(__ANDROID__) +- ++#include // Helper functions for gcc + SSE enabled - void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, ++ unsigned int &ecx, unsigned int &edx) { - __asm__ __volatile__ ( - "cpuid" - : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) - : /* Input */ "a"(n) - : /* Clobber */); -+ #ifdef __i386__ -+ __asm__ __volatile__ ( -+ "pushl %%ebx; cpuid; movl %%ebx, %0; popl %%ebx" -+ : /* Output */ "=m"(ebx), "=a"(eax), "=c"(ecx), "=d"(edx) -+ : /* Input */ "a"(n) -+ : /* Clobber */); -+ #else -+ __asm__ __volatile__ ( -+ "cpuid" -+ : /* Output */ "=a"(eax), "=b"(ebx), "=c"(ecx), "=d"(edx) -+ : /* Input */ "a"(n) -+ : /* Clobber */); -+ #endif ++ __get_cpuid(n, &eax, &ebx, &ecx, &edx); } #else // IMF_HAVE_SSE2 && __GNUC__ + + // Helper functions for generic compiler - all disabled +- void cpuid(int n, int &eax, int &ebx, int &ecx, int &edx) ++ void cpuid(unsigned int n, unsigned int &eax, unsigned int &ebx, ++ unsigned int &ecx, unsigned int &edx) + { + eax = ebx = ecx = edx = 0; + } +@@ -64,7 +62,7 @@ + + #ifdef OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX + +- void xgetbv(int n, int &eax, int &edx) ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx) + { + __asm__ __volatile__ ( + "xgetbv" +@@ -75,7 +73,7 @@ + + #else // OPENEXR_IMF_HAVE_GCC_INLINE_ASM_AVX + +- void xgetbv(int n, int &eax, int &edx) ++ void xgetbv(unsigned int n, unsigned int &eax, unsigned int &edx) + { + eax = edx = 0; + } +@@ -94,8 +92,8 @@ + f16c(false) + { + bool osxsave = false; +- int max = 0; +- int eax, ebx, ecx, edx; ++ unsigned int max = 0; ++ unsigned int eax, ebx, ecx, edx; + + cpuid(0, max, ebx, ecx, edx); + if (max > 0) From 59243695afc3ad161cd5ce9bc1d753f88cb4d19d Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 19 Nov 2019 17:56:38 +0200 Subject: [PATCH 058/293] OpenCV 3.4.8 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index ddbd10c0..6bdb9ca7 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit ddbd10c0019f3ee5f43b7902d47e7fc4303a6574 +Subproject commit 6bdb9ca725de52ada2b452699fbbd39d8ef41188 diff --git a/opencv_contrib b/opencv_contrib index 0915b7ea..9d3efbd8 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 0915b7eaddba3c06d83e201c9a7595e73801f417 +Subproject commit 9d3efbd8f159f04fdb4e1d05693c922b5f06b1d7 From 9fc0c169344018e99f4b3e044c1461aaf079d09e Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 19 Nov 2019 18:24:44 +0200 Subject: [PATCH 059/293] revert ffmpeg binary search path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e45eee5a..cac1456b 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { - 'cv2': ([r'bin/opencv_videoio_ffmpeg\d{3}%s\.dll' % ('_64' if x64 else '')] if os.name == 'nt' else []) + + 'cv2': ([r'bin/opencv_ffmpeg\d{3}%s\.dll' % ('_64' if x64 else '')] if os.name == 'nt' else []) + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From 32ce23ec0f971db4b88cbeff837e2e57000817b2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 19 Nov 2019 19:28:28 +0200 Subject: [PATCH 060/293] fix data search path --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index cac1456b..24666ab0 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ def main(): ['python/cv2[^/]*%(ext)s' % {'ext': re.escape(sysconfig.get_config_var('SO'))}], 'cv2.data': [ # OPENCV_OTHER_INSTALL_PATH - ('etc' if os.name == 'nt' else 'share/opencv4') + + ('etc' if os.name == 'nt' else 'share/OpenCV') + r'/haarcascades/.*\.xml' ] } From aec30500ac592fdfb24ac1547731f0fa91d1e04f Mon Sep 17 00:00:00 2001 From: Mateusz Bysiek Date: Sat, 7 Dec 2019 14:31:05 +0900 Subject: [PATCH 061/293] don't use deprecated brew tap-pin instead refer to the full package name when installing fixes https://github.com/skvark/opencv-python/issues/266 context: https://brew.sh/2019/04/04/homebrew-2.1.0/ https://github.com/Homebrew/brew/pull/5925 --- travis_config.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index f79883f1..526d7180 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -98,11 +98,10 @@ function pre_build { echo 'Installing QT4' brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 - brew tap --list-pinned | grep -qxF cartr/qt4 || brew tap-pin cartr/qt4 if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } + brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else - brew install qt@4 + brew install cartr/qt4/qt@4 fi echo 'Installing FFmpeg' From 89d683499f4822a71acc47e6d89c77c1ff09fae4 Mon Sep 17 00:00:00 2001 From: Pascal Chambon Date: Fri, 22 Nov 2019 17:07:12 +0100 Subject: [PATCH 062/293] add workaround for DLL errors in Windows Server. --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 12222ab5..40326573 100644 --- a/README.md +++ b/README.md @@ -52,6 +52,8 @@ A: If the import fails on Windows, make sure you have [Visual C++ redistributabl Windows N and KN editions do not include Media Feature Pack which is required by OpenCV. If you are using Windows N or KN edition, please install also [Windows Media Feature Pack](https://support.microsoft.com/en-us/help/3145500/media-feature-pack-list-for-windows-n-editions). +If you have Windows Server 2012+, media DLLs are probably missing too; please install the Feature called "Media Foundation" in the Server Manager. Beware, some posts advise to install "Windows Server Essentials Media Pack", but this one requires the "Windows Server Essentials Experience" role, and this role will deeply affect your Windows Server configuration (by enforcing active directory integration etc.); so just installing the "Media Foundation" should be a safer choice. + If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/skvark/opencv-python/issues/36) for a manual fix. If you still encounter the error after you have checked all the previous solutions, download [Dependencies](https://github.com/lucasg/Dependencies) and open the ``cv2.pyd`` (located usually at ``C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2``) file with it to debug missing DLL issues. From 3848ecfb208ae7d19675fdcd9f0d16efec0cf49b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BB=BA=E5=86=9B?= Date: Fri, 27 Dec 2019 16:29:51 +0800 Subject: [PATCH 063/293] fix: give up get_config_var() and use get_config_vars() instead. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 24666ab0..2cce857e 100644 --- a/setup.py +++ b/setup.py @@ -67,7 +67,7 @@ def main(): package_data = { 'cv2': - ['*%s' % sysconfig.get_config_var('SO')] + + ['*%s' % sysconfig.get_config_vars().get('SO')] + (['*.dll'] if os.name == 'nt' else []) + ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"], 'cv2.data': From cde3c56bb0ce65a2c73ea833ba5b3b88f2e3188f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 9 Jan 2020 19:45:41 +0200 Subject: [PATCH 064/293] update dockerfiles --- docker/Dockerfile_i686 | 4 ++-- docker/Dockerfile_x86_64 | 4 ++-- docker/README.md | 6 ++---- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/docker/Dockerfile_i686 b/docker/Dockerfile_i686 index d5b315a2..cffc998c 100644 --- a/docker/Dockerfile_i686 +++ b/docker/Dockerfile_i686 @@ -61,8 +61,8 @@ RUN cd ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ + tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install diff --git a/docker/Dockerfile_x86_64 b/docker/Dockerfile_x86_64 index f7b0b081..c4d47bc7 100644 --- a/docker/Dockerfile_x86_64 +++ b/docker/Dockerfile_x86_64 @@ -61,8 +61,8 @@ RUN cd ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.13.02/nasm-2.13.02.tar.bz2 && \ - tar -xf nasm-2.13.02.tar.bz2 && cd nasm-2.13.02 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ + tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install diff --git a/docker/README.md b/docker/README.md index e31d7a07..4ac6033c 100644 --- a/docker/README.md +++ b/docker/README.md @@ -2,13 +2,11 @@ This folder includes Dockerfiles for extending both ``i686`` and ``x86_64`` manylinux images. -The extended images were created to be able to build OpenCV in reasonable time with Travis. - -These images have been built locally because the process takes over 1,5 hours with modern i7 processor. The images are hosted at https://quay.io/user/skvark. +The extended images were created to be able to build OpenCV in reasonable time with Travis. The images are hosted at https://quay.io/user/skvark. The images have following extra software installed: - Qt 4.8.7 - Cmake 3.9.0 -- FFmpeg with libvpx (latest snapshots at the build time) and recent openssl +- FFmpeg with libvpx (latest snapshots at the build time) and recent openssl + other FFmpeg dependencies built from sources - Some missing headers included from more recent Linux to be able to enable V4L / V4L2 support in OpenCV \ No newline at end of file From cd5aa672c399081ba0880ffe7d30fb73ebf65bf9 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 9 Jan 2020 21:35:13 +0200 Subject: [PATCH 065/293] OpenCV 3.4.9 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 6bdb9ca7..64e6cf9f 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 6bdb9ca725de52ada2b452699fbbd39d8ef41188 +Subproject commit 64e6cf9fe50ef25d317d3529a42d4862b93f002a diff --git a/opencv_contrib b/opencv_contrib index 9d3efbd8..91b39aa0 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 9d3efbd8f159f04fdb4e1d05693c922b5f06b1d7 +Subproject commit 91b39aa038600425038df6722a5b4d1b5d7b5ca6 From 5d4357b6719c5a370c3444b216fbbf980d661686 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 11 Jan 2020 14:41:54 +0200 Subject: [PATCH 066/293] try to fix macos builds --- travis_config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 526d7180..a2bd4d44 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,6 +101,8 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else + # Added due to: Error: openssl@1.0 is already installed from homebrew/core! Please `brew uninstall openssl@1.0` first." + brew uninstall openssl@1.0 brew install cartr/qt4/qt@4 fi @@ -119,7 +121,7 @@ function pre_build { # Have to install macpython late to avoid conflict with Homebrew Python update before_install - + else echo "Running for linux" fi From 7abef67bbc857f8ec84ccecf3d721cc58f1d2d9f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 11 Jan 2020 15:49:16 +0200 Subject: [PATCH 067/293] Revert "try to fix macos builds" This reverts commit 5d4357b6719c5a370c3444b216fbbf980d661686. --- travis_config.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index a2bd4d44..526d7180 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,8 +101,6 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else - # Added due to: Error: openssl@1.0 is already installed from homebrew/core! Please `brew uninstall openssl@1.0` first." - brew uninstall openssl@1.0 brew install cartr/qt4/qt@4 fi @@ -121,7 +119,7 @@ function pre_build { # Have to install macpython late to avoid conflict with Homebrew Python update before_install - + else echo "Running for linux" fi From cc739293cc43f857cd3938a54b8ff5c4360d89f3 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 11 Jan 2020 16:40:16 +0200 Subject: [PATCH 068/293] try to repair --- travis_config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 526d7180..f2d885b1 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,6 +101,8 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else + brew tap --repair + brew audit cartr/qt4/qt@4 brew install cartr/qt4/qt@4 fi @@ -119,7 +121,7 @@ function pre_build { # Have to install macpython late to avoid conflict with Homebrew Python update before_install - + else echo "Running for linux" fi From 37ef0d5a4ddae8aa4c6ad8fdbc7ea457294f3271 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 11 Jan 2020 17:06:42 +0200 Subject: [PATCH 069/293] remove audit --- travis_config.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index f2d885b1..f7c773b9 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -102,7 +102,6 @@ function pre_build { brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else brew tap --repair - brew audit cartr/qt4/qt@4 brew install cartr/qt4/qt@4 fi From fbcfa54625998b8d7418e68e4fdde305a946245d Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 13 Jan 2020 17:51:17 +0200 Subject: [PATCH 070/293] switch to Qt5 --- setup.py | 5 ++++- travis_config.sh | 8 +++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 2cce857e..779ea233 100644 --- a/setup.py +++ b/setup.py @@ -123,9 +123,12 @@ def main(): ] + (["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else []) # OS-specific components - if (sys.platform == 'darwin' or sys.platform.startswith('linux')) and not build_headless: + if sys.platform.startswith('linux') and not build_headless: cmake_args.append("-DWITH_QT=4") + if sys.platform == 'darwin' and not build_headless: + cmake_args.append("-DWITH_QT=5") + if build_headless: # it seems that cocoa cannot be disabled so on macOS the package is not truly headless cmake_args.append("-DWITH_WIN32UI=OFF") diff --git a/travis_config.sh b/travis_config.sh index f7c773b9..3db6e4e5 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -96,13 +96,11 @@ function pre_build { brew_add_local_bottles fi - echo 'Installing QT4' - brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 + echo 'Installing qt5' if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } + brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } else - brew tap --repair - brew install cartr/qt4/qt@4 + brew install qt5 fi echo 'Installing FFmpeg' From 8a6e17eac33130a0f2c8e41abbc53dfe1c827b0b Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Wed, 15 Jan 2020 19:14:31 +0200 Subject: [PATCH 071/293] Revert "switch to Qt5" This reverts commit fbcfa54625998b8d7418e68e4fdde305a946245d. --- setup.py | 5 +---- travis_config.sh | 8 +++++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/setup.py b/setup.py index 779ea233..2cce857e 100644 --- a/setup.py +++ b/setup.py @@ -123,12 +123,9 @@ def main(): ] + (["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else []) # OS-specific components - if sys.platform.startswith('linux') and not build_headless: + if (sys.platform == 'darwin' or sys.platform.startswith('linux')) and not build_headless: cmake_args.append("-DWITH_QT=4") - if sys.platform == 'darwin' and not build_headless: - cmake_args.append("-DWITH_QT=5") - if build_headless: # it seems that cocoa cannot be disabled so on macOS the package is not truly headless cmake_args.append("-DWITH_WIN32UI=OFF") diff --git a/travis_config.sh b/travis_config.sh index 3db6e4e5..f7c773b9 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -96,11 +96,13 @@ function pre_build { brew_add_local_bottles fi - echo 'Installing qt5' + echo 'Installing QT4' + brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } + brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else - brew install qt5 + brew tap --repair + brew install cartr/qt4/qt@4 fi echo 'Installing FFmpeg' From 6d91fc217fa44ba57b76cb92025ddb120d74c1d2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Wed, 15 Jan 2020 19:15:56 +0200 Subject: [PATCH 072/293] try again with qt4 --- travis_config.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index f7c773b9..36ca29aa 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,7 +101,6 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } else - brew tap --repair brew install cartr/qt4/qt@4 fi From a7991d7dd5a9be8e3e2a493fd0c461d7b6731f62 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 16 Jan 2020 17:16:34 +0200 Subject: [PATCH 073/293] upgrade macOS env to xcode9.4 and use Qt5 --- .travis.yml | 42 +++++++++++++++++++++--------------------- setup.py | 5 ++++- travis_config.sh | 7 +++---- 3 files changed, 28 insertions(+), 26 deletions(-) diff --git a/.travis.yml b/.travis.yml index d5f56edd..92165672 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,7 +38,7 @@ matrix: include: - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 stage: s1 workspaces: create: @@ -64,7 +64,7 @@ matrix: #further jobs in the list will use the same stage until the next assignment - stage: final os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -72,7 +72,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -80,7 +80,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -88,7 +88,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -97,7 +97,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=0 @@ -108,7 +108,7 @@ matrix: # headless builds for MacOS - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=0 @@ -116,7 +116,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -124,7 +124,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -132,7 +132,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -141,7 +141,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=0 @@ -152,7 +152,7 @@ matrix: # Contrib builds for MacOS - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -160,7 +160,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -168,7 +168,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -176,7 +176,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -185,7 +185,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=1 @@ -196,7 +196,7 @@ matrix: # headless contrib builds for MacOS - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=2.7 - ENABLE_CONTRIB=1 @@ -204,7 +204,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -212,7 +212,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 @@ -220,7 +220,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=1 @@ -229,7 +229,7 @@ matrix: workspaces: use: brew_cache - os: osx - osx_image: xcode8.3 + osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=1 diff --git a/setup.py b/setup.py index 2cce857e..779ea233 100644 --- a/setup.py +++ b/setup.py @@ -123,9 +123,12 @@ def main(): ] + (["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib else []) # OS-specific components - if (sys.platform == 'darwin' or sys.platform.startswith('linux')) and not build_headless: + if sys.platform.startswith('linux') and not build_headless: cmake_args.append("-DWITH_QT=4") + if sys.platform == 'darwin' and not build_headless: + cmake_args.append("-DWITH_QT=5") + if build_headless: # it seems that cocoa cannot be disabled so on macOS the package is not truly headless cmake_args.append("-DWITH_WIN32UI=OFF") diff --git a/travis_config.sh b/travis_config.sh index 36ca29aa..3db6e4e5 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -96,12 +96,11 @@ function pre_build { brew_add_local_bottles fi - echo 'Installing QT4' - brew tap | grep -qxF cartr/qt4 || brew tap cartr/qt4 + echo 'Installing qt5' if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit cartr/qt4/qt@4 || { [ $? -gt 1 ] && return 2 || return 0; } + brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } else - brew install cartr/qt4/qt@4 + brew install qt5 fi echo 'Installing FFmpeg' From f92b787105f5b9c7787d3562484ba061e8fda18a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Thu, 16 Jan 2020 18:19:56 +0200 Subject: [PATCH 074/293] update multibuild --- multibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multibuild b/multibuild index 68a4af04..24d35a4a 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 68a4af043e2adb0d9353d4a0e1f3d871203237aa +Subproject commit 24d35a4af2583473a0ec224dbe1990dd1e0ace5d From 932c024377bef7957e5e3ff0937fad27cfb7dc5f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 21 Jan 2020 16:19:04 +0200 Subject: [PATCH 075/293] unlink python2 --- travis_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis_config.sh b/travis_config.sh index 3db6e4e5..a3fa30d6 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -108,6 +108,7 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else + brew unlink python@2 brew install ffmpeg_opencv fi From 64a747aeee7cecff16b90d4850b5b46f6486290d Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 21 Jan 2020 17:23:49 +0200 Subject: [PATCH 076/293] link qt5 --- travis_config.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/travis_config.sh b/travis_config.sh index a3fa30d6..eeb58f10 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,6 +101,7 @@ function pre_build { brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } else brew install qt5 + brew link qt5 --force fi echo 'Installing FFmpeg' From f62aef6028cec7bd03ae6eaa880881e5d7d46578 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 1 Feb 2020 13:54:06 +0200 Subject: [PATCH 077/293] try just exporting to the path --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index eeb58f10..27875867 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,7 +101,7 @@ function pre_build { brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } else brew install qt5 - brew link qt5 --force + export PATH="/usr/local/opt/qt/bin:$PATH" fi echo 'Installing FFmpeg' From a7e34e9cff72bb9b4ccb2dae604e62e3a6261863 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 1 Feb 2020 14:25:11 +0200 Subject: [PATCH 078/293] update multibuild --- multibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multibuild b/multibuild index 24d35a4a..6b0ddb52 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 24d35a4af2583473a0ec224dbe1990dd1e0ace5d +Subproject commit 6b0ddb5281f59d976c8026c082c9d73faf274790 From 2801a962a667e049f62d6f46d70bbf4bd9de42ab Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Mar 2020 13:55:24 +0200 Subject: [PATCH 079/293] merge changes from master, update licenses --- .gitignore | 1 + .travis.yml | 302 ++++++++++++++++++----------------------- LICENSE-3RD-PARTY.txt | 174 +++++++++++++++++++++++- LICENSE.txt | 2 +- README.md | 7 +- cv2/__init__.py | 7 + patches/patchQtPlugins | 12 ++ setup.py | 4 +- 8 files changed, 329 insertions(+), 180 deletions(-) create mode 100644 patches/patchQtPlugins diff --git a/.gitignore b/.gitignore index 87caa5f8..0367e1b0 100644 --- a/.gitignore +++ b/.gitignore @@ -67,3 +67,4 @@ target/ # Build temporary files /contrib.enabled /cv_version.py +_skbuild/ diff --git a/.travis.yml b/.travis.yml index 92165672..75801595 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,13 +8,6 @@ env: - CONFIG_PATH="travis_config.sh" - USE_CCACHE=1 - UNICODE_WIDTH=32 - - MB_PYTHON_VERSION=3.7 - -# Host Python is never used -language: generic -services: docker -# https://docs.travis-ci.com/user/reference/xenial -dist: xenial # Save some time, we and setup check them out on demand instead # https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth @@ -33,11 +26,15 @@ stages: - s1 - final -matrix: +jobs: fast_finish: true + exclude: + - language: ruby include: - - os: osx + env: + - MB_PYTHON_VERSION=3.8 + language: generic osx_image: xcode9.4 stage: s1 workspaces: @@ -63,15 +60,8 @@ matrix: # default builds for MacOS #further jobs in the list will use the same stage until the next assignment - stage: final - os: osx - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - workspaces: - use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 @@ -80,6 +70,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 @@ -88,6 +79,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 @@ -97,6 +89,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 @@ -108,14 +101,7 @@ matrix: # headless builds for MacOS - os: osx - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - workspaces: - use: brew_cache - - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 @@ -124,6 +110,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 @@ -132,6 +119,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 @@ -141,6 +129,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 @@ -152,14 +141,7 @@ matrix: # Contrib builds for MacOS - os: osx - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - workspaces: - use: brew_cache - - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 @@ -168,6 +150,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 @@ -176,6 +159,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 @@ -185,6 +169,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 @@ -196,14 +181,7 @@ matrix: # headless contrib builds for MacOS - os: osx - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - workspaces: - use: brew_cache - - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.5 @@ -212,6 +190,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.6 @@ -220,6 +199,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.7 @@ -229,6 +209,7 @@ matrix: workspaces: use: brew_cache - os: osx + language: generic osx_image: xcode9.4 env: - MB_PYTHON_VERSION=3.8 @@ -240,38 +221,9 @@ matrix: # default builds for Linux - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -279,6 +231,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - PLAT=i686 @@ -287,6 +242,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -295,6 +253,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 @@ -304,6 +265,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -312,6 +276,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - PLAT=i686 @@ -321,6 +288,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=0 @@ -329,6 +299,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - PLAT=i686 @@ -340,38 +313,9 @@ matrix: # headless builds for Linux - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=0 @@ -379,6 +323,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - PLAT=i686 @@ -387,6 +334,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 @@ -395,6 +345,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 @@ -404,6 +357,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - ENABLE_CONTRIB=0 @@ -412,6 +368,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - PLAT=i686 @@ -421,6 +380,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - ENABLE_CONTRIB=0 @@ -429,6 +391,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - PLAT=i686 @@ -440,38 +405,9 @@ matrix: # contrib builds for Linux - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -479,6 +415,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - PLAT=i686 @@ -487,6 +426,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - TEST_DEPENDS=numpy==1.11.3 @@ -495,6 +437,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 @@ -504,6 +449,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - TEST_DEPENDS=numpy==1.14.5 @@ -512,6 +460,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - PLAT=i686 @@ -521,6 +472,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - TEST_DEPENDS=numpy==1.17.3 @@ -529,6 +483,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - PLAT=i686 @@ -541,38 +498,9 @@ matrix: # headless contrib builds for Linux - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - env: - - MB_PYTHON_VERSION=2.7 - - PLAT=i686 - - UNICODE_WIDTH=16 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - ENABLE_CONTRIB=1 @@ -580,6 +508,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.5 - PLAT=i686 @@ -588,6 +519,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - TEST_DEPENDS=numpy==1.11.3 @@ -596,6 +530,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 @@ -605,6 +542,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - TEST_DEPENDS=numpy==1.14.5 @@ -613,6 +553,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.7 - PLAT=i686 @@ -622,6 +565,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - TEST_DEPENDS=numpy==1.17.3 @@ -630,6 +576,9 @@ matrix: cache: directories: $HOME/.ccache - os: linux + language: generic + dist: xenial + services: docker env: - MB_PYTHON_VERSION=3.8 - PLAT=i686 @@ -711,7 +660,7 @@ before_cache: | set +x; set +e after_success: | - # Upload wheels to pypi if requested + # Upload wheels to pypi if tag is set, otherwise save to Azure Storage if [ -n "$TRAVIS_TAG" ]; then set -x @@ -742,5 +691,16 @@ after_success: | twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* set +x else - echo "Tag not set, deployment skipped." + set -x + + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + else + brew install azure-cli + fi + + az storage container create -n ${TRAVIS_COMMIT} --public-access blob + az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern *.whl + + set -x fi diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 9daba95c..83551feb 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -10,12 +10,13 @@ copy or use the software. For Open Source Computer Vision Library (3-clause BSD License) -Copyright (C) 2000-2018, Intel Corporation, all rights reserved. +Copyright (C) 2000-2020, Intel Corporation, all rights reserved. Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +Copyright (C) 2019-2020, Xperience AI, all rights reserved. Third party copyrights are property of their respective owners. Redistribution and use in source and binary forms, with or without modification, @@ -80,7 +81,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ FFmpeg is redistributed within opencv-python Windows packages. -Qt 4.8.7 is redistributed within opencv-python Linux and macOS packages. +Qt 4.8.7 is redistributed within opencv-python Linux packages. This license applies to FFmpeg and Qt binaries in the directory cv2/. GNU LESSER GENERAL PUBLIC LICENSE @@ -585,3 +586,172 @@ necessary. Here is a sample; alter the names: Ty Coon, President of Vice That's all there is to it! + +------------------------------------------------------------------------------ +Qt 5 is redistributed within opencv-pytho macOS packages. +This license applies to Qt binaries in the directory cv2/. + + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. \ No newline at end of file diff --git a/LICENSE.txt b/LICENSE.txt index e8005c63..328bf506 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2016-2018 Olli-Pekka Heinisuo and contributors +Copyright (c) Olli-Pekka Heinisuo Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 40326573..46806e1a 100644 --- a/README.md +++ b/README.md @@ -128,7 +128,9 @@ Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/s All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). -Linux and MacOS wheels ship with [Qt 4.8.7](http://doc.qt.io/qt-4.8/lgpl.html) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). +Linux wheels ship with [Qt 4.8.7](http://doc.qt.io/qt-4.8/lgpl.html) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). + +MacOS wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). ### Versioning @@ -158,13 +160,10 @@ The default ``manylinux`` images have been extended with some OpenCV dependencie ### Supported Python versions -Python 2.7 is the only supported version in 2.x series. Python 2.7 support will be dropped in the end of 2019. - Python 3.x releases are provided for officially supported versions (not in EOL). Currently, builds for following Python versions are provided: -- 2.7 - 3.5 - 3.6 - 3.7 diff --git a/cv2/__init__.py b/cv2/__init__.py index 7612351b..ee8cd254 100644 --- a/cv2/__init__.py +++ b/cv2/__init__.py @@ -1,4 +1,6 @@ import importlib +import os +import sys from .cv2 import * from .data import * @@ -6,3 +8,8 @@ # wildcard import above does not import "private" variables like __version__ # this makes them available globals().update(importlib.import_module('cv2.cv2').__dict__) + +if sys.platform == 'darwin': + os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = os.path.join( + os.path.dirname(os.path.abspath(__file__)), 'qt', 'plugins' + ) diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins new file mode 100644 index 00000000..00b84582 --- /dev/null +++ b/patches/patchQtPlugins @@ -0,0 +1,12 @@ +diff --git a/opencv/CMakeLists.txt b/opencv/CMakeLists.txt +index 8ccad4d03a..0d5e2a79e9 100644 +--- a/opencv/CMakeLists.txt ++++ b/opencv/CMakeLists.txt +@@ -1164,6 +1164,7 @@ if(WITH_QT OR HAVE_QT) + if(HAVE_QT5) + status(" QT:" "YES (ver ${Qt5Core_VERSION_STRING})") + status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_VERSION_STRING})" ELSE NO) ++ install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + elseif(HAVE_QT) + status(" QT:" "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})") + status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO) diff --git a/setup.py b/setup.py index 779ea233..3f9ca68d 100644 --- a/setup.py +++ b/setup.py @@ -128,6 +128,7 @@ def main(): if sys.platform == 'darwin' and not build_headless: cmake_args.append("-DWITH_QT=5") + rearrange_cmake_output_data['cv2.qt.plugins.platforms'] = [(r'lib/qt/plugins/platforms/libqcocoa\.dylib')] if build_headless: # it seems that cocoa cannot be disabled so on macOS the package is not truly headless @@ -144,6 +145,7 @@ def main(): # https://github.com/skvark/opencv-python/issues/21 cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++") cmake_args.append("-DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=10.9") + subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True) if sys.platform == 'darwin' and build_contrib: cmake_args.append("-DCMAKE_CXX_FLAGS=-stdlib=libc++ -std=c++11 -Wno-c++11-narrowing") @@ -203,8 +205,6 @@ def main(): 'Operating System :: POSIX', 'Operating System :: Unix', 'Programming Language :: Python', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', From b043422b263cd87c8767dd8134716f8ec847f5a5 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Mar 2020 13:56:02 +0200 Subject: [PATCH 080/293] update multibuild --- multibuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/multibuild b/multibuild index 6b0ddb52..da36cd54 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 6b0ddb5281f59d976c8026c082c9d73faf274790 +Subproject commit da36cd5408e03cad504217de4a21bb8f19f2fb2f From 07c4d737e2dad55c5f9238257b5104e9949b36fd Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Mar 2020 14:09:55 +0200 Subject: [PATCH 081/293] disable MSMF in headless builds #263 --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 3f9ca68d..4ebb8811 100644 --- a/setup.py +++ b/setup.py @@ -134,6 +134,7 @@ def main(): # it seems that cocoa cannot be disabled so on macOS the package is not truly headless cmake_args.append("-DWITH_WIN32UI=OFF") cmake_args.append("-DWITH_QT=OFF") + cmake_args.append("-DWITH_MSMF=OFF") # see: https://github.com/skvark/opencv-python/issues/263 if sys.platform.startswith('linux'): cmake_args.append("-DWITH_V4L=ON") From fcb818b12885bbc780db116c39a9c4207d626898 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Mar 2020 21:05:50 +0200 Subject: [PATCH 082/293] remove python 2.7 --- appveyor.yml | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index bebe6e16..dab586c7 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,14 +6,6 @@ environment: secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= matrix: - - PYTHON: "C:/Python27" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:/Python27-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python35" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 @@ -46,14 +38,6 @@ environment: ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python27" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:/Python27-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python35" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 @@ -86,14 +70,6 @@ environment: ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python27" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:/Python27-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python35" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 @@ -126,14 +102,6 @@ environment: ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python27" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:/Python27-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python35" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 From fb48abe6af6239d4166328ce9062a5d529b194a9 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 4 Apr 2020 20:17:11 +0300 Subject: [PATCH 083/293] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 46806e1a..6a710cd2 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ A: Make sure you have removed old manual installations of OpenCV Python bindings **Q: Why the packages do not include non-free algorithms?** -A: Non-free algorithms such as SIFT and SURF are not included in these packages because they are patented and therefore cannot be distributed as built binaries. See this issue for more info: https://github.com/skvark/opencv-python/issues/126 +A: Non-free algorithms such as SURF are not included in these packages because they are patented / non-free and therefore cannot be distributed as built binaries. Note that SIFT is included in the builds due to patent expiration since OpenCV versions 4.3.0 and 3.4.10. See this issue for more info: https://github.com/skvark/opencv-python/issues/126 **Q: Why the package and import are different (opencv-python vs. cv2)?** From c08b0d771b8722ffeb859474b1b4a67e0f11a370 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 4 Apr 2020 20:18:18 +0300 Subject: [PATCH 084/293] OpenCV 3.4.10 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 64e6cf9f..1cc1e6fa 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 64e6cf9fe50ef25d317d3529a42d4862b93f002a +Subproject commit 1cc1e6fa563f160b54f9c62da965002cab55ca96 diff --git a/opencv_contrib b/opencv_contrib index 91b39aa0..5d2cf95a 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 91b39aa038600425038df6722a5b4d1b5d7b5ca6 +Subproject commit 5d2cf95afce53d1f742117ae39c9189a0ae4b4dd From d958923cdd6fd7e23cb62722f645c64fbc6796fd Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 5 Apr 2020 12:54:45 +0300 Subject: [PATCH 085/293] fix FFmpeg binary regex pattern --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4ebb8811..962775ee 100644 --- a/setup.py +++ b/setup.py @@ -78,7 +78,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { - 'cv2': ([r'bin/opencv_ffmpeg\d{3}%s\.dll' % ('_64' if x64 else '')] if os.name == 'nt' else []) + + 'cv2': ([r'bin/opencv_ffmpeg\d{3,4}%s\.dll' % ('_64' if x64 else '')] if os.name == 'nt' else []) + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From bf4e05620cf70123b4108f2069899c3347126c13 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 17 Jul 2020 15:33:05 +0300 Subject: [PATCH 086/293] fix sdist upload --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index a95fea50..26b345b4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -760,7 +760,7 @@ after_success: | pip install --user --upgrade six if [[ $SDIST == 1 ]]; then - twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist + twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi @@ -775,7 +775,7 @@ after_success: | /usr/bin/python -m pip install --user -U -I twine if [[ $SDIST == 1 ]]; then - /usr/bin/python -m upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist + /usr/bin/python -m upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else /usr/bin/python -m upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi From f411d56c174c441164bacd2f47d814495929acbb Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 17 Jul 2020 23:18:32 +0300 Subject: [PATCH 087/293] fix find_version bug and clean up README --- README.md | 8 ++++---- find_version.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cb79ea3e..c13b1b48 100644 --- a/README.md +++ b/README.md @@ -134,12 +134,12 @@ If some dependency is not enabled in the pre-built wheels, you can also run the Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources. -You can also force ``pip`` to build the wheels from the source distribution for example with: +You can also force ``pip`` to build the wheels from the source distribution. Some examples: -``pip install --no-binary opencv-python opencv-python`` -``pip install --no-binary :all: opencv-python`` +- ``pip install --no-binary opencv-python opencv-python`` +- ``pip install --no-binary :all: opencv-python`` -If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies and enable them. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies. +If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies. Please note that build tools and ``numpy`` are required for the build to succeed. On slow systems such as Raspberry Pi the full build may take several hours. On a 8-core Ryzen 7 3700X the build takes about 6 minutes. diff --git a/find_version.py b/find_version.py index 5210c8b1..76d9f86d 100644 --- a/find_version.py +++ b/find_version.py @@ -5,7 +5,7 @@ if __name__ == "__main__": contrib = sys.argv[1] headless = sys.argv[2] - ci_build = sys.argv[2] + ci_build = sys.argv[3] opencv_version = "" # dig out the version from OpenCV sources From a49fdc600fe076d7729e15e97d3805e636eb1b73 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 8 Aug 2020 21:05:50 +0300 Subject: [PATCH 088/293] fix windows builds --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index fab105ef..f3b209b3 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ def main(): minimum_supported_numpy = "1.13.1" build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") - build_java = 'ON' if get_build_env_var_by_name("java") else 'OFF' + build_java = "ON" if get_build_env_var_by_name("java") else "OFF" if sys.version_info[:2] >= (3, 6): minimum_supported_numpy = "1.13.3" @@ -162,7 +162,11 @@ def main(): # OS-specific components during CI builds if is_CI_build: - if not build_headless and "bdist_wheel" in sys.argv: + if ( + not build_headless + and "bdist_wheel" in sys.argv + and (sys.platform == "darwin" or sys.platform.startswith("linux")) + ): cmake_args.append("-DWITH_QT=5") subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True) From 70988b9e41a6e3a1833befb98775d09d3c85dd34 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 8 Aug 2020 23:49:13 +0300 Subject: [PATCH 089/293] patch only on linux --- travis_config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index d80d7147..fe1b7865 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -16,7 +16,9 @@ function bdist_wheel_cmd { local abs_wheelhouse=$1 CI_BUILD=1 pip wheel --wheel-dir="$PWD/dist" . --verbose $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse - /opt/python/cp37-cp37m/bin/python patch_auditwheel_whitelist.py + if [ -z "$IS_OSX" ]; then + /opt/python/cp37-cp37m/bin/python patch_auditwheel_whitelist.py + fi if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } From 8660b61dbc982049866b9fc08e8b35deba7e22b6 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 9 Aug 2020 14:35:05 +0300 Subject: [PATCH 090/293] reduce verbosity --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index fe1b7865..3cf99356 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -14,7 +14,7 @@ function bdist_wheel_cmd { # copied from multibuild's common_utils.sh # add osx deployment target so it doesnt default to 10.6 local abs_wheelhouse=$1 - CI_BUILD=1 pip wheel --wheel-dir="$PWD/dist" . --verbose $BDIST_PARAMS + CI_BUILD=1 pip wheel --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then /opt/python/cp37-cp37m/bin/python patch_auditwheel_whitelist.py From e0ff6f905e418eea1c3055a18aa1931806bc44af Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 9 Aug 2020 16:08:04 +0300 Subject: [PATCH 091/293] fix min numpy version for 3.6 --- .travis.yml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 26b345b4..19072fca 100644 --- a/.travis.yml +++ b/.travis.yml @@ -119,6 +119,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 + - TEST_DEPENDS=numpy==1.13.3 workspaces: use: brew_cache - os: osx @@ -159,6 +160,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 + - TEST_DEPENDS=numpy==1.13.3 workspaces: use: brew_cache - os: osx @@ -199,6 +201,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 + - TEST_DEPENDS=numpy==1.13.3 workspaces: use: brew_cache - os: osx @@ -239,6 +242,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 + - TEST_DEPENDS=numpy==1.13.3 workspaces: use: brew_cache - os: osx @@ -293,7 +297,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 cache: directories: $HOME/.ccache - os: linux @@ -305,7 +309,7 @@ jobs: - PLAT=i686 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - USE_CCACHE=0 cache: directories: $HOME/.ccache @@ -389,7 +393,7 @@ jobs: - MB_PYTHON_VERSION=3.6 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 cache: directories: $HOME/.ccache - os: linux @@ -401,7 +405,7 @@ jobs: - PLAT=i686 - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - USE_CCACHE=0 cache: directories: $HOME/.ccache @@ -483,7 +487,7 @@ jobs: services: docker env: - MB_PYTHON_VERSION=3.6 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 cache: @@ -495,7 +499,7 @@ jobs: env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - USE_CCACHE=0 @@ -580,7 +584,7 @@ jobs: services: docker env: - MB_PYTHON_VERSION=3.6 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 cache: @@ -592,7 +596,7 @@ jobs: env: - MB_PYTHON_VERSION=3.6 - PLAT=i686 - - TEST_DEPENDS=numpy==1.11.3 + - TEST_DEPENDS=numpy==1.13.3 - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - USE_CCACHE=0 From 4049947cdac87c7c75126b0c0c5f93c44bbc9754 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 9 Aug 2020 16:28:22 +0300 Subject: [PATCH 092/293] fix sdist upload --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 19072fca..6355aaa0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -760,12 +760,12 @@ after_success: | fi if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - pip install --user twine - pip install --user --upgrade six - if [[ $SDIST == 1 ]]; then + pip install twine twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else + pip install --user twine + pip install --user --upgrade six twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi From 469036736e22d2f1e6e08e5de096b74c64f4f794 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 9 Aug 2020 19:21:00 +0300 Subject: [PATCH 093/293] fix twine upload command --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6355aaa0..4f77cd77 100644 --- a/.travis.yml +++ b/.travis.yml @@ -779,9 +779,9 @@ after_success: | /usr/bin/python -m pip install --user -U -I twine if [[ $SDIST == 1 ]]; then - /usr/bin/python -m upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* + /usr/bin/python -m twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else - /usr/bin/python -m upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* + /usr/bin/python -m twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi fi From 80e63d48392bb86b2fe35fc8593a314fc239e34a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 10 Aug 2020 16:50:22 +0300 Subject: [PATCH 094/293] fix the travis USER issue --- .travis.yml | 8 ++++---- travis_config.sh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4f77cd77..81cc9d87 100644 --- a/.travis.yml +++ b/.travis.yml @@ -762,11 +762,11 @@ after_success: | if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then if [[ $SDIST == 1 ]]; then pip install twine - twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* + twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else pip install --user twine pip install --user --upgrade six - twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* + twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi fi @@ -779,9 +779,9 @@ after_success: | /usr/bin/python -m pip install --user -U -I twine if [[ $SDIST == 1 ]]; then - /usr/bin/python -m twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* + /usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* else - /usr/bin/python -m twine upload -u ${USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* + /usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* fi fi diff --git a/travis_config.sh b/travis_config.sh index 3cf99356..59f82bbb 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -92,7 +92,7 @@ function pre_build { echo "Running for OSX" local CACHE_STAGE; (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1 - export USER=travis + #after the cache stage, all bottles and Homebrew metadata should be already cached locally if [ -n "$CACHE_STAGE" ]; then brew update From 54b7720b45cfc564201a73dc428efba6ffe3129f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 10 Aug 2020 16:55:46 +0300 Subject: [PATCH 095/293] OpenCV 3.4.11 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 1cc1e6fa..e8d4259f 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 1cc1e6fa563f160b54f9c62da965002cab55ca96 +Subproject commit e8d4259f9ab787b512b9aa1203fc816fb9f19231 diff --git a/opencv_contrib b/opencv_contrib index 5d2cf95a..3ce9ec6c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 5d2cf95afce53d1f742117ae39c9189a0ae4b4dd +Subproject commit 3ce9ec6c827b7b715ba9f7282f5670925c903b56 From a70c89ab9d746bca6b14b3cfe53f59cc4a02054b Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 10 Aug 2020 16:57:02 +0300 Subject: [PATCH 096/293] add minimum supported Python version --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index f3b209b3..54aa5988 100644 --- a/setup.py +++ b/setup.py @@ -220,6 +220,7 @@ def main(): maintainer="Olli-Pekka Heinisuo", ext_modules=EmptyListWithLength(), install_requires=numpy_version, + python_requires=">=3.5", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", From 8a23c55330bf45ba03c821c527f2b5a96b14fc87 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 11 Aug 2020 13:57:43 +0300 Subject: [PATCH 097/293] Add note about manylinux2014 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 513520e4..e0caf36f 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,11 @@ Frequently Asked Questions A: No, the packages are special wheel binary packages and they already contain statically built OpenCV binaries. -**Q: Pip fails with ``Could not find a version that satisfies the requirement ...``?** +**Q: Pip install fails with ``ModuleNotFoundError: No module named 'skbuild'``?** + +Since ``opencv-python`` version 3.4.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 3.4.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. + +**Q: Pip install fails with ``Could not find a version that satisfies the requirement ...``?** A: Most likely the issue is related to too old pip and can be fixed by running ``pip install --upgrade pip``. Note that the wheel (especially manylinux) format does not currently support properly ARM architecture so there are no packages for ARM based platforms in PyPI. However, ``opencv-python`` packages for Raspberry Pi can be found from https://www.piwheels.org/. From e29f6f4c8c9ec356aea5be9a620c8c3e2884ab24 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 11 Aug 2020 17:33:52 +0300 Subject: [PATCH 098/293] fix typo in version --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0caf36f..5ba434bf 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ A: No, the packages are special wheel binary packages and they already contain s **Q: Pip install fails with ``ModuleNotFoundError: No module named 'skbuild'``?** -Since ``opencv-python`` version 3.4.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 3.4.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. +Since ``opencv-python`` version 4.3.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 3.4.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. **Q: Pip install fails with ``Could not find a version that satisfies the requirement ...``?** From 3c332dfa4f613e3dc8cabd013b68c40243489198 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 11 Aug 2020 17:36:32 +0300 Subject: [PATCH 099/293] another typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5ba434bf..946880d6 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ A: No, the packages are special wheel binary packages and they already contain s **Q: Pip install fails with ``ModuleNotFoundError: No module named 'skbuild'``?** -Since ``opencv-python`` version 4.3.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 3.4.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. +Since ``opencv-python`` version 4.3.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 4.3.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. **Q: Pip install fails with ``Could not find a version that satisfies the requirement ...``?** From a055e92a53b3d89c07050013c5563606e5d8b3d7 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 14 Aug 2020 18:26:23 +0300 Subject: [PATCH 100/293] add aarch64 Dockerfile --- docker/manylinux2014/Dockerfile_aarch64 | 66 +++++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 docker/manylinux2014/Dockerfile_aarch64 diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 new file mode 100644 index 00000000..77af8a8a --- /dev/null +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -0,0 +1,66 @@ +FROM quay.io/pypa/manylinux2014_aarch64:latest + +RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y + +RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ + tar -xf qt-everywhere-src-5.15.0.tar.xz && \ + cd qt-everywhere* && \ + export MAKEFLAGS=-j$(nproc) && \ + ./configure -prefix /opt/Qt5.15.0 -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + make && \ + make install && \ + cd .. && \ + rm -rf qt-everywhere-src-5.15.0 && \ + rm qt-everywhere-src-5.15.0.tar.xz + +ENV QTDIR /opt/Qt5.15.0 +ENV PATH "$QTDIR/bin:$PATH" + +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ + tar -xf OpenSSL_1_1_1c.tar.gz && \ + cd openssl-OpenSSL_1_1_1c && \ + ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + # skip installing documentation + make install_sw && \ + rm -rf ~/openssl_build + +RUN cd ~/ffmpeg_sources && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ + tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install + +RUN cd ~/ffmpeg_sources && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ + tar -xf yasm-1.3.0.tar.gz && \ + cd yasm-1.3.0 && \ + ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install + +RUN cd ~/ffmpeg_sources && \ + git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install + +RUN cd ~/ffmpeg_sources && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ + tar -xf ffmpeg-snapshot.tar.bz2 && \ + cd ffmpeg && \ + PATH=~/bin:$PATH && \ + PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + ldconfig && \ + rm -rf ~/ffmpeg_sources + +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/root/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" From 207e183ceb0055e1437bfa79ad3823357373afb8 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 14 Aug 2020 18:34:28 +0300 Subject: [PATCH 101/293] force Qt 5.13 --- travis_config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index 59f82bbb..ba183b3b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -14,7 +14,7 @@ function bdist_wheel_cmd { # copied from multibuild's common_utils.sh # add osx deployment target so it doesnt default to 10.6 local abs_wheelhouse=$1 - CI_BUILD=1 pip wheel --wheel-dir="$PWD/dist" . $BDIST_PARAMS + CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then /opt/python/cp37-cp37m/bin/python patch_auditwheel_whitelist.py @@ -102,9 +102,9 @@ function pre_build { echo 'Installing qt5' if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit qt5 || { [ $? -gt 1 ] && return 2 || return 0; } + echo "Qt5 has bottle, no caching needed" else - brew install qt5 + brew install qt@5.13 export PATH="/usr/local/opt/qt/bin:$PATH" fi @@ -114,7 +114,7 @@ function pre_build { brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else brew unlink python@2 - brew install -vd ffmpeg_opencv + brew install ffmpeg_opencv fi if [ -n "$CACHE_STAGE" ]; then From 436e8f2b6f8438f50a793fdc0be3f7d08bf1af31 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 14 Aug 2020 21:11:45 +0300 Subject: [PATCH 102/293] 5.13.2 --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index ba183b3b..e4f2c187 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -104,7 +104,7 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew install qt@5.13 + brew install qt@5.13.2 export PATH="/usr/local/opt/qt/bin:$PATH" fi From 67699a29b960bbde451ad14e43b8cb20e414a71d Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 14 Aug 2020 23:18:31 +0300 Subject: [PATCH 103/293] direct link --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index e4f2c187..10bea551 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -104,7 +104,7 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew install qt@5.13.2 + brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb export PATH="/usr/local/opt/qt/bin:$PATH" fi From 72f10b4c4a85bca743ca5844d38ef6307ace7964 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 15 Aug 2020 00:23:33 +0300 Subject: [PATCH 104/293] no auto update, use extract --- travis_config.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 10bea551..8f13ca2b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -92,6 +92,7 @@ function pre_build { echo "Running for OSX" local CACHE_STAGE; (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1 + export HOMEBREW_NO_AUTO_UPDATE=1 #after the cache stage, all bottles and Homebrew metadata should be already cached locally if [ -n "$CACHE_STAGE" ]; then @@ -104,7 +105,8 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb + brew extract qt --version=5.13.2 + brew install qt@5.13.2 export PATH="/usr/local/opt/qt/bin:$PATH" fi From e3cc9a8f14473b7cdeac373429e15a8bc66d73ce Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 15 Aug 2020 01:13:26 +0300 Subject: [PATCH 105/293] just use the raw url directly --- travis_config.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index 8f13ca2b..9913c87e 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -105,8 +105,7 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew extract qt --version=5.13.2 - brew install qt@5.13.2 + brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb export PATH="/usr/local/opt/qt/bin:$PATH" fi From ebfac6b2034edc2b0e4de1746ddc0570a0d17ba2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 16 Aug 2020 13:02:06 +0300 Subject: [PATCH 106/293] unlink and reinstall --- travis_config.sh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index 9913c87e..ff07ae7d 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -101,14 +101,6 @@ function pre_build { brew_add_local_bottles fi - echo 'Installing qt5' - if [ -n "$CACHE_STAGE" ]; then - echo "Qt5 has bottle, no caching needed" - else - brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb - export PATH="/usr/local/opt/qt/bin:$PATH" - fi - echo 'Installing FFmpeg' if [ -n "$CACHE_STAGE" ]; then @@ -118,6 +110,16 @@ function pre_build { brew install ffmpeg_opencv fi + echo 'Installing qt5' + + if [ -n "$CACHE_STAGE" ]; then + echo "Qt5 has bottle, no caching needed" + else + brew unlink qt + brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb + export PATH="/usr/local/opt/qt/bin:$PATH" + fi + if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0 return 0 From b0225dd657ac94dfb9e549ca3d6dc574837a23a6 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 16 Aug 2020 14:17:18 +0300 Subject: [PATCH 107/293] force qt uninstall --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index ff07ae7d..d5a1989b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -115,7 +115,7 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew unlink qt + brew uninstall --force qt@5.15.0 brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb export PATH="/usr/local/opt/qt/bin:$PATH" fi From 8dc0f4d8b3f49f4bf5ada0fdeb048406fd0cc7f8 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 16 Aug 2020 16:17:17 +0300 Subject: [PATCH 108/293] use switch instead --- travis_config.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index d5a1989b..6f9f6511 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -115,8 +115,8 @@ function pre_build { if [ -n "$CACHE_STAGE" ]; then echo "Qt5 has bottle, no caching needed" else - brew uninstall --force qt@5.15.0 - brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/079ce55db79acc87b91bec950249595b1584e119/Formula/qt.rb + brew switch qt 5.13.2 + brew pin qt export PATH="/usr/local/opt/qt/bin:$PATH" fi From 928952d99a2be5c0c20e5a0de1df9b4ea3891ce2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 17 Aug 2020 19:24:42 +0300 Subject: [PATCH 109/293] drop Python 3.5 support --- .travis.yml | 121 +++------------------------------------------------ appveyor.yml | 32 -------------- setup.py | 3 +- 3 files changed, 6 insertions(+), 150 deletions(-) diff --git a/.travis.yml b/.travis.yml index 81cc9d87..f79e1907 100644 --- a/.travis.yml +++ b/.travis.yml @@ -103,15 +103,6 @@ jobs: # default builds for MacOS #further jobs in the list will use the same stage until the next assignment - stage: final - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - workspaces: - use: brew_cache - os: osx language: generic osx_image: xcode9.4 @@ -144,15 +135,6 @@ jobs: use: brew_cache # headless builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - workspaces: - use: brew_cache - os: osx language: generic osx_image: xcode9.4 @@ -185,15 +167,6 @@ jobs: use: brew_cache # Contrib builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - workspaces: - use: brew_cache - os: osx language: generic osx_image: xcode9.4 @@ -226,15 +199,6 @@ jobs: use: brew_cache # headless contrib builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - workspaces: - use: brew_cache - os: osx language: generic osx_image: xcode9.4 @@ -267,28 +231,6 @@ jobs: use: brew_cache # default builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux language: generic dist: xenial @@ -361,30 +303,21 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - # headless builds for Linux - os: linux language: generic dist: xenial services: docker env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 + - MB_PYTHON_VERSION=3.8 - PLAT=i686 - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 + - ENABLE_HEADLESS=0 + - TEST_DEPENDS=numpy==1.17.3 - USE_CCACHE=0 cache: directories: $HOME/.ccache + + # headless builds for Linux - os: linux language: generic dist: xenial @@ -459,28 +392,6 @@ jobs: directories: $HOME/.ccache # contrib builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - PLAT=i686 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux language: generic dist: xenial @@ -556,28 +467,6 @@ jobs: # headless contrib builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.5 - - PLAT=i686 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux language: generic dist: xenial diff --git a/appveyor.yml b/appveyor.yml index 8b058c68..3dde3d23 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,14 +6,6 @@ environment: secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= matrix: - - PYTHON: "C:/Python35" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:/Python35-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 @@ -38,14 +30,6 @@ environment: ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python35" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:/Python35-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 @@ -70,14 +54,6 @@ environment: ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python35" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:/Python35-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 @@ -102,14 +78,6 @@ environment: ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python35" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:/Python35-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 diff --git a/setup.py b/setup.py index 54aa5988..212dbfcb 100644 --- a/setup.py +++ b/setup.py @@ -220,7 +220,7 @@ def main(): maintainer="Olli-Pekka Heinisuo", ext_modules=EmptyListWithLength(), install_requires=numpy_version, - python_requires=">=3.5", + python_requires=">=3.6", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", @@ -235,7 +235,6 @@ def main(): "Operating System :: Unix", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", From 22086f8713c2114fc50c085e3fb7c60523868b27 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 22 Sep 2020 16:31:45 +0300 Subject: [PATCH 110/293] remove file --- docker/manylinux2014/Dockerfile_aarch64.orig | 93 -------------------- 1 file changed, 93 deletions(-) delete mode 100644 docker/manylinux2014/Dockerfile_aarch64.orig diff --git a/docker/manylinux2014/Dockerfile_aarch64.orig b/docker/manylinux2014/Dockerfile_aarch64.orig deleted file mode 100644 index 6edc4cef..00000000 --- a/docker/manylinux2014/Dockerfile_aarch64.orig +++ /dev/null @@ -1,93 +0,0 @@ -FROM quay.io/pypa/manylinux2014_aarch64:latest - -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y - -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ - cd qt-everywhere* && \ - export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ - make && \ - make install && \ - cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz - -ENV QTDIR /opt/Qt5.15.0 -ENV PATH "$QTDIR/bin:$PATH" - -RUN mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ -<<<<<<< HEAD - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1c.tar.gz && \ - tar -xf OpenSSL_1_1_1c.tar.gz && \ - cd openssl-OpenSSL_1_1_1c && \ - ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" shared zlib && \ -======= - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ - ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ ->>>>>>> master - make -j$(getconf _NPROCESSORS_ONLN) && \ - # skip installing documentation - make install_sw && \ - rm -rf ~/openssl_build - -RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ - tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j$(getconf _NPROCESSORS_ONLN) && \ - make install - -RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ - make -j$(getconf _NPROCESSORS_ONLN) && \ - make install - -RUN cd ~/ffmpeg_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ - cd libvpx && \ - ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ - make -j$(getconf _NPROCESSORS_ONLN) && \ - make install - -RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ - PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ - make -j$(getconf _NPROCESSORS_ONLN) && \ - make install && \ - echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ - ldconfig && \ - rm -rf ~/ffmpeg_sources - -<<<<<<< HEAD -======= -RUN curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.9/ccache-3.7.9.tar.gz && \ - tar -xf ccache-3.7.9.tar.gz && \ - cd ccache-3.7.9 && \ - linux32 ./configure && \ - make -j$(getconf _NPROCESSORS_ONLN) && \ - make install - -RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz && \ - tar -xf cmake-3.17.0.tar.gz && \ - cd cmake-3.17.0 && \ - export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ - ./configure --system-curl && \ - make && \ - make install && \ - cd .. && \ - rm -rf cmake-3.17.0* - ->>>>>>> master -ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig -ENV LDFLAGS -L/root/ffmpeg_build/lib -ENV PATH "$HOME/bin:$PATH" From 649cfc1d98a30690acfd10a47b11f1ac8da21b51 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Fri, 30 Oct 2020 22:55:24 +0200 Subject: [PATCH 111/293] fix py39 entry --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9b583ed7..406a0797 100644 --- a/.travis.yml +++ b/.travis.yml @@ -352,7 +352,6 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.19.3 - - USE_CCACHE=0 cache: directories: $HOME/.ccache - os: linux From 285348bc19c7e31ec7974f9c8febbb6fbc12ef17 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 1 Nov 2020 16:06:27 +0200 Subject: [PATCH 112/293] fix min numpy version --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 55fcbccd..b58ea894 100644 --- a/setup.py +++ b/setup.py @@ -27,6 +27,8 @@ def main(): minimum_supported_numpy = "1.14.5" if sys.version_info[:2] >= (3, 8): minimum_supported_numpy = "1.17.3" + if sys.version_info[:2] >= (3, 9): + minimum_supported_numpy = "1.19.3" numpy_version = "numpy>=%s" % minimum_supported_numpy From ea7c4164a5b1ae316a219935b69f24947ff7fd9f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 1 Nov 2020 16:13:15 +0200 Subject: [PATCH 113/293] download Python 3.9 manually --- appveyor.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index b658399a..3e5d8053 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -137,6 +137,16 @@ environment: matrix: fast_finish: true +install: + - ps: | + if (-not (Test-Path $env:PYTHON)) { + curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/devel/install_python.ps1 + .\install_python.ps1 + } + - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } + - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" + - python --version + build_script: - cmd: | "%PYTHON%/python.exe" -m pip install --upgrade pip From 603e2a329cd0cc1ba0171999475c97d9e4dfcf8e Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 1 Nov 2020 18:43:24 +0200 Subject: [PATCH 114/293] fix slashes --- appveyor.yml | 78 ++++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 3e5d8053..30646669 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,131 +6,131 @@ environment: secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= matrix: - - PYTHON: "C:/Python36" + - PYTHON: "C:\Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36-x64" + - PYTHON: "C:\Python36-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python37" + - PYTHON: "C:\Python37" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python37-x64" + - PYTHON: "C:\Python37-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python38" + - PYTHON: "C:\Python38" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python38-x64" + - PYTHON: "C:\Python38-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python39" + - PYTHON: "C:\Python39" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python39-x64" + - PYTHON: "C:\Python39-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36" + - PYTHON: "C:\Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36-x64" + - PYTHON: "C:\Python36-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python37" + - PYTHON: "C:\Python37" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python37-x64" + - PYTHON: "C:\Python37-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python38" + - PYTHON: "C:\Python38" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python38-x64" + - PYTHON: "C:\Python38-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python39" + - PYTHON: "C:\Python39" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python39-x64" + - PYTHON: "C:\Python39-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:/Python36" + - PYTHON: "C:\Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python36-x64" + - PYTHON: "C:\Python36-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python37" + - PYTHON: "C:\Python37" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python37-x64" + - PYTHON: "C:\Python37-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python38" + - PYTHON: "C:\Python38" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python38-x64" + - PYTHON: "C:\Python38-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python39" + - PYTHON: "C:\Python39" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python39-x64" + - PYTHON: "C:\Python39-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python36" + - PYTHON: "C:\Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python36-x64" + - PYTHON: "C:\Python36-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python37" + - PYTHON: "C:\Python37" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python37-x64" + - PYTHON: "C:\Python37-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python38" + - PYTHON: "C:\Python38" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python38-x64" + - PYTHON: "C:\Python38-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python39" + - PYTHON: "C:\Python39" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:/Python39-x64" + - PYTHON: "C:\Python39-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 @@ -149,23 +149,23 @@ install: build_script: - cmd: | - "%PYTHON%/python.exe" -m pip install --upgrade pip - "%PYTHON%/python.exe" -m pip install --upgrade setuptools - set "CI_BUILD=1" && "%PYTHON%/python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose + "%PYTHON%\python.exe" -m pip install --upgrade pip + "%PYTHON%\python.exe" -m pip install --upgrade setuptools + set "CI_BUILD=1" && "%PYTHON%\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose before_test: - ps: | cd ${Env:APPVEYOR_BUILD_FOLDER}\tests $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command" - &"${Env:PYTHON}/python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") + &"${Env:PYTHON}\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} test_script: - cmd: | cd %APPVEYOR_BUILD_FOLDER%\tests - "%PYTHON%/python.exe" -m unittest test + "%PYTHON%\python.exe" -m unittest test artifacts: - path: dist\opencv*.whl @@ -193,8 +193,8 @@ deploy_script: } } - &"${Env:PYTHON}/python.exe" -m pip install twine - &"${Env:PYTHON}/python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* + &"${Env:PYTHON}\python.exe" -m pip install twine + &"${Env:PYTHON}\python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* } else { echo "Tag not set, deployment skipped." From 6b377bade9e8127188ab748c1b8ac14efa87374a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 1 Nov 2020 19:12:54 +0200 Subject: [PATCH 115/293] another fix for slashes --- appveyor.yml | 78 ++++++++++++++++++++++++++-------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 30646669..c79e7de4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,131 +6,131 @@ environment: secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= matrix: - - PYTHON: "C:\Python36" + - PYTHON: "C:\\Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python36-x64" + - PYTHON: "C:\\Python36-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python37" + - PYTHON: "C:\\Python37" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python37-x64" + - PYTHON: "C:\\Python37-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python38" + - PYTHON: "C:\\Python38" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python38-x64" + - PYTHON: "C:\\Python38-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python39" + - PYTHON: "C:\\Python39" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python39-x64" + - PYTHON: "C:\\Python39-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python36" + - PYTHON: "C:\\Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python36-x64" + - PYTHON: "C:\\Python36-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python37" + - PYTHON: "C:\\Python37" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python37-x64" + - PYTHON: "C:\\Python37-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python38" + - PYTHON: "C:\\Python38" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python38-x64" + - PYTHON: "C:\\Python38-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python39" + - PYTHON: "C:\\Python39" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python39-x64" + - PYTHON: "C:\\Python39-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 0 - - PYTHON: "C:\Python36" + - PYTHON: "C:\\Python36" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python36-x64" + - PYTHON: "C:\\Python36-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python37" + - PYTHON: "C:\\Python37" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python37-x64" + - PYTHON: "C:\\Python37-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python38" + - PYTHON: "C:\\Python38" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python38-x64" + - PYTHON: "C:\\Python38-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python39" + - PYTHON: "C:\\Python39" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python39-x64" + - PYTHON: "C:\\Python39-x64" ENABLE_CONTRIB: 0 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python36" + - PYTHON: "C:\\Python36" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python36-x64" + - PYTHON: "C:\\Python36-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python37" + - PYTHON: "C:\\Python37" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python37-x64" + - PYTHON: "C:\\Python37-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python38" + - PYTHON: "C:\\Python38" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python38-x64" + - PYTHON: "C:\\Python38-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python39" + - PYTHON: "C:\\Python39" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 - - PYTHON: "C:\Python39-x64" + - PYTHON: "C:\\Python39-x64" ENABLE_CONTRIB: 1 ENABLE_HEADLESS: 1 @@ -149,23 +149,23 @@ install: build_script: - cmd: | - "%PYTHON%\python.exe" -m pip install --upgrade pip - "%PYTHON%\python.exe" -m pip install --upgrade setuptools - set "CI_BUILD=1" && "%PYTHON%\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose + "%PYTHON%\\python.exe" -m pip install --upgrade pip + "%PYTHON%\\python.exe" -m pip install --upgrade setuptools + set "CI_BUILD=1" && "%PYTHON%\\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose before_test: - ps: | cd ${Env:APPVEYOR_BUILD_FOLDER}\tests $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command" - &"${Env:PYTHON}\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") + &"${Env:PYTHON}\\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} test_script: - cmd: | cd %APPVEYOR_BUILD_FOLDER%\tests - "%PYTHON%\python.exe" -m unittest test + "%PYTHON%\\python.exe" -m unittest test artifacts: - path: dist\opencv*.whl @@ -193,8 +193,8 @@ deploy_script: } } - &"${Env:PYTHON}\python.exe" -m pip install twine - &"${Env:PYTHON}\python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* + &"${Env:PYTHON}\\python.exe" -m pip install twine + &"${Env:PYTHON}\\python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* } else { echo "Tag not set, deployment skipped." From e98379369e0dcf3f4b636d6b42b5a0815182416c Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 2 Nov 2020 18:15:44 +0200 Subject: [PATCH 116/293] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 94a30d4b..98bbfa3b 100644 --- a/README.md +++ b/README.md @@ -200,6 +200,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.6 - 3.7 - 3.8 +- 3.9 ### Backward compatibility From 39ca0fdafb0e7ba9a34491a48e0eddc549e87491 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 16 Nov 2020 18:06:55 +0200 Subject: [PATCH 117/293] use numpy 1.19.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b2efd1bd..d7c5527d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'", - "numpy==1.19.0; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'", "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'" From 7701ec78577301c235ad53ce613b4fa04a589963 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 16 Nov 2020 18:06:55 +0200 Subject: [PATCH 118/293] use numpy 1.19.3 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b2efd1bd..d7c5527d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'", - "numpy==1.19.0; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'", "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'" From a5fc2953c61ebfd6c4b0b025abbe3890edbc5a3f Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 17 Nov 2020 16:27:53 +0200 Subject: [PATCH 119/293] fix min supported numpy --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 528019cd..a4f9f729 100644 --- a/setup.py +++ b/setup.py @@ -17,15 +17,13 @@ def main(): CI_BUILD = os.environ.get("CI_BUILD", "False") is_CI_build = True if CI_BUILD == "1" else False cmake_source_dir = "opencv" - minimum_supported_numpy = "1.13.1" + minimum_supported_numpy = "1.13.3" build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" if sys.version_info[:2] >= (3, 6): minimum_supported_numpy = "1.13.3" - if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.19.0" if sys.version_info[:2] >= (3, 7): minimum_supported_numpy = "1.14.5" if sys.version_info[:2] >= (3, 8): @@ -33,6 +31,10 @@ def main(): if sys.version_info[:2] >= (3, 9): minimum_supported_numpy = "1.19.3" + # arm64 is a special case + if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": + minimum_supported_numpy = "1.19.3" + numpy_version = "numpy>=%s" % minimum_supported_numpy python_version = cmaker.CMaker.get_python_version() From 54294dda82192b40f85061e2f3c6733de17e62d0 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Tue, 17 Nov 2020 16:27:53 +0200 Subject: [PATCH 120/293] fix min supported numpy --- setup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4ad06197..7b106847 100644 --- a/setup.py +++ b/setup.py @@ -17,15 +17,13 @@ def main(): CI_BUILD = os.environ.get("CI_BUILD", "False") is_CI_build = True if CI_BUILD == "1" else False cmake_source_dir = "opencv" - minimum_supported_numpy = "1.13.1" + minimum_supported_numpy = "1.13.3" build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" if sys.version_info[:2] >= (3, 6): minimum_supported_numpy = "1.13.3" - if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.19.0" if sys.version_info[:2] >= (3, 7): minimum_supported_numpy = "1.14.5" if sys.version_info[:2] >= (3, 8): @@ -33,6 +31,10 @@ def main(): if sys.version_info[:2] >= (3, 9): minimum_supported_numpy = "1.19.3" + # arm64 is a special case + if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": + minimum_supported_numpy = "1.19.3" + numpy_version = "numpy>=%s" % minimum_supported_numpy python_version = cmaker.CMaker.get_python_version() From 1e85f5e48571923bb8dcd417294a16898ab96b39 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Nov 2020 14:02:25 +0200 Subject: [PATCH 121/293] update OpenCV licensing --- LICENSE-3RD-PARTY.txt | 242 +++++++++++++++++++++++++++++++++++------- README.md | 2 +- 2 files changed, 202 insertions(+), 42 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 60c34bc0..20f4fb37 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1,48 +1,208 @@ OpenCV library is redistributed within opencv-python package. This license applies to OpenCV binary in the directory cv2/. -By downloading, copying, installing or using the software you agree to this license. -If you do not agree to this license, do not download, install, -copy or use the software. - - License Agreement - For Open Source Computer Vision Library - (3-clause BSD License) - -Copyright (C) 2000-2020, Intel Corporation, all rights reserved. -Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. -Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. -Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. -Copyright (C) 2015-2016, Itseez Inc., all rights reserved. -Copyright (C) 2019-2020, Xperience AI, all rights reserved. -Third party copyrights are property of their respective owners. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the names of the copyright holders nor the names of the contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are disclaimed. -In no event shall copyright holders or contributors be liable for any direct, -indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused -and on any theory of liability, whether in contract, strict liability, -or tort (including negligence or otherwise) arising in any way out of -the use of this software, even if advised of the possibility of such damage. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. ------------------------------------------------------------------------------ libvpx is redistributed within all opencv-python Linux packages. diff --git a/README.md b/README.md index 98bbfa3b..6c6022ba 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ On slow systems such as Raspberry Pi the full build may take several hours. On a Opencv-python package (scripts in this repository) is available under MIT license. -OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE). +OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). From bb77a8a8f763a1ac7f12a7262397375e835a8ca5 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Nov 2020 14:03:46 +0200 Subject: [PATCH 122/293] OpenCV 3.4.12 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index e8d4259f..dc15187f 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit e8d4259f9ab787b512b9aa1203fc816fb9f19231 +Subproject commit dc15187f1b6784ef2ece30dae223570811eaddff diff --git a/opencv_contrib b/opencv_contrib index 3ce9ec6c..b8eca416 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 3ce9ec6c827b7b715ba9f7282f5670925c903b56 +Subproject commit b8eca4161439f361ae4d5a398aab1495136c704b From f33e65ddfc206d9169136b99d972f3014ee1afdc Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Nov 2020 14:05:37 +0200 Subject: [PATCH 123/293] OpenCV 4.5.0 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index c3bb57af..d5fd2f01 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit c3bb57afeaf030f10939204d48d7c2a3842f4293 +Subproject commit d5fd2f0155ffad366f9ac912dfd6d189a7a6a98e diff --git a/opencv_contrib b/opencv_contrib index 5fae4082..37315bab 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 5fae4082cc493efa5cb7a7486f9e009618a5198b +Subproject commit 37315babf9984a5b6aa981644a20dd8df1a5ff02 From 3137b3e570d2b78e16a2c2def094d125b16dadbd Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 28 Nov 2020 14:02:25 +0200 Subject: [PATCH 124/293] update OpenCV licensing --- LICENSE-3RD-PARTY.txt | 242 +++++++++++++++++++++++++++++++++++------- README.md | 2 +- 2 files changed, 202 insertions(+), 42 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 60c34bc0..20f4fb37 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1,48 +1,208 @@ OpenCV library is redistributed within opencv-python package. This license applies to OpenCV binary in the directory cv2/. -By downloading, copying, installing or using the software you agree to this license. -If you do not agree to this license, do not download, install, -copy or use the software. - - License Agreement - For Open Source Computer Vision Library - (3-clause BSD License) - -Copyright (C) 2000-2020, Intel Corporation, all rights reserved. -Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. -Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. -Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. -Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. -Copyright (C) 2015-2016, Itseez Inc., all rights reserved. -Copyright (C) 2019-2020, Xperience AI, all rights reserved. -Third party copyrights are property of their respective owners. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - * Neither the names of the copyright holders nor the names of the contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - -This software is provided by the copyright holders and contributors "as is" and -any express or implied warranties, including, but not limited to, the implied -warranties of merchantability and fitness for a particular purpose are disclaimed. -In no event shall copyright holders or contributors be liable for any direct, -indirect, incidental, special, exemplary, or consequential damages -(including, but not limited to, procurement of substitute goods or services; -loss of use, data, or profits; or business interruption) however caused -and on any theory of liability, whether in contract, strict liability, -or tort (including negligence or otherwise) arising in any way out of -the use of this software, even if advised of the possibility of such damage. + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. ------------------------------------------------------------------------------ libvpx is redistributed within all opencv-python Linux packages. diff --git a/README.md b/README.md index 98bbfa3b..6c6022ba 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ On slow systems such as Raspberry Pi the full build may take several hours. On a Opencv-python package (scripts in this repository) is available under MIT license. -OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE). +OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). From 9c8ebecac062befd1472fbc730296ac145e6c1fa Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Wed, 2 Dec 2020 17:11:52 +0200 Subject: [PATCH 125/293] check if there is enough time to build FFmpeg without cache --- .travis.yml | 107 +++++++---------------------------------------- README.md | 4 -- travis_config.sh | 1 + 3 files changed, 17 insertions(+), 95 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4c8227e..42623a59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -32,32 +32,6 @@ jobs: exclude: - language: ruby include: - - os: osx - env: - - MB_PYTHON_VERSION=3.8 - language: generic - osx_image: xcode9.4 - stage: s1 - workspaces: - create: - name: brew_cache - paths: - # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew/ - # used in OSX custom build script dealing with local bottle caching - - $HOME/local_bottle_metadata - #workspaces share within the same build, cache shares between builds - cache: - directories: - # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - - $HOME/.ccache - # https://stackoverflow.com/questions/39930171/cache-brew-builds-with-travis-ci - - $HOME/Library/Caches/Homebrew - - /usr/local/Homebrew/ - # used in OSX custom build script dealing with local bottle caching - - $HOME/local_bottle_metadata - # source distributions - os: linux stage: s1 @@ -111,8 +85,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.13.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -121,8 +94,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -131,8 +103,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.17.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -141,8 +112,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.19.3 - workspaces: - use: brew_cache + # headless builds for MacOS - os: osx @@ -153,8 +123,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.13.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -163,8 +132,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -173,8 +141,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.17.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -183,8 +150,7 @@ jobs: - ENABLE_CONTRIB=0 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.19.3 - workspaces: - use: brew_cache + # Contrib builds for MacOS - os: osx @@ -195,8 +161,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.13.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -205,8 +170,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.14.5 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -215,8 +179,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.17.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -225,8 +188,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=0 - TEST_DEPENDS=numpy==1.19.3 - workspaces: - use: brew_cache + # headless contrib builds for MacOS - os: osx @@ -237,8 +199,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.13.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -247,8 +208,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.14.5 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -257,8 +217,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.17.3 - workspaces: - use: brew_cache + - os: osx language: generic osx_image: xcode9.4 @@ -267,8 +226,7 @@ jobs: - ENABLE_CONTRIB=1 - ENABLE_HEADLESS=1 - TEST_DEPENDS=numpy==1.19.3 - workspaces: - use: brew_cache + # default builds for Linux - os: linux @@ -925,24 +883,6 @@ before_install: | echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - if [ -n "$IS_OSX" ]; then - export PATH="/usr/local/sbin:$PATH" - TAPS="$(brew --repository)/Library/Taps" - if [ -e "$TAPS/caskroom/homebrew-cask" -a -e "$TAPS/homebrew/homebrew-cask" ]; then - rm -rf "$TAPS/caskroom/homebrew-cask" - fi - find "$TAPS" -type d -name .git -exec \ - bash -xec ' - cd $(dirname '\''{}'\'') || echo "status: $?" - git clean -fxd || echo "status: $?" - sleep 1 || echo "status: $?" - git status || echo "status: $?"' \; || echo "status: $?" - brew_cache_cleanup - fi - echo "end" - # Not interested in travis internal scripts' output - fi - set +x install: | @@ -975,21 +915,6 @@ script: | trap ERR test "$rc" -eq 0 -before_cache: | - # Cleanup dirs to be cached - set -e; set -x - if [ -n "$IS_OSX" ]; then - - # When Taps is cached, this dir causes "Error: file exists" on `brew update` - if [ -e "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask" ]; then - rm -rf "$(brew --repository)/Library/Taps/homebrew/homebrew-cask/homebrew-cask" - fi - - brew_cache_cleanup - - fi - set +x; set +e - after_success: | # Upload wheels to pypi if tag is set diff --git a/README.md b/README.md index 6c6022ba..2352d2e8 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,6 @@ A: No, the packages are special wheel binary packages and they already contain s Since ``opencv-python`` version 4.3.0.\*, ``manylinux1`` wheels were replaced by ``manylinux2014`` wheels. If your pip is too old, it will try to use the new source distribution introduced in 4.3.0.38 to manually build OpenCV because it does not know how to install ``manylinux2014`` wheels. However, source build will also fail because of too old ``pip`` because it does not understand build dependencies in ``pyproject.toml``. To use the new ``manylinux2014`` pre-built wheels (or to build from source), your ``pip`` version must be >= 19.3. Please upgrade ``pip`` with ``pip install --upgrade pip``. -**Q: Pip install fails with ``Could not find a version that satisfies the requirement ...``?** - -A: Most likely the issue is related to too old pip and can be fixed by running ``pip install --upgrade pip``. Note that the wheel (especially manylinux) format does not currently support properly ARM architecture so there are no packages for ARM based platforms in PyPI. However, ``opencv-python`` packages for Raspberry Pi can be found from https://www.piwheels.org/. - **Q: Import fails on Windows: ``ImportError: DLL load failed: The specified module could not be found.``?** A: If the import fails on Windows, make sure you have [Visual C++ redistributable 2015](https://www.microsoft.com/en-us/download/details.aspx?id=48145) installed. If you are using older Windows version than Windows 10 and latest system updates are not installed, [Universal C Runtime](https://support.microsoft.com/en-us/help/2999226/update-for-universal-c-runtime-in-windows) might be also required. diff --git a/travis_config.sh b/travis_config.sh index 910e365f..063baf8a 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -111,6 +111,7 @@ function pre_build { brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } else brew unlink python@2 + generate_ffmpeg_formula brew install ffmpeg_opencv fi From b023344cf6c64fe50d840c2c9b36cb1608e073ac Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Wed, 2 Dec 2020 17:17:09 +0200 Subject: [PATCH 126/293] fix syntax --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 42623a59..531c2627 100644 --- a/.travis.yml +++ b/.travis.yml @@ -883,6 +883,10 @@ before_install: | echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x install: | From e83bc139980262fcb09158a88597a66324ee447a Mon Sep 17 00:00:00 2001 From: Thomas Nyberg Date: Fri, 11 Dec 2020 11:11:24 +0100 Subject: [PATCH 127/293] Add docs for debug build --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 6c6022ba..bc97db72 100644 --- a/README.md +++ b/README.md @@ -140,6 +140,24 @@ If some dependency is not enabled in the pre-built wheels, you can also run the - Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build - Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability +#### Manual debug builds + +In order to build `opencv-python` in an unoptimized debug build, you need to side-step the normal process a bit. + +1. Install the packages `scikit-build` and `numpy` via pip. +2. Run the command `python setup.py bdist_wheel --build-type=Debug`. +3. Install the generated wheel file in the `dist/` folder with `pip install dist/wheelname.whl`. + +If you would like the build produce all compiler commands, then the following combination of flags and environment variables has been tested to work on Linux: +``` +export CMAKE_ARGS='-DCMAKE_VERBOSE_MAKEFILE=ON' +export VERBOSE=1 + +python3 setup.py bdist_wheel --build-type=Debug +``` + +See this issue for more discussion: https://github.com/skvark/opencv-python/issues/424 + #### Source distributions Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources. If you need a OpenCV version which is not available in PyPI as a source distribution, please follow the manual build guidance above instead of this one. From 7d1e48ca7bcf651c7ddc13d30a452e14d06db0dc Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 28 Dec 2020 19:56:24 +0200 Subject: [PATCH 128/293] arm64 azure cli does not work --- .travis.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 531c2627..3c2efde8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -971,18 +971,20 @@ after_success: | # Save to Azure storage always - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - else - brew install azure-cli - fi + if [[ $TRAVIS_CPU_ARCH != "arm64" ]]; then + if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + else + brew install azure-cli + fi - az storage container create -n ${TRAVIS_COMMIT} --public-access blob + az storage container create -n ${TRAVIS_COMMIT} --public-access blob - if [[ $SDIST == 1 ]]; then - az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz - else - az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl + if [[ $SDIST == 1 ]]; then + az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz + else + az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl + fi fi set +x From fed2178dfc28dfb034e8111579293affb77b2cf1 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 28 Dec 2020 20:02:34 +0200 Subject: [PATCH 129/293] fix paths --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 7b106847..a4f9f729 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_ffmpeg\d{3,4}%s\.dll" % ("_64" if x64 else "")] + [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if x64 else "")] if os.name == "nt" else [] ) @@ -106,7 +106,7 @@ def main(): % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/OpenCV") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" ], } From 5f56caf2c33cca711ae5c361b78a684990f85aac Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 28 Dec 2020 20:05:41 +0200 Subject: [PATCH 130/293] OpenCV 4.5.1 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index d5fd2f01..1363496c 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit d5fd2f0155ffad366f9ac912dfd6d189a7a6a98e +Subproject commit 1363496c1106606684d40447f5d1149b2c66a9f8 diff --git a/opencv_contrib b/opencv_contrib index 37315bab..b91a781c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 37315babf9984a5b6aa981644a20dd8df1a5ff02 +Subproject commit b91a781cbc1285d441aa682926d93d8c23678b0b From fd4e6040af94d9db3da25874132ca092b4c9e3a1 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Mon, 28 Dec 2020 20:40:12 +0200 Subject: [PATCH 131/293] disable Qt on macOS for now due to multiple issues --- cv2/__init__.py | 4 +--- setup.py | 2 +- travis_config.sh | 16 ++++++++-------- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/cv2/__init__.py b/cv2/__init__.py index d665b75c..0c080d52 100644 --- a/cv2/__init__.py +++ b/cv2/__init__.py @@ -19,9 +19,7 @@ pass # the Qt plugin is included currently only in the pre-built wheels -if ( - sys.platform == "darwin" or sys.platform.startswith("linux") -) and ci_and_not_headless: +if sys.platform.startswith("linux") and ci_and_not_headless: os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join( os.path.dirname(os.path.abspath(__file__)), "qt", "plugins" ) diff --git a/setup.py b/setup.py index a4f9f729..67f22c60 100644 --- a/setup.py +++ b/setup.py @@ -172,7 +172,7 @@ def main(): if ( not build_headless and "bdist_wheel" in sys.argv - and (sys.platform == "darwin" or sys.platform.startswith("linux")) + and sys.platform.startswith("linux") ): cmake_args.append("-DWITH_QT=5") subprocess.check_call("patch -p1 < patches/patchQtPlugins", shell=True) diff --git a/travis_config.sh b/travis_config.sh index 063baf8a..9ba0bb11 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -115,15 +115,15 @@ function pre_build { brew install ffmpeg_opencv fi - echo 'Installing qt5' + # echo 'Installing qt5' - if [ -n "$CACHE_STAGE" ]; then - echo "Qt5 has bottle, no caching needed" - else - brew switch qt 5.13.2 - brew pin qt - export PATH="/usr/local/opt/qt/bin:$PATH" - fi + # if [ -n "$CACHE_STAGE" ]; then + # echo "Qt5 has bottle, no caching needed" + # else + # brew switch qt 5.13.2 + # brew pin qt + # export PATH="/usr/local/opt/qt/bin:$PATH" + # fi if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0 From 89ca6a4ac9079c72d4d86d1c0f3141eeb0ca1bd6 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Fri, 30 Apr 2021 20:16:59 +0300 Subject: [PATCH 132/293] Add GitHub actions setup for CI instead of Travis & Appveyour (where possible) (#470) * Add initial config for github actions * Allow actions for all branches and PRs to master by default * Fix typo * Do not set docker image info for multibuild, as we do it in github actions * Do not run github action in docker as multiduild will do it for us * Remove error steps - somehow I've missed them when cleaned for the build * Merge all build logic into one step as somehow build wheel is not known when sourced and used in different steps * Debug: try to change directory to get inside the repo sources * Adjust env variables to enable build * Specify docker image to use in github builds * Enable back all python versions in build matrix * Remove numpy as build dependency as prebuilt docker should handle it for us * Make linux build matrix wider - enable contrib, headless/gui, source/binary distribution * Fix return code setting for skipped tests in case of sdist * Build source distribution with only one version of python - as we do not care abnout python version when doing the source distribution * Try to fix config * Try to fix config * Enable OSX builds * Quickfix to enable OSX build * Temporary disable linux and all pythons execpt one to reduce the build matrix size * Disable cache stage that was implemented for travis * Do not unlink python2 for github osx builds * Fix ffmpeg bottle build command * Disable travis cache stage * Changed build_wheels to Windows platform * Try new pipeline * Try windows with a new configuration * Try bash on Windows * Added ubuntu and macos into pipeline * Fix if condition for windows * Turned on all python versions, uploading artifacts * Fixed Windows and created Release job * Add missed source distribution build * Move x86 python builds to github actions. Travis does only aarch64 now * Split linux and OSX builds to exclude x86 OSX builds from build matrix * Reduce architectures to x64 for both OSX and Ubuntu as x86 is supported for windows only * Add PyPI secrets usage * Publish packages built in PRs to testPyPI * Push to test PyPI on each package build. Remove unneded build on push to master * Apply review comments * Combine all release steps into one job Co-authored-by: Andrey Senyaev Co-authored-by: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> --- .github/workflows/build_wheels.yml | 279 +++++++++++++ .travis.yml | 609 +---------------------------- opencv | 2 +- travis_config.sh | 29 +- travis_osx_brew_cache.sh | 95 ++--- 5 files changed, 359 insertions(+), 655 deletions(-) create mode 100644 .github/workflows/build_wheels.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml new file mode 100644 index 00000000..cbed8b6c --- /dev/null +++ b/.github/workflows/build_wheels.yml @@ -0,0 +1,279 @@ +name: Build PYPI wheels for opencv-python + +on: + pull_request: + branches: + - master + release: + types: [published, edited] + + +jobs: + build-windows-x86_64: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: powershell + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup MSBuild.exe + uses: warrenbuckley/Setup-MSBuild@v1 + + - name: build script + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose + shell: cmd + + - name: before test + run: | + cd ${{ github.workspace }}/tests + &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") + if ($LastExitCode -ne 0) {throw $LastExitCode} + shell: powershell + + - name: run test + run: | + cd ${{ github.workspace }}/tests + python -m unittest test + shell: cmd + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + if: ${{ 'macos-latest' == matrix.os }} + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi + if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x + build_wheel $REPO_DIR $PLAT + install_run $PLAT + set +x + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + + build_sdist: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: [3.8] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [1] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + PLAT: x86_64 + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} + ENABLE_CONTRIB: ${{ matrix.with_contrib || 0}} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + # Build and package + set -x + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + set +x + # Install and run tests + set -x + echo "skipping tests because of sdist" + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: dist/opencv*.tar.gz + + release_opencv_python: + if: startsWith(github.ref, 'refs/tags/v') + needs: [build, build-windows-x86_64, build_sdist] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.travis.yml b/.travis.yml index 3c2efde8..6ba06d4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,6 @@ cache: # Add more cache stages (s2 etc) and corresponding OSX jobs like s1 # if brew builds start to take longer than one Travis time limit stages: - - s1 - final jobs: @@ -32,227 +31,7 @@ jobs: exclude: - language: ruby include: - # source distributions - - os: linux - stage: s1 - script: skip - env: - - SDIST=1 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - python: "3.8" - language: python - dist: xenial - - os: linux - stage: s1 - script: skip - env: - - SDIST=1 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - python: "3.8" - language: python - dist: xenial - - os: linux - stage: s1 - script: skip - env: - - SDIST=1 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - python: "3.8" - language: python - dist: xenial - - os: linux - stage: s1 - script: skip - env: - - SDIST=1 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - python: "3.8" - language: python - dist: xenial - - # default builds for MacOS - #further jobs in the list will use the same stage until the next assignment - - stage: final - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.13.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.14.5 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.17.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.3 - - - # headless builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.13.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.14.5 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.17.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.3 - - - # Contrib builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.13.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.14.5 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.17.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.3 - - - # headless contrib builds for MacOS - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.13.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.14.5 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.17.3 - - - os: osx - language: generic - osx_image: xcode9.4 - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.3 - - # default builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.13.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.13.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -268,30 +47,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.14.5 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.14.5 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -307,30 +62,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.17.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.17.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -346,30 +77,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -387,30 +94,6 @@ jobs: directories: $HOME/.ccache # headless builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.13.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.13.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -426,30 +109,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.14.5 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.14.5 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -465,30 +124,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.17.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.17.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -504,30 +139,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.3 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=i686 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.3 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -545,30 +156,6 @@ jobs: directories: $HOME/.ccache # contrib builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - TEST_DEPENDS=numpy==1.13.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.13.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -584,30 +171,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - TEST_DEPENDS=numpy==1.14.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.14.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -623,30 +186,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - TEST_DEPENDS=numpy==1.17.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.17.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -662,30 +201,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - TEST_DEPENDS=numpy==1.19.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.19.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -704,30 +219,6 @@ jobs: # headless contrib builds for Linux - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - TEST_DEPENDS=numpy==1.13.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.13.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -743,30 +234,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - TEST_DEPENDS=numpy==1.14.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.14.5 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -782,30 +249,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - TEST_DEPENDS=numpy==1.17.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.17.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -821,30 +264,6 @@ jobs: - USE_CCACHE=0 cache: directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - TEST_DEPENDS=numpy==1.19.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - cache: - directories: $HOME/.ccache - - os: linux - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=i686 - - TEST_DEPENDS=numpy==1.19.3 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - os: linux arch: arm64 language: generic @@ -969,23 +388,23 @@ after_success: | fi - # Save to Azure storage always + # # Save to Azure storage always - if [[ $TRAVIS_CPU_ARCH != "arm64" ]]; then - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - else - brew install azure-cli - fi + # if [[ $TRAVIS_CPU_ARCH != "arm64" ]]; then + # if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then + # curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash + # else + # brew install azure-cli + # fi - az storage container create -n ${TRAVIS_COMMIT} --public-access blob + # az storage container create -n ${TRAVIS_COMMIT} --public-access blob - if [[ $SDIST == 1 ]]; then - az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz - else - az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl - fi - fi + # if [[ $SDIST == 1 ]]; then + # az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz + # else + # az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl + # fi + # fi set +x diff --git a/opencv b/opencv index 1363496c..b19f8603 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 1363496c1106606684d40447f5d1149b2c66a9f8 +Subproject commit b19f8603843ac63274379c9e36331db6d4917001 diff --git a/travis_config.sh b/travis_config.sh index 9ba0bb11..aac66317 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -95,28 +95,31 @@ function pre_build { if [ -n "$IS_OSX" ]; then echo "Running for OSX" - local CACHE_STAGE; (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1 + local CACHE_STAGE;# (echo "$TRAVIS_BUILD_STAGE_NAME" | grep -qiF "final") || CACHE_STAGE=1 + CACHE_STAGE= export HOMEBREW_NO_AUTO_UPDATE=1 #after the cache stage, all bottles and Homebrew metadata should be already cached locally - if [ -n "$CACHE_STAGE" ]; then - brew update - generate_ffmpeg_formula - brew_add_local_bottles - fi + # if [ -n "$CACHE_STAGE" ]; then + # brew update + # generate_ffmpeg_formula + # brew_add_local_bottles + # fi echo 'Installing FFmpeg' - if [ -n "$CACHE_STAGE" ]; then - brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } - else - brew unlink python@2 + # if [ -n "$CACHE_STAGE" ]; then + # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } + # else + brew update generate_ffmpeg_formula - brew install ffmpeg_opencv - fi + brew_add_local_bottles + # brew unlink python@2 + brew install --build-bottle ffmpeg_opencv + # fi # echo 'Installing qt5' - + # if [ -n "$CACHE_STAGE" ]; then # echo "Qt5 has bottle, no caching needed" # else diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index e3a69cc3..401265f2 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -4,6 +4,9 @@ #Should be in Travis' cache BREW_LOCAL_BOTTLE_METADATA="$HOME/local_bottle_metadata" +#FIXME: temporary fix to enable the build, should be replaced with the proper path to the cache dir +mkdir -p $BREW_LOCAL_BOTTLE_METADATA + # Starting reference point for elapsed build time; seconds since the epoch. #TRAVIS_TIMER_START_TIME is set at the start of a log fold, in nanoseconds since the epoch BREW_TIME_START=$(($TRAVIS_TIMER_START_TIME/10**9)) @@ -48,33 +51,33 @@ function brew_add_local_bottles { # so that `brew` commands can find them. # If the package was updated, removes the corresponding files # and the bottle's entry in the formula, if any. - - # Bottle entry in formula: + + # Bottle entry in formula: # bottle do # <...> # sha256 "" => : # <...> - # end - + # end + echo "Cached bottles:" ls "$(brew --cache)/downloads" || true #may not exist initially since it's "$(brew --cache)" that is in Travis cache echo "Saved .json's and links:" ls "$BREW_LOCAL_BOTTLE_METADATA" - + for JSON in "$BREW_LOCAL_BOTTLE_METADATA"/*.json; do [ -e "$JSON" ] || break # OSX 10.11 bash has no nullglob local PACKAGE JSON_VERSION JSON_REBUILD OS_CODENAME BOTTLE_HASH - + _brew_parse_bottle_json "$JSON" PACKAGE JSON_VERSION JSON_REBUILD OS_CODENAME BOTTLE_HASH echo "Adding local bottle: $PACKAGE ${JSON_VERSION}_${JSON_REBUILD}" - + local FORMULA_VERSION FORMULA_REBUILD FORMULA_BOTTLE_HASH - + _brew_parse_package_info "$PACKAGE" "$OS_CODENAME" FORMULA_VERSION FORMULA_REBUILD FORMULA_BOTTLE_HASH local FORMULA_HAS_BOTTLE; [ -n "$FORMULA_BOTTLE_HASH" ] && FORMULA_HAS_BOTTLE=1 || true - + local BOTTLE_LINK BOTTLE=""; BOTTLE_LINK="${JSON}.bottle.lnk"; local BOTTLE_EXISTS= BOTTLE_MISMATCH= VERSION_MISMATCH= @@ -88,10 +91,10 @@ function brew_add_local_bottles { if [ -f "$BOTTLE_LINK" ]; then BOTTLE=$(cat "$BOTTLE_LINK"); BOTTLE=$(cd "$(dirname "$BOTTLE")"; pwd)/$(basename "$BOTTLE") - + if [ -e "$BOTTLE" ]; then BOTTLE_EXISTS=1; - + # The hash in `brew --cache $PACKAGE` entry is generated from download URL, # which itself is generated from base URL and version # (see Homebrew/Library/Homebrew/download_strategy.rb:cached_location). @@ -110,7 +113,7 @@ function brew_add_local_bottles { else echo "Link file is missing or of invalid type!" >&2 fi - + # Delete cached bottle and all metadata if invalid if [[ -z "$BOTTLE_EXISTS" || -n "$VERSION_MISMATCH" || -n "$BOTTLE_MISMATCH" ]]; then echo "Deleting the cached bottle and all metadata" @@ -133,11 +136,11 @@ function brew_add_local_bottles { git commit -m "Removed obsolete local bottle ${JSON_VERSION}_${JSON_REBUILD} :${OS_CODENAME}" "$FORMULA" ) fi - + if [ -n "$BOTTLE" -a -n "$BOTTLE_EXISTS" ]; then rm "$BOTTLE"; fi rm -f "$BOTTLE_LINK" rm "$JSON" - + #(Re)add metadata to the formula otherwise else if [ "$FORMULA_BOTTLE_HASH" == "$BOTTLE_HASH" ]; then @@ -156,7 +159,7 @@ function brew_cache_cleanup { #Lefovers from some failure probably rm -f "$BREW_LOCAL_BOTTLE_METADATA"/*.tar.gz - + #`brew cleanup` may delete locally-built bottles that weren't needed this time # so we're saving and restoring them local BOTTLE_LINK BOTTLE @@ -187,16 +190,16 @@ function brew_go_bootstrap_mode { local EXIT_CODE=${1:-1} echo "Going into cache bootstrap mode" - + BREW_BOOTSTRAP_MODE=1 - + #Can't just `exit` because that would terminate the build without saving the cache #Have to replace further actions with no-ops - + local MESSAGE=""; if [ "$EXIT_CODE" -ne 0 ]; then MESSAGE='Building dependencies took too long. Restart the build in Travis UI to continue from cache.'; fi - + eval ' function '"$cmd"' { return 0; } function repair_wheelhouse { return 0; } @@ -205,11 +208,11 @@ function brew_go_bootstrap_mode { echo \ ' echo -e "\n'"$MESSAGE"'\n"' fi)"\ - ' + ' # Travis runs user scripts via `eval` i.e. in the same shell process. # So have to unset errexit in order to get to cache save stage set +e; return '"$EXIT_CODE"' - }' + }' } @@ -228,15 +231,15 @@ function _brew_install_and_cache_within_time_limit { if grep -qxFf <(cat <<<"$_BREW_ALREADY_INSTALLED") <<<"$PACKAGE"; then MARKED_INSTALLED=1 fi - + if [ -n "$MARKED_INSTALLED" ] || (brew list --versions "$PACKAGE" >/dev/null && ! (brew outdated | grep -qxF "$PACKAGE")); then echo "Already installed and the latest version: $PACKAGE" if [ -z "$MARKED_INSTALLED" ]; then _brew_mark_installed "$PACKAGE"; fi return 0 fi - + local BUILD_FROM_SOURCE INCLUDE_BUILD KEG_ONLY - + _brew_is_bottle_available "$PACKAGE" KEG_ONLY || BUILD_FROM_SOURCE=1 [ -n "$BUILD_FROM_SOURCE" ] && INCLUDE_BUILD="--include-build" || true @@ -254,7 +257,7 @@ function _brew_install_and_cache_within_time_limit { _brew_install_and_cache "$PACKAGE" "$([[ -z "$BUILD_FROM_SOURCE" ]] && echo 1 || echo 0)" "$KEG_ONLY" || return 2 _brew_check_elapsed_build_time "$TIME_START" "$TIME_LIMIT" || return $? } - + function _brew_parse_bottle_json { # Parse JSON file resulting from `brew bottle --json` @@ -271,9 +274,9 @@ function _brew_parse_bottle_json { print tag_name print tag_dict["sha256"] ' "$JSON") - + unset JSON - + { local i v; for i in {1..5}; do read -r v eval "${1:?}=\"$v\"" @@ -284,7 +287,7 @@ function _brew_parse_bottle_json { function _brew_parse_package_info { # Get and parse `brew info --json` about a package # and save data into specified variables - + local PACKAGE OS_CODENAME PACKAGE="${1:?}"; shift OS_CODENAME="${1:?}"; shift @@ -300,9 +303,9 @@ function _brew_parse_package_info { print bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"] #prevent losing trailing blank line to command substitution ' \ "$PACKAGE" "$OS_CODENAME"); JSON_DATA="${JSON_DATA%\!\?}" #!? can't occur in a hash - + unset PACKAGE OS_CODENAME - + { local i v; for i in {1..3}; do read -r v eval "${1:?}=\"$v\"" @@ -346,13 +349,13 @@ function _brew_install_and_cache { # Install bottle or make and cache bottle. # assumes that deps were already installed # and not already the latest version - + local PACKAGE USE_BOTTLE KEG_ONLY PACKAGE="${1:?}" USE_BOTTLE="${2:?}" KEG_ONLY="${3:?}" local VERB - + if brew list --versions "$PACKAGE"; then # Install alongside the old version to avoid to have to update "runtime dependents" # https://discourse.brew.sh/t/can-i-install-a-new-version-without-having-to-upgrade-runtime-dependents/4443 @@ -363,7 +366,7 @@ function _brew_install_and_cache { else VERB=install fi - + if [[ "$USE_BOTTLE" -gt 0 ]]; then echo "Installing bottle for: $PACKAGE" brew $VERB "$PACKAGE" @@ -380,12 +383,12 @@ function _brew_install_and_cache { #proper procedure as per https://discourse.brew.sh/t/how-are-bottle-and-postinstall-related-is-it-safe-to-run-bottle-after-postinstall/3410/4 brew uninstall --ignore-dependencies "$PACKAGE" brew $VERB "$BOTTLE" - + local JSON; JSON=$(sed -E 's/bottle(.[[:digit:]]+)?\.tar\.gz$/bottle.json/' <<<"$BOTTLE") - + #`brew bottle --merge` doesn't return nonzero on nonexisting json file test -f "$JSON" -a -f "$BOTTLE" - + brew bottle --merge --write "$JSON" local CACHED_BOTTLE; CACHED_BOTTLE="$(brew --cache "$PACKAGE")" mv "$BOTTLE" "$CACHED_BOTTLE"; @@ -394,9 +397,9 @@ function _brew_install_and_cache { #Symlinks aren't cached by Travis. Will just save paths in files then. local BOTTLE_LINK; BOTTLE_LINK="${CACHED_JSON}.bottle.lnk" echo "$CACHED_BOTTLE" >"$BOTTLE_LINK" - + fi - + _brew_mark_installed "$PACKAGE" } @@ -411,11 +414,11 @@ function _brew_check_elapsed_build_time { local TIME_START TIME_LIMIT ELAPSED_TIME TIME_START="${1:?}" TIME_LIMIT="${2:?}" - + ELAPSED_TIME=$(($(date +%s) - $TIME_START)) echo "Elapsed time: "$(($ELAPSED_TIME/60))"m (${ELAPSED_TIME}s)" - - if [[ "$ELAPSED_TIME" -gt $TIME_LIMIT ]]; then + + if [[ "$ELAPSED_TIME" -gt $TIME_LIMIT ]]; then brew_go_bootstrap_mode return 1 fi @@ -426,19 +429,19 @@ function _brew_check_slow_building_ahead { #If the package's projected build completion is higher than hard limit, # skip it and arrange for further build to be skipped and return 1 - + local PACKAGE TIME_START TIME_HARD_LIMIT PACKAGE="${1:?}" TIME_START="${2:?}" TIME_HARD_LIMIT="${3:?}" - - local PROJECTED_BUILD_TIME + + local PROJECTED_BUILD_TIME PROJECTED_BUILD_TIME=$(echo "$BREW_SLOW_BUILIDING_PACKAGES" | awk '$1=="'"$PACKAGE"'"{print $2}') [ -z "$PROJECTED_BUILD_TIME" ] && return 0 || true - + local PROJECTED_BUILD_END_ELAPSED_TIME PROJECTED_BUILD_END_ELAPSED_TIME=$(( $(date +%s) - TIME_START + PROJECTED_BUILD_TIME * 60)) - + if [[ "$PROJECTED_BUILD_END_ELAPSED_TIME" -ge "$TIME_HARD_LIMIT" ]]; then echo -e "\nProjected build end elapsed time for $PACKAGE: $((PROJECTED_BUILD_END_ELAPSED_TIME/60))m ($PROJECTED_BUILD_END_ELAPSED_TIMEs)" brew_go_bootstrap_mode From 4262df8adb5074ee03309fd7541fb1b12b99da66 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Fri, 30 Apr 2021 20:49:24 +0300 Subject: [PATCH 133/293] Update opencv to 4.5.2 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index b19f8603..69357b1e 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b19f8603843ac63274379c9e36331db6d4917001 +Subproject commit 69357b1e88680658a07cffde7678a4d697469f03 diff --git a/opencv_contrib b/opencv_contrib index b91a781c..f5d7f671 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit b91a781cbc1285d441aa682926d93d8c23678b0b +Subproject commit f5d7f6712d4ff229ba4f45cf79dfd11c557d56fd From aa26990977aa021b7d9559666b5674b5ca76c2ec Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sat, 1 May 2021 23:40:51 +0300 Subject: [PATCH 134/293] make it possible to compile from sources against numpy on macOS aarch64 (#475) --- pyproject.toml | 1 + setup.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d7c5527d..07bcc4bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'", "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.20.1; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'aarch64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'", "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'" diff --git a/setup.py b/setup.py index 67f22c60..a3265206 100644 --- a/setup.py +++ b/setup.py @@ -31,10 +31,14 @@ def main(): if sys.version_info[:2] >= (3, 9): minimum_supported_numpy = "1.19.3" - # arm64 is a special case - if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": + # linux arm64 is a special case + if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": minimum_supported_numpy = "1.19.3" + # macos arm64 is a special case + if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": + minimum_supported_numpy = "1.20.1" + numpy_version = "numpy>=%s" % minimum_supported_numpy python_version = cmaker.CMaker.get_python_version() From 42baf3cc06df377c63393a0e204be2e18ec69cb2 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 6 May 2021 10:27:20 +0300 Subject: [PATCH 135/293] Documentation update after migration to OpenCV organization on Github. --- CONTRIBUTING.md | 7 +++++-- README.md | 28 ++++++++++++++++------------ 2 files changed, 21 insertions(+), 14 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6a843f0e..07ac1259 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,9 +6,12 @@ Thank you for considering contributing to opencv-python. If you've noticed a bug or have a question that doesn't belong on [Stack Overflow](http://stackoverflow.com/questions/tagged/opencv-python), -[search the issue tracker](https://github.com/skvark/opencv-python/issues?q=something) +[search the project issue tracker](https://github.com/opencv/opencv-python/issues?q=something) or +[search OpenCV issue tracker](https://github.com/opencv/opencv/issues?q=is%3Aissue+is%3Aopen+label%3A%22category%3A+python+bindings%22) to see if someone else in the community has already created a ticket. -If not, go ahead and [make one](https://github.com/skvark/opencv-python/issues/new)! +If not, go ahead and: +- [make new one for opencv-python](https://github.com/opencv/opencv-python/issues/new) if you cannot load package or some functionality is not available! +- [make new one for OpenCV](https://github.com/opencv/opencv-python/issues/new) if something went wrong with some function, class or method in code! ### 2. Fork & create a branch diff --git a/README.md b/README.md index 232aa318..9629aae0 100644 --- a/README.md +++ b/README.md @@ -2,9 +2,9 @@ ## OpenCV on Wheels -**Unofficial** pre-built CPU-only OpenCV packages for Python. +Pre-built CPU-only OpenCV packages for Python. -Check the manual build section if you wish to compile the bindings from source to enable additional modules such as CUDA. +Check the manual build section if you wish to compile the bindings from source to enable additional modules such as CUDA. ### Installation and Usage @@ -30,7 +30,7 @@ Check the manual build section if you wish to compile the bindings from source t ``import cv2`` - All packages contain haarcascade files. ``cv2.data.haarcascades`` can be used as a shortcut to the data folder. For example: + All packages contain Haar cascade files. ``cv2.data.haarcascades`` can be used as a shortcut to the data folder. For example: ``cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")`` @@ -57,7 +57,7 @@ Windows N and KN editions do not include Media Feature Pack which is required by If you have Windows Server 2012+, media DLLs are probably missing too; please install the Feature called "Media Foundation" in the Server Manager. Beware, some posts advise to install "Windows Server Essentials Media Pack", but this one requires the "Windows Server Essentials Experience" role, and this role will deeply affect your Windows Server configuration (by enforcing active directory integration etc.); so just installing the "Media Foundation" should be a safer choice. -If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/skvark/opencv-python/issues/36) for a manual fix. +If the above does not help, check if you are using Anaconda. Old Anaconda versions have a bug which causes the error, see [this issue](https://github.com/opencv/opencv-python/issues/36) for a manual fix. If you still encounter the error after you have checked all the previous solutions, download [Dependencies](https://github.com/lucasg/Dependencies) and open the ``cv2.pyd`` (located usually at ``C:\Users\username\AppData\Local\Programs\Python\PythonXX\Lib\site-packages\cv2``) file with it to debug missing DLL issues. @@ -65,6 +65,10 @@ If you still encounter the error after you have checked all the previous solutio A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages). +**Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpriter. What should I do?** + +A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check {OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the fficial OpenCV forum](https://forum.opencv.org/) before file new bugs. + **Q: Why the packages do not include non-free algorithms?** A: Non-free algorithms such as SURF are not included in these packages because they are patented / non-free and therefore cannot be distributed as built binaries. Note that SIFT is included in the builds due to patent expiration since OpenCV versions 4.3.0 and 3.4.10. See this issue for more info: https://github.com/skvark/opencv-python/issues/126 @@ -100,7 +104,7 @@ The build process for a single entry in the build matrices is as follows (see fo - tests are disabled, otherwise build time increases too much - there are 4 build matrix entries for each build combination: with and without contrib modules, with and without GUI (headless) - Linux builds run in manylinux Docker containers (CentOS 5) - - source distributions are separate entries in the build matrix + - source distributions are separate entries in the build matrix 4. Rearrange OpenCV's build result, add our custom files and generate wheel @@ -117,7 +121,7 @@ The build can be customized with environment variables. In addition to any varia - ``CI_BUILD``. Set to ``1`` to emulate the CI environment build behaviour. Used only in CI builds to force certain build flags on in ``setup.py``. Do not use this unless you know what you are doing. - ``ENABLE_CONTRIB`` and ``ENABLE_HEADLESS``. Set to ``1`` to build the contrib and/or headless version - ``ENABLE_JAVA``, Set to ``1`` to enable the Java client build. This is disabled by default. -- ``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build. +- ``CMAKE_ARGS``. Additional arguments for OpenCV's CMake invocation. You can use this to make a custom build. See the next section for more info about manual builds outside the CI environment. @@ -125,7 +129,7 @@ See the next section for more info about manual builds outside the CI environmen If some dependency is not enabled in the pre-built wheels, you can also run the build locally to create a custom wheel. -1. Clone this repository: `git clone --recursive https://github.com/skvark/opencv-python.git` +1. Clone this repository: `git clone --recursive https://github.com/opencv/opencv-python.git` 2. ``cd opencv-python`` - you can use `git` to checkout some other version of OpenCV in the `opencv` and `opencv_contrib` submodules if needed 3. Add custom Cmake flags if needed, for example: `export CMAKE_ARGS="-DSOME_FLAG=ON -DSOME_OTHER_FLAG=OFF"` (in Windows you need to set environment variables differently depending on Command Line or PowerShell) @@ -152,18 +156,18 @@ export VERBOSE=1 python3 setup.py bdist_wheel --build-type=Debug ``` -See this issue for more discussion: https://github.com/skvark/opencv-python/issues/424 +See this issue for more discussion: https://github.com/opencv/opencv-python/issues/424 #### Source distributions Since OpenCV version 4.3.0, also source distributions are provided in PyPI. This means that if your system is not compatible with any of the wheels in PyPI, ``pip`` will attempt to build OpenCV from sources. If you need a OpenCV version which is not available in PyPI as a source distribution, please follow the manual build guidance above instead of this one. -You can also force ``pip`` to build the wheels from the source distribution. Some examples: +You can also force ``pip`` to build the wheels from the source distribution. Some examples: - ``pip install --no-binary opencv-python opencv-python`` - ``pip install --no-binary :all: opencv-python`` -If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies. +If you need contrib modules or headless version, just change the package name (step 4 in the previous section is not needed). However, any additional CMake flags can be provided via environment variables as described in step 3 of the manual build section. If none are provided, OpenCV's CMake scripts will attempt to find and enable any suitable dependencies. Headless distributions have hard coded CMake flags which disable all possible GUI dependencies. On slow systems such as Raspberry Pi the full build may take several hours. On a 8-core Ryzen 7 3700X the build takes about 6 minutes. @@ -173,13 +177,13 @@ Opencv-python package (scripts in this repository) is available under MIT licens OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. -Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). +Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). Non-headless Linux and MacOS wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). -The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). +The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). ### Versioning From 88c1735deff42f2b2eacf66bf59aafc5c0f25763 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Thu, 6 May 2021 22:37:49 +0300 Subject: [PATCH 136/293] Fixed if condition for release job (#478) * Fixed if condition for release job * Added the test release job, changed if condition * Merged all upload steps into one for pre-release --- .github/workflows/build_wheels.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index cbed8b6c..67f7ad8d 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -244,8 +244,27 @@ jobs: name: wheels path: dist/opencv*.tar.gz + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build, build-windows-x86_64, build_sdist] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + release_opencv_python: - if: startsWith(github.ref, 'refs/tags/v') + if: github.event_name == 'release' && !github.event.release.prerelease needs: [build, build-windows-x86_64, build_sdist] runs-on: ubuntu-latest environment: opencv-python-release @@ -257,6 +276,7 @@ jobs: with: name: wheels path: wheelhouse/ + - name: Upload wheels for opencv_python run: | python -m pip install twine @@ -273,7 +293,6 @@ jobs: python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - name: Upload wheels for opencv_contrib_python_headless - run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* From c34cbfa3cb627ee40d83e719a539369645015356 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 11 May 2021 18:38:41 +0300 Subject: [PATCH 137/293] Added arm build --- .github/workflows/build_wheels.yml | 110 ++++++++++++++++++++++++++++- .gitmodules | 3 + opencv_extra | 1 + travis_config.sh | 15 ++-- 4 files changed, 123 insertions(+), 6 deletions(-) create mode 160000 opencv_extra diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 67f7ad8d..8d368f22 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -159,6 +159,7 @@ jobs: build_wheel $REPO_DIR $PLAT install_run $PLAT set +x + - name: saving artifacts uses: actions/upload-artifact@v2 with: @@ -238,15 +239,120 @@ jobs: # Install and run tests set -x echo "skipping tests because of sdist" + - name: saving artifacts uses: actions/upload-artifact@v2 with: name: wheels path: dist/opencv*.tar.gz + build_arm: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [jetson] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + USE_CCACHE: 0 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Environment variables + run: | + if [ "jetson" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + if [[ $SDIST == 0 ]]; then + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x + # Build and package + set -x + ls + if [[ $SDIST == 1 ]]; then + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + else + build_wheel $REPO_DIR $PLAT + fi + set +x + # Install and run tests + set -x + if [[ $SDIST == 1 ]]; then + echo "skipping tests because of sdist" + rc=0 + else + install_run $PLAT && rc=$? || rc=$? + fi + set +x + #otherwise, Travis logic terminates prematurely + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 + trap ERR + test "$rc" -eq 0 + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build-windows-x86_64, build_sdist, build_arm] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -265,7 +371,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build-windows-x86_64, build_sdist, build_arm] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.gitmodules b/.gitmodules index f2e0d283..655467e8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "multibuild"] path = multibuild url = https://github.com/matthew-brett/multibuild.git +[submodule "opencv_extra"] + path = opencv_extra + url = https://github.com/opencv/opencv_extra.git diff --git a/opencv_extra b/opencv_extra new file mode 160000 index 00000000..3b033d09 --- /dev/null +++ b/opencv_extra @@ -0,0 +1 @@ +Subproject commit 3b033d09cab1894d6452707df723789fe98c8663 diff --git a/travis_config.sh b/travis_config.sh index aac66317..b1a991a4 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -146,24 +146,31 @@ function run_tests { echo "Run tests..." echo $PWD + PYTHON=python$PYTHON_VERSION + if [ -n "$IS_OSX" ]; then echo "Running for OS X" - cd ../tests/ + cd ../opencv/ + export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata else echo "Running for linux" - cd /io/tests/ + + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 + fi + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata fi test_wheels } function test_wheels { - PYTHON=python$PYTHON_VERSION echo "Starting tests..." #Test package - $PYTHON -m unittest test + $PYTHON modules/python/test/test.py -v --repo . } export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' From 5d274516839ae170bd863773155ba154894e41fc Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 12 May 2021 09:58:59 +0300 Subject: [PATCH 138/293] Changed the label for a runner --- .github/workflows/build_wheels.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 8d368f22..e13e803e 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -255,7 +255,7 @@ jobs: strategy: fail-fast: false matrix: - os: [jetson] + os: [ARM64] python-version: [3.6, 3.7, 3.8, 3.9] platform: [x64] with_contrib: [0, 1] @@ -295,7 +295,7 @@ jobs: - name: Setup Environment variables run: | - if [ "jetson" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; From 6336ca866644dc5daf64831a4352c23479e1d248 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 18 May 2021 17:24:18 +0300 Subject: [PATCH 139/293] Split workflows according to platforms --- ...uild_wheels.yml => build_wheels_linux.yml} | 181 +----------------- .github/workflows/build_wheels_linux_arm.yml | 167 ++++++++++++++++ .github/workflows/build_wheels_macos.yml | 151 +++++++++++++++ .github/workflows/build_wheels_windows.yml | 132 +++++++++++++ 4 files changed, 454 insertions(+), 177 deletions(-) rename .github/workflows/{build_wheels.yml => build_wheels_linux.yml} (59%) create mode 100644 .github/workflows/build_wheels_linux_arm.yml create mode 100644 .github/workflows/build_wheels_macos.yml create mode 100644 .github/workflows/build_wheels_windows.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels_linux.yml similarity index 59% rename from .github/workflows/build_wheels.yml rename to .github/workflows/build_wheels_linux.yml index e13e803e..c371b774 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python +name: Build PYPI wheels for opencv-python on Linux x86_64 on: pull_request: @@ -9,75 +9,6 @@ on: jobs: - build-windows-x86_64: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: powershell - - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] - platform: [x86, x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - SDIST: ${{ matrix.build_sdist || 0}} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - - name: Update submodules - run: | - git submodule update --remote - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - - name: Setup MSBuild.exe - uses: warrenbuckley/Setup-MSBuild@v1 - - - name: build script - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose - shell: cmd - - - name: before test - run: | - cd ${{ github.workspace }}/tests - &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - shell: powershell - - - name: run test - run: | - cd ${{ github.workspace }}/tests - python -m unittest test - shell: cmd - - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - build: runs-on: ${{ matrix.os }} defaults: @@ -87,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] python-version: [3.6, 3.7, 3.8, 3.9] platform: [x64] with_contrib: [0, 1] @@ -246,113 +177,9 @@ jobs: name: wheels path: dist/opencv*.tar.gz - build_arm: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - - strategy: - fail-fast: false - matrix: - os: [ARM64] - python-version: [3.6, 3.7, 3.8, 3.9] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - BUILD_COMMIT: master - PROJECT_SPEC: opencv-python - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - MB_ML_VER: 2014 - NP_TEST_DEP: numpy - TRAVIS_BUILD_DIR: ${{ github.workspace }} - CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} - DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 - USE_CCACHE: 0 - UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - - steps: - - name: Cleanup - if: always() - uses: AutoModality/action-clean@v1 - - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - - name: Setup Environment variables - run: | - if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - - name: before install - run: | - set -e - if [[ $SDIST == 0 ]]; then - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - echo "end" - # Not interested in travis internal scripts' output - fi - set +x - # Build and package - set -x - ls - if [[ $SDIST == 1 ]]; then - python -m pip install --upgrade pip - python -m pip install scikit-build - python setup.py sdist - else - build_wheel $REPO_DIR $PLAT - fi - set +x - # Install and run tests - set -x - if [[ $SDIST == 1 ]]; then - echo "skipping tests because of sdist" - rc=0 - else - install_run $PLAT && rc=$? || rc=$? - fi - set +x - #otherwise, Travis logic terminates prematurely - #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 - trap ERR - test "$rc" -eq 0 - - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist, build_arm] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -371,7 +198,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist, build_arm] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml new file mode 100644 index 00000000..de444d90 --- /dev/null +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -0,0 +1,167 @@ +name: Build PYPI wheels for opencv-python on Linux ARM + +on: + pull_request: + branches: + - master + release: + types: [published, edited] + + +jobs: + build_arm: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ARM64] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + USE_CCACHE: 0 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Environment variables + run: | + if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + if [[ $SDIST == 0 ]]; then + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x + # Build and package + set -x + ls + if [[ $SDIST == 1 ]]; then + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + else + build_wheel $REPO_DIR $PLAT + fi + set +x + # Install and run tests + set -x + if [[ $SDIST == 1 ]]; then + echo "skipping tests because of sdist" + rc=0 + else + install_run $PLAT && rc=$? || rc=$? + fi + set +x + #otherwise, Travis logic terminates prematurely + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 + trap ERR + test "$rc" -eq 0 + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml new file mode 100644 index 00000000..d540f6c1 --- /dev/null +++ b/.github/workflows/build_wheels_macos.yml @@ -0,0 +1,151 @@ +name: Build PYPI wheels for opencv-python on Macos + +on: + pull_request: + branches: + - master + release: + types: [published, edited] + + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + if: ${{ 'macos-latest' == matrix.os }} + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi + if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x + build_wheel $REPO_DIR $PLAT + install_run $PLAT + set +x + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml new file mode 100644 index 00000000..76e6c35e --- /dev/null +++ b/.github/workflows/build_wheels_windows.yml @@ -0,0 +1,132 @@ +name: Build PYPI wheels for opencv-python on Windows + +on: + pull_request: + branches: + - master + release: + types: [published, edited] + + +jobs: + build-windows-x86_64: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: powershell + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup MSBuild.exe + uses: warrenbuckley/Setup-MSBuild@v1 + + - name: build script + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose + shell: cmd + + - name: before test + run: | + cd ${{ github.workspace }}/tests + &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") + if ($LastExitCode -ne 0) {throw $LastExitCode} + shell: powershell + + - name: run test + run: | + cd ${{ github.workspace }}/tests + python -m unittest test + shell: cmd + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* From 2bab1f58c70371b6f2e3108eebeb27311050aaea Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 27 May 2021 09:45:26 +0300 Subject: [PATCH 140/293] Split builds and tests for linux, update submodules only when a PR, turned off freetype because of issues, added get_build_info script --- .github/workflows/build_wheels_linux.yml | 42 ++++++++++++-------- .github/workflows/build_wheels_linux_arm.yml | 2 +- .github/workflows/build_wheels_macos.yml | 6 +-- .github/workflows/build_wheels_windows.yml | 12 +++--- setup.py | 1 + tests/get_build_info.py | 3 ++ travis_config.sh | 7 ++++ 7 files changed, 48 insertions(+), 25 deletions(-) create mode 100644 tests/get_build_info.py diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index c371b774..2b6f8efe 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -39,7 +39,7 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -47,19 +47,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 - name: Update submodules - run: | - git submodule update --remote - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - if: ${{ 'macos-latest' == matrix.os }} - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Setup Environment variables run: | @@ -71,7 +64,7 @@ jobs: echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - name: before install + - name: build run: | set -e # Check out and prepare the source @@ -88,6 +81,23 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT + + - name: install and test + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init --recursive + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x install_run $PLAT set +x @@ -129,9 +139,9 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} - ENABLE_CONTRIB: ${{ matrix.with_contrib || 0}} + ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} steps: - name: Checkout @@ -141,8 +151,8 @@ jobs: fetch-depth: 0 - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index de444d90..a680401a 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -41,7 +41,7 @@ jobs: DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 USE_CCACHE: 0 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index d540f6c1..bfce806f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -39,7 +39,7 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -51,8 +51,8 @@ jobs: fetch-depth: 0 - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 76e6c35e..03a341e4 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -27,9 +27,10 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata steps: - name: Checkout @@ -39,8 +40,8 @@ jobs: fetch-depth: 0 - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 @@ -64,12 +65,13 @@ jobs: cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} + python get_build_info.py shell: powershell - name: run test run: | - cd ${{ github.workspace }}/tests - python -m unittest test + cd ${{ github.workspace }}/opencv + python modules\python\test\test.py -v --repo . shell: cmd - name: saving artifacts diff --git a/setup.py b/setup.py index a3265206..a14825da 100644 --- a/setup.py +++ b/setup.py @@ -145,6 +145,7 @@ def main(): "-DINSTALL_CREATE_DISTRIB=ON", # See opencv/CMakeLists.txt for options and defaults "-DBUILD_opencv_apps=OFF", + "-DBUILD_opencv_freetype=OFF", "-DBUILD_SHARED_LIBS=OFF", "-DBUILD_TESTS=OFF", "-DBUILD_PERF_TESTS=OFF", diff --git a/tests/get_build_info.py b/tests/get_build_info.py new file mode 100644 index 00000000..4714f2f4 --- /dev/null +++ b/tests/get_build_info.py @@ -0,0 +1,3 @@ +import cv2 as cv + +print(cv.getBuildInformation()) diff --git a/travis_config.sh b/travis_config.sh index b1a991a4..a83fe141 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -150,6 +150,10 @@ function run_tests { if [ -n "$IS_OSX" ]; then echo "Running for OS X" + + cd ../tests + $PYTHON get_build_info.py + cd ../opencv/ export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata else @@ -158,6 +162,9 @@ function run_tests { if [ $PYTHON == "python3.6" ]; then $PYTHON -m pip install -U numpy==1.19.4 fi + cd /io/tests + $PYTHON get_build_info.py + cd /io/opencv export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata fi From 83deed818f0f83fd193eb1d5bace23fac0f1eba0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Jun 2021 13:20:20 +0300 Subject: [PATCH 141/293] Extracted build and install+test steps into two different scripts and fixed issues --- .github/workflows/build_wheels_linux.yml | 44 ++-------------- .github/workflows/build_wheels_linux_arm.yml | 53 +++----------------- .github/workflows/build_wheels_macos.yml | 5 +- .github/workflows/build_wheels_windows.yml | 3 +- scripts/build.sh | 17 +++++++ scripts/install.sh | 18 +++++++ 6 files changed, 52 insertions(+), 88 deletions(-) create mode 100755 scripts/build.sh create mode 100755 scripts/install.sh diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 2b6f8efe..c9307d74 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -33,7 +33,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy + NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} @@ -56,50 +56,17 @@ jobs: - name: Setup Environment variables run: | - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi - if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - name: build - run: | - set -e - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - set -x - build_wheel $REPO_DIR $PLAT + run: source scripts/build.sh - name: install and test - run: | - set -e - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init --recursive - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - set -x - install_run $PLAT - set +x + run: source scripts/install.sh - name: saving artifacts uses: actions/upload-artifact@v2 @@ -133,7 +100,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy + NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} @@ -147,7 +114,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 - name: Update submodules @@ -162,7 +129,6 @@ jobs: - name: Setup Environment variables run: | - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index a680401a..7ad52cda 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -34,7 +34,7 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 MB_ML_VER: 2014 - NP_TEST_DEP: numpy + NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} @@ -53,7 +53,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 - name: Setup Environment variables @@ -62,50 +62,11 @@ jobs: echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - name: before install - run: | - set -e - if [[ $SDIST == 0 ]]; then - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - echo "end" - # Not interested in travis internal scripts' output - fi - set +x - # Build and package - set -x - ls - if [[ $SDIST == 1 ]]; then - python -m pip install --upgrade pip - python -m pip install scikit-build - python setup.py sdist - else - build_wheel $REPO_DIR $PLAT - fi - set +x - # Install and run tests - set -x - if [[ $SDIST == 1 ]]; then - echo "skipping tests because of sdist" - rc=0 - else - install_run $PLAT && rc=$? || rc=$? - fi - set +x - #otherwise, Travis logic terminates prematurely - #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 - trap ERR - test "$rc" -eq 0 + - name: build + run: source scripts/build.sh + + - name: install and test + run: source scripts/install.sh - name: saving artifacts uses: actions/upload-artifact@v2 diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index bfce806f..c2dc073f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -33,7 +33,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy + NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} @@ -47,7 +47,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 - name: Update submodules @@ -88,6 +88,7 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT + git submodule update --init --recursive install_run $PLAT set +x diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 03a341e4..c8811083 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -36,7 +36,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 - name: Update submodules @@ -62,6 +62,7 @@ jobs: - name: before test run: | + git submodule update --init --recursive cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} diff --git a/scripts/build.sh b/scripts/build.sh new file mode 100755 index 00000000..f48ca066 --- /dev/null +++ b/scripts/build.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -e +# Check out and prepare the source +# Multibuild doesn't have releases, so --depth would break eventually (see +# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) +git submodule update --init multibuild +source multibuild/common_utils.sh +# https://github.com/matthew-brett/multibuild/issues/116 +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi +source multibuild/travis_steps.sh +# This sets -x +# source travis_multibuild_customize.sh +echo $ENABLE_CONTRIB > contrib.enabled +echo $ENABLE_HEADLESS > headless.enabled +set -x +build_wheel $REPO_DIR $PLAT diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 00000000..6e019d1c --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -e +# Check out and prepare the source +# Multibuild doesn't have releases, so --depth would break eventually (see +# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) +git submodule update --init --recursive +source multibuild/common_utils.sh +# https://github.com/matthew-brett/multibuild/issues/116 +if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi +source multibuild/travis_steps.sh +# This sets -x +# source travis_multibuild_customize.sh +echo $ENABLE_CONTRIB > contrib.enabled +echo $ENABLE_HEADLESS > headless.enabled +set -x +install_run $PLAT +set +x From 4fe9a58b2e7f317838c3a21cf1a1f065bdc72695 Mon Sep 17 00:00:00 2001 From: William Jackson Date: Wed, 9 Jun 2021 09:49:38 -0500 Subject: [PATCH 142/293] Include software distributions when uploading to PyPI --- .github/workflows/build_wheels_linux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index c9307d74..8ff86b1b 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -170,7 +170,7 @@ jobs: - name: Upload all wheels run: | python -m pip install twine - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-* release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease @@ -189,19 +189,19 @@ jobs: - name: Upload wheels for opencv_python run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* wheelhouse/opencv-python-[^h]* - name: Upload wheels for opencv_contrib_python run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* wheelhouse/opencv-contrib-python-[^h]* - name: Upload wheels for opencv_python_headless run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* wheelhouse/opencv-python-headless-* - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* wheelhouse/opencv-contrib-python-headless-* From 9136e869fae07f086aa1dfaa202051e26b3ef1a0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 30 Jun 2021 18:17:33 +0300 Subject: [PATCH 143/293] Added MacOS with M1 build --- .github/workflows/build_wheels_linux.yml | 4 + .github/workflows/build_wheels_linux_arm.yml | 4 + .github/workflows/build_wheels_macos.yml | 4 + .github/workflows/build_wheels_macos_m1.yml | 117 +++++++++++++++++++ .github/workflows/build_wheels_windows.yml | 3 + pyproject.toml | 10 +- setup.py | 4 +- 7 files changed, 139 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/build_wheels_macos_m1.yml diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index c9307d74..af8f1a06 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -4,6 +4,10 @@ on: pull_request: branches: - master + paths-ignore: + - '.github/workflows/build_wheels_linux_arm.yml' + - '.github/workflows/build_wheels_windows*' + - '.github/workflows/build_wheels_macos*' release: types: [published, edited] diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 7ad52cda..d71db231 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -4,6 +4,10 @@ on: pull_request: branches: - master + paths-ignore: + - '.github/workflows/build_wheels_linux.yml' + - '.github/workflows/build_wheels_windows*' + - '.github/workflows/build_wheels_macos*' release: types: [published, edited] diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index c2dc073f..5b2b8066 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -4,6 +4,10 @@ on: pull_request: branches: - master + paths-ignore: + - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_windows*' + - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml new file mode 100644 index 00000000..d3018497 --- /dev/null +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -0,0 +1,117 @@ +name: Build PYPI wheels for opencv-python on Macos M1 + +on: + pull_request: + branches: + - master + paths-ignore: + - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_windows*' + - '.github/workflows/build_wheels_macos.yml' + release: + types: [published, edited] + + +jobs: + build: + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macOS-M1] + python-version: [3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + SDIST: ${{ matrix.build_sdist || 0 }} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Update submodules + if: github.event_name == 'pull_request' + run: git submodule update --remote + + - name: build script + run: | + git submodule update --init multibuild + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + export MACOSX_DEPLOYMENT_TARGET=11.0 + arch -arm64 python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose + - name: before test + run: | + git submodule update --init --recursive + arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl + cd ${{ github.workspace }}/tests + arch -arm64 python${{ matrix.python-version }} get_build_info.py + - name: run test + run: | + cd ${{ github.workspace }}/opencv + arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index c8811083..554f684c 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - master + paths-ignore: + - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_macos*' release: types: [published, edited] diff --git a/pyproject.toml b/pyproject.toml index 07bcc4bb..5a2849f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [build-system] requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", - "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'", + "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", - "numpy==1.20.1; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'aarch64'", - "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'", - "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'", - "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'" + "numpy==1.21.0; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'", + "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ] diff --git a/setup.py b/setup.py index a14825da..612a080c 100644 --- a/setup.py +++ b/setup.py @@ -36,8 +36,8 @@ def main(): minimum_supported_numpy = "1.19.3" # macos arm64 is a special case - if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.20.1" + if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": + minimum_supported_numpy = "1.21.0" numpy_version = "numpy>=%s" % minimum_supported_numpy From 2ff0d0e3a4b2152214f4f1fd8d0ee0f40497e6c7 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 7 Jul 2021 15:12:11 +0300 Subject: [PATCH 144/293] Updated submodules to 4.5.3 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 69357b1e..ad6e8294 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 69357b1e88680658a07cffde7678a4d697469f03 +Subproject commit ad6e82942b37be8ee2c71c1d9bc7fe79cd16f7ab diff --git a/opencv_contrib b/opencv_contrib index f5d7f671..d5317d62 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f5d7f6712d4ff229ba4f45cf79dfd11c557d56fd +Subproject commit d5317d6297a8129b66dba1a1f7cc784e94639da9 diff --git a/opencv_extra b/opencv_extra index 3b033d09..d5c7212d 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 3b033d09cab1894d6452707df723789fe98c8663 +Subproject commit d5c7212d53f097c9fdf5e72c598ad051660599e8 From eb0efe2fa05e4ef1e596bad2509e870fc2c5377f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 16 Jul 2021 15:58:54 +0300 Subject: [PATCH 145/293] Readme update after migration to Github Actions for CI. --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 9629aae0..38789a8b 100644 --- a/README.md +++ b/README.md @@ -79,15 +79,16 @@ A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it mak ## Documentation for opencv-python -[![AppVeyor CI test status (Windows)](https://img.shields.io/appveyor/ci/skvark/opencv-python.svg?maxAge=3600&label=Windows)](https://ci.appveyor.com/project/skvark/opencv-python) -[![Travis CI test status (Linux and macOS)](https://img.shields.io/travis/com/skvark/opencv-python/master?label=Linux%20%26%20macOS)](https://travis-ci.com/github/skvark/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) +[![(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) The aim of this repository is to provide means to package each new [OpenCV release](https://github.com/opencv/opencv/releases) for the most used Python versions and platforms. ### CI build process The project is structured like a normal Python package with a standard ``setup.py`` file. -The build process for a single entry in the build matrices is as follows (see for example ``appveyor.yml`` file): +The build process for a single entry in the build matrices is as follows (see for example `.github/workflows/build_wheels_linux.yml` file): 0. In Linux and MacOS build: get OpenCV's optional C dependencies that we compile against @@ -181,7 +182,7 @@ Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/o All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). -Non-headless Linux and MacOS wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). +Non-headless Linux wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). From ecd163ddef981f28278e7a1cd4a9056da204dd19 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Fri, 17 Sep 2021 13:04:41 -0400 Subject: [PATCH 146/293] fix typo in Readme Fixes a typo in Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 38789a8b..bb43bb99 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ A: Make sure you have removed old manual installations of OpenCV Python bindings **Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpriter. What should I do?** -A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check {OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the fficial OpenCV forum](https://forum.opencv.org/) before file new bugs. +A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check {OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the official OpenCV forum](https://forum.opencv.org/) before file new bugs. **Q: Why the packages do not include non-free algorithms?** From 5fedf828ee2b985351747c8f6485475e033074b9 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Tue, 21 Sep 2021 12:19:00 +0300 Subject: [PATCH 147/293] Added the lapack installation --- travis_config.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/travis_config.sh b/travis_config.sh index a83fe141..7026a021 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -26,6 +26,13 @@ function bdist_wheel_cmd { if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } +if [ -n "$IS_OSX" ]; then + brew install lapack +else + yum install -y atlas-devel blas-devel lapack-devel + cp /usr/include/lapacke/lapacke*.h /usr/include/ +fi + if [ -n "$IS_OSX" ]; then echo " > OSX environment " export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" From 3c1ea4402db35fa51c6804db7424bd30d561a51c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 11:35:33 +0300 Subject: [PATCH 148/293] Changed blas to openblas and fixed flow to a proper installation --- scripts/build.sh | 1 + travis_config.sh | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/build.sh b/scripts/build.sh index f48ca066..aa9ff968 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,3 +15,4 @@ echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT +rm wheelhouse/numpy* diff --git a/travis_config.sh b/travis_config.sh index 7026a021..28fbb96f 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -26,13 +26,6 @@ function bdist_wheel_cmd { if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi } -if [ -n "$IS_OSX" ]; then - brew install lapack -else - yum install -y atlas-devel blas-devel lapack-devel - cp /usr/include/lapacke/lapacke*.h /usr/include/ -fi - if [ -n "$IS_OSX" ]; then echo " > OSX environment " export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" @@ -99,6 +92,14 @@ function pre_build { echo "Starting pre-build" set -e -o pipefail + if [ -n "$IS_OSX" ]; then + brew install lapack + else + yum install -y lapack-devel openblas-devel + cp /usr/include/lapacke/lapacke*.h /usr/include/ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h + fi + if [ -n "$IS_OSX" ]; then echo "Running for OSX" From 40e0e3b8c235386c003f8ea5d0a9d9ea968a06cd Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 13:51:43 +0300 Subject: [PATCH 149/293] Fixed aarch64 openblas installation --- travis_config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 28fbb96f..a387966c 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -95,7 +95,8 @@ function pre_build { if [ -n "$IS_OSX" ]; then brew install lapack else - yum install -y lapack-devel openblas-devel + # epel-release need for aarch64 to get openblas packages + yum install -y lapack-devel epel-release && yum install -y openblas-devel cp /usr/include/lapacke/lapacke*.h /usr/include/ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h fi From 1d6e03459e32a5effd27b7b86186b418f2bde437 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 1 Oct 2021 19:11:37 +0300 Subject: [PATCH 150/293] Fixed an issue when machine:X86 was defined on Windows x64 --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 612a080c..22b6561d 100644 --- a/setup.py +++ b/setup.py @@ -151,6 +151,12 @@ def main(): "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", ] + + ( + # If it is not defined 'linker flags: /machine:X86' on Windows x64 + ["-DCMAKE_GENERATOR_PLATFORM=x64"] + if x64 and sys.platform == "win32" + else [] + ) + ( ["-DOPENCV_EXTRA_MODULES_PATH=" + os.path.abspath("opencv_contrib/modules")] if build_contrib From 76a6fb2476b0f4610d6b8a827d3201cacab7daae Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 6 Oct 2021 19:52:12 +0300 Subject: [PATCH 151/293] Added fix for MacOS with M1 --- .github/workflows/build_wheels_macos_m1.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index d3018497..fb4b7d1b 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -49,17 +49,21 @@ jobs: echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled export MACOSX_DEPLOYMENT_TARGET=11.0 - arch -arm64 python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose + arch -arm64 -e SDIST=${{ matrix.build_sdist }} -e ENABLE_HEADLESS=${{ matrix.without_gui }} -e ENABLE_CONTRIB=${{ matrix.with_contrib }} python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose + delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* + - name: before test run: | git submodule update --init --recursive arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} get_build_info.py + - name: run test run: | cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + - name: saving artifacts uses: actions/upload-artifact@v2 with: From 3f010892e3c7b947c6afba6af3b05c2cfca3515b Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 6 Oct 2021 22:45:47 +0300 Subject: [PATCH 152/293] Removed env variables and defined CI_BUILD variable globally --- .github/workflows/build_wheels_macos_m1.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index fb4b7d1b..2c855874 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -27,6 +27,7 @@ jobs: build_sdist: [0] env: + CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -49,7 +50,7 @@ jobs: echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled export MACOSX_DEPLOYMENT_TARGET=11.0 - arch -arm64 -e SDIST=${{ matrix.build_sdist }} -e ENABLE_HEADLESS=${{ matrix.without_gui }} -e ENABLE_CONTRIB=${{ matrix.with_contrib }} python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose + arch -arm64 python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: before test From d82a270ecfda961d1a9a12e525aac773b4dda234 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Oct 2021 00:08:49 +0300 Subject: [PATCH 153/293] Updated Github Actions to python 3.10 and fixed following issues --- .github/workflows/build_wheels_linux.yml | 12 ++++---- .github/workflows/build_wheels_linux_arm.yml | 8 +++--- .github/workflows/build_wheels_macos.yml | 30 +++++++++++--------- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 10 +++---- docker/manylinux2014/Dockerfile_i686 | 10 +++---- docker/manylinux2014/Dockerfile_x86_64 | 10 +++---- multibuild | 2 +- pyproject.toml | 7 +++-- scripts/build.sh | 1 - setup.py | 8 ++++-- travis_config.sh | 5 +++- travis_multibuild_customize.sh | 2 +- 14 files changed, 58 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 526049ff..5c562d44 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -38,9 +38,10 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_3_10: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -63,8 +64,7 @@ jobs: if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: build run: source scripts/build.sh @@ -107,7 +107,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -135,8 +135,6 @@ jobs: run: | if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - name: before install run: | diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index d71db231..310b3ee5 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ARM64] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -39,9 +39,10 @@ jobs: PLAT: aarch64 MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_3_10: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 USE_CCACHE: 0 UNICODE_WIDTH: 32 @@ -63,8 +64,7 @@ jobs: - name: Setup Environment variables run: | if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: build run: source scripts/build.sh diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 5b2b8066..aca84ae6 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -22,12 +22,23 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest] - python-version: [3.6, 3.7, 3.8, 3.9] + os: [macos-10.15, macos-11] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] + exclude: + - os: macos-10.15 + python-version: '3.10' + - os: macos-11 + python-version: '3.6' + - os: macos-11 + python-version: '3.7' + - os: macos-11 + python-version: '3.8' + - os: macos-11 + python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true @@ -38,9 +49,11 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_3_10: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} + TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -58,22 +71,13 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - if: ${{ 'macos-latest' == matrix.os }} - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - name: Setup Environment variables run: | - if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: before install run: | diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2c855874..79164dcf 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [macOS-M1] - python-version: [3.7, 3.8, 3.9] + python-version: ['3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 554f684c..3eb13086 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index e8920770..c76ccec4 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -28,8 +28,8 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ - tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ + tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ + tar -xf ffmpeg-4.3.2.tar.bz2 && \ + cd ffmpeg-4.3.2 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index 39fc1560..6a60a073 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -30,8 +30,8 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ - tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ + tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -52,9 +52,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ + tar -xf ffmpeg-4.3.2.tar.bz2 && \ + cd ffmpeg-4.3.2 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 010120ca..49622378 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -28,8 +28,8 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.14.01/nasm-2.14.01.tar.bz2 && \ - tar -xf nasm-2.14.01.tar.bz2 && cd nasm-2.14.01 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ + tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 && \ - tar -xf ffmpeg-snapshot.tar.bz2 && \ - cd ffmpeg && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ + tar -xf ffmpeg-4.3.2.tar.bz2 && \ + cd ffmpeg-4.3.2 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/multibuild b/multibuild index 8882150d..b89bb903 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 8882150df6529658700b66bec124dfb77eefca26 +Subproject commit b89bb903e94308be79abefa4f436bf123ebb1313 diff --git a/pyproject.toml b/pyproject.toml index 5a2849f3..ec63b351 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,9 +2,10 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", - "numpy==1.21.0; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'", + "numpy==1.21.2; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.21.2; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'" + "numpy==1.21.2; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.21.2; python_version>='3.10' and platform_machine != 'aarch64' and platform_machine != 'arm64'" ] diff --git a/scripts/build.sh b/scripts/build.sh index aa9ff968..f48ca066 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -15,4 +15,3 @@ echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT -rm wheelhouse/numpy* diff --git a/setup.py b/setup.py index 22b6561d..f4e0a100 100644 --- a/setup.py +++ b/setup.py @@ -29,15 +29,17 @@ def main(): if sys.version_info[:2] >= (3, 8): minimum_supported_numpy = "1.17.3" if sys.version_info[:2] >= (3, 9): - minimum_supported_numpy = "1.19.3" + minimum_supported_numpy = "1.21.2" + if sys.version_info[:2] >= (3, 10): + minimum_supported_numpy = "1.21.2" # linux arm64 is a special case if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.19.3" + minimum_supported_numpy = "1.21.2" # macos arm64 is a special case if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": - minimum_supported_numpy = "1.21.0" + minimum_supported_numpy = "1.21.2" numpy_version = "numpy>=%s" % minimum_supported_numpy diff --git a/travis_config.sh b/travis_config.sh index a387966c..937e5a2d 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -20,7 +20,10 @@ function bdist_wheel_cmd { TOOLS_PATH=/opt/_internal/tools /opt/python/cp37-cp37m/bin/python -m venv $TOOLS_PATH source $TOOLS_PATH/bin/activate - python patch_auditwheel_whitelist.py + python$PYTHON_VERSION -m pip install auditwheel==3.2.0 + python$PYTHON_VERSION patch_auditwheel_whitelist.py + # to avoid issues with numpy wheels + rm /io/wheelhouse/numpy* deactivate fi if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi diff --git a/travis_multibuild_customize.sh b/travis_multibuild_customize.sh index 5a9451be..178fd6ec 100644 --- a/travis_multibuild_customize.sh +++ b/travis_multibuild_customize.sh @@ -3,4 +3,4 @@ export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' set -x REPO_DIR=$(dirname "${BASH_SOURCE[0]}") -DOCKER_IMAGE='quay.io/skvark/manylinux2014_$plat' +DOCKER_IMAGE='quay.io/asenyaev/manylinux2014_$plat' From 0114953aaeafb56ef3b9584555bb1119583468f0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Oct 2021 12:19:31 +0300 Subject: [PATCH 154/293] Fixed the version of numpy for linux aarch64 and python3.6 --- pyproject.toml | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ec63b351..7e887c41 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,8 +2,9 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.19.3; python_version=='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.2; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'", + "numpy==1.21.2; python_version>='3.7' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.21.2; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index f4e0a100..7c3f610c 100644 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ def main(): # linux arm64 is a special case if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.21.2" + minimum_supported_numpy = "1.19.3" # macos arm64 is a special case if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": From 9f43c0b2fd3c7ee745d11982ebabf65ad41f013a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Oct 2021 17:38:57 +0300 Subject: [PATCH 155/293] Changed the image for tests on linux arm --- .github/workflows/build_wheels_linux_arm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 310b3ee5..c2982e50 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -43,7 +43,7 @@ jobs: TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} - DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} From 4d0f6d2e17a8ded22cfe500be19617370f038a92 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sat, 9 Oct 2021 12:31:06 +0300 Subject: [PATCH 156/293] Fixed if condition for numpy test version on linux arm and renamed numpy variable --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 4 ++-- .github/workflows/build_wheels_macos.yml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5c562d44..7ff34a18 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -38,7 +38,7 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_3_10: numpy==1.21.2 + NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} @@ -64,7 +64,7 @@ jobs: if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: build run: source scripts/build.sh diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c2982e50..8108c85f 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -39,7 +39,7 @@ jobs: PLAT: aarch64 MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_3_10: numpy==1.21.2 + NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} @@ -64,7 +64,7 @@ jobs: - name: Setup Environment variables run: | if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + if [ "3.6" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; fi - name: build run: source scripts/build.sh diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index aca84ae6..d4f10be0 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -49,7 +49,7 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_3_10: numpy==1.21.2 + NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh @@ -77,7 +77,7 @@ jobs: if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_3_10)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: before install run: | From fdcbcb11ade547f1dde9116ddb5af925616be32c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sun, 10 Oct 2021 01:36:19 +0300 Subject: [PATCH 157/293] Added lowest numpy version support instead of latest --- .github/workflows/build_wheels_linux_arm.yml | 2 +- pyproject.toml | 9 ++++----- setup.py | 4 ++-- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 8108c85f..89142a57 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -64,7 +64,7 @@ jobs: - name: Setup Environment variables run: | if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - if [ "3.6" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; fi + if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: build run: source scripts/build.sh diff --git a/pyproject.toml b/pyproject.toml index 7e887c41..6aaab1d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,11 +2,10 @@ requires = [ "setuptools", "wheel", "scikit-build", "cmake", "pip", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.19.3; python_version=='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'", - "numpy==1.21.2; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'", - "numpy==1.21.2; python_version>='3.7' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10' and platform_machine != 'aarch64' and platform_machine != 'arm64'" + "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", + "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.21.2; python_version>='3.10'" ] diff --git a/setup.py b/setup.py index 7c3f610c..b5ba5bf0 100644 --- a/setup.py +++ b/setup.py @@ -29,7 +29,7 @@ def main(): if sys.version_info[:2] >= (3, 8): minimum_supported_numpy = "1.17.3" if sys.version_info[:2] >= (3, 9): - minimum_supported_numpy = "1.21.2" + minimum_supported_numpy = "1.19.3" if sys.version_info[:2] >= (3, 10): minimum_supported_numpy = "1.21.2" @@ -39,7 +39,7 @@ def main(): # macos arm64 is a special case if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": - minimum_supported_numpy = "1.21.2" + minimum_supported_numpy = "1.21.0" numpy_version = "numpy>=%s" % minimum_supported_numpy From 51226a7f2e32805f7728793b7ae2704d41b6ab9d Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Mon, 11 Oct 2021 07:36:20 +0200 Subject: [PATCH 158/293] Travis CI seems to be on vacation https://travis-ci.org/github/opencv --- .travis.yml | 410 ---------------------------------------------------- 1 file changed, 410 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 6ba06d4c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,410 +0,0 @@ -env: - global: - - "PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'" - # pip dependencies to _test_ your project - - TEST_DEPENDS="numpy==1.11.1" - # params to bdist_wheel. used to set osx build target. - - CONFIG_PATH="travis_config.sh" - - USE_CCACHE=1 - - UNICODE_WIDTH=32 - - SDIST=0 - -# Save some time, we and setup check them out on demand instead -# https://docs.travis-ci.com/user/customizing-the-build/#Git-Clone-Depth -git: - submodules: false - -# https://docs.travis-ci.com/user/caching -cache: - directories: - # `cache: ccache: true` has no effect if `language:` is not `c` or `cpp` - - $HOME/.ccache - -# Add more cache stages (s2 etc) and corresponding OSX jobs like s1 -# if brew builds start to take longer than one Travis time limit -stages: - - final - -jobs: - fast_finish: true - # Travis exclude is buggy, this seems to be the only way to disable default build - exclude: - - language: ruby - include: - # default builds for Linux - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - # headless builds for Linux - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=0 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - # contrib builds for Linux - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=0 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - - # headless contrib builds for Linux - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.6 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.7 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.8 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - - os: linux - arch: arm64 - language: generic - dist: xenial - services: docker - env: - - MB_PYTHON_VERSION=3.9 - - PLAT=aarch64 - - DOCKER_TEST_IMAGE=multibuild/xenial_arm64v8 - - ENABLE_CONTRIB=1 - - ENABLE_HEADLESS=1 - - TEST_DEPENDS=numpy==1.19.0 - - USE_CCACHE=0 - cache: - directories: $HOME/.ccache - -# The first line is printed in the folding header in Travis output -before_install: | - set -e - - if [[ $SDIST == 0 ]]; then - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init multibuild - - source multibuild/common_utils.sh - - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - - source multibuild/travis_steps.sh - # This sets -x - - source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - - echo "end" - # Not interested in travis internal scripts' output - fi - - set +x - -install: | - # Build and package - set -x - - if [[ $SDIST == 1 ]]; then - python -m pip install --upgrade pip - python -m pip install scikit-build - python setup.py sdist - else - build_wheel $REPO_DIR $PLAT - fi - - set +x - -script: | - # Install and run tests - set -x - if [[ $SDIST == 1 ]]; then - echo "skipping tests because of sdist" - else - install_run $PLAT && rc=$? || rc=$? - fi - - set +x - - #otherwise, Travis logic terminates prematurely - #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 - trap ERR - test "$rc" -eq 0 - -after_success: | - # Upload wheels to pypi if tag is set - - set -x - - if [ -n "$TRAVIS_TAG" ]; then - - if [[ $ENABLE_CONTRIB == 0 ]]; then - if [[ $ENABLE_HEADLESS == 0 ]]; then - echo "This is default build. Deployment will be done to to PyPI entry opencv-python." - else - echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-python-headless." - fi - else - if [[ $ENABLE_HEADLESS == 0 ]]; then - echo "This is contrib build. Deployment will be done to to PyPI entry opencv-contrib-python." - else - echo "This is headless contrib build. Deployment will be done to to PyPI entry opencv-contrib-python-headless." - fi - fi - - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - if [[ $SDIST == 1 ]]; then - pip install twine - twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* - else - pip install --user twine - pip install --user --upgrade six - twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* - fi - - fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then - # macpython 3.5 doesn't support recent TLS protocols which causes twine - # upload to fail, so we use the system Python to run twine - /usr/bin/python -m ensurepip --user - /usr/bin/python -m pip install --user -U pip - /usr/bin/python -m pip install --user -U -I twine - - if [[ $SDIST == 1 ]]; then - /usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/dist/opencv* - else - /usr/bin/python -m twine upload -u ${PYPI_USER} -p ${PASS} --skip-existing ${TRAVIS_BUILD_DIR}/wheelhouse/opencv* - fi - - fi - - fi - - # # Save to Azure storage always - - # if [[ $TRAVIS_CPU_ARCH != "arm64" ]]; then - # if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then - # curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash - # else - # brew install azure-cli - # fi - - # az storage container create -n ${TRAVIS_COMMIT} --public-access blob - - # if [[ $SDIST == 1 ]]; then - # az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/dist --pattern *.gz - # else - # az storage blob upload-batch -d ${TRAVIS_COMMIT} -s ${TRAVIS_BUILD_DIR}/wheelhouse --pattern opencv*.whl - # fi - # fi - - set +x - From 5c81cdaff33ac21022650cebf0b12bb974d555ca Mon Sep 17 00:00:00 2001 From: "Andrei V. Konstantinov" Date: Wed, 13 Oct 2021 16:45:45 +0300 Subject: [PATCH 159/293] Fix typo in Readme Fixes a typo in Readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bb43bb99..d2831332 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ If you still encounter the error after you have checked all the previous solutio A: Make sure you have removed old manual installations of OpenCV Python bindings (cv2.so or cv2.pyd in site-packages). -**Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpriter. What should I do?** +**Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpreter. What should I do?** A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check {OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the official OpenCV forum](https://forum.opencv.org/) before file new bugs. From 6a1f61b8d7e413059dbf0b9e897579c8305c327f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 15 Oct 2021 19:35:51 +0300 Subject: [PATCH 160/293] Updated submodules to the release 4.5.4, added python loader support, updated Qt patch --- cv2/__init__.py | 31 ------------------------------- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- patches/patchQtPlugins | 19 +++++++++++++------ scripts/__init__.py | 23 +++++++++++++++++++++++ setup.py | 42 ++++++++++++++++++++++++++++++++++++++---- 7 files changed, 77 insertions(+), 44 deletions(-) create mode 100644 scripts/__init__.py diff --git a/cv2/__init__.py b/cv2/__init__.py index 0c080d52..e69de29b 100644 --- a/cv2/__init__.py +++ b/cv2/__init__.py @@ -1,31 +0,0 @@ -import importlib -import os -import sys - -from .cv2 import * -from .data import * - -# wildcard import above does not import "private" variables like __version__ -# this makes them available -globals().update(importlib.import_module("cv2.cv2").__dict__) - -ci_and_not_headless = False - -try: - from .version import ci_build, headless - - ci_and_not_headless = ci_build and not headless -except: - pass - -# the Qt plugin is included currently only in the pre-built wheels -if sys.platform.startswith("linux") and ci_and_not_headless: - os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "qt", "plugins" - ) - -# Qt will throw warning on Linux if fonts are not found -if sys.platform.startswith("linux") and ci_and_not_headless: - os.environ["QT_QPA_FONTDIR"] = os.path.join( - os.path.dirname(os.path.abspath(__file__)), "qt", "fonts" - ) diff --git a/opencv b/opencv index ad6e8294..39c33341 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit ad6e82942b37be8ee2c71c1d9bc7fe79cd16f7ab +Subproject commit 39c3334147ec02761b117f180c9c4518be18d1fa diff --git a/opencv_contrib b/opencv_contrib index d5317d62..2bc3e1a1 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit d5317d6297a8129b66dba1a1f7cc784e94639da9 +Subproject commit 2bc3e1a169afd2675ef68221176f32cc0ea5427a diff --git a/opencv_extra b/opencv_extra index d5c7212d..822ee112 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit d5c7212d53f097c9fdf5e72c598ad051660599e8 +Subproject commit 822ee11240b969e98e20546663bc481a5e7089cc diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index 03560f17..a05a5f83 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -3,9 +3,8 @@ index 4c0b3880fc..dffa0a4caa 100644 --- a/opencv/CMakeLists.txt +++ b/opencv/CMakeLists.txt @@ -1187,6 +1187,13 @@ if(WITH_QT OR HAVE_QT) - if(HAVE_QT5) - status(" QT:" "YES (ver ${Qt5Core_VERSION_STRING})") - status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt5OpenGL_LIBRARIES} ${Qt5OpenGL_VERSION_STRING})" ELSE NO) + if(HAVE_QT) + status(" QT:" "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})") + if(APPLE) + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() @@ -13,6 +12,14 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY /opt/Qt5.15.0/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() - elseif(HAVE_QT) - status(" QT:" "YES (ver ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH} ${QT_EDITION})") - status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO) + if(HAVE_QT_OPENGL) + if(Qt${QT_VERSION_MAJOR}OpenGL_LIBRARIES) + status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${Qt${QT_VERSION_MAJOR}OpenGL_LIBRARIES} ${Qt${QT_VERSION_MAJOR}OpenGL_VERSION_STRING})" ELSE NO) + else() + status(" QT OpenGL support:" HAVE_QT_OPENGL THEN "YES (${QT_QTOPENGL_LIBRARY})" ELSE NO) + endif() + else() + status(" QT OpenGL support:" "NO") + endif() + else() + status(" QT:" "NO") diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 00000000..af17e205 --- /dev/null +++ b/scripts/__init__.py @@ -0,0 +1,23 @@ +from .cv2 import * +from .data import * + +ci_and_not_headless = False + +try: + from .version import ci_build, headless + + ci_and_not_headless = ci_build and not headless +except: + pass + +# the Qt plugin is included currently only in the pre-built wheels +if sys.platform.startswith("linux") and ci_and_not_headless: + os.environ["QT_QPA_PLATFORM_PLUGIN_PATH"] = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "qt", "plugins" + ) + +# Qt will throw warning on Linux if fonts are not found +if sys.platform.startswith("linux") and ci_and_not_headless: + os.environ["QT_QPA_FONTDIR"] = os.path.join( + os.path.dirname(os.path.abspath(__file__)), "qt", "fonts" + ) diff --git a/setup.py b/setup.py index b5ba5bf0..dd1659d5 100644 --- a/setup.py +++ b/setup.py @@ -108,12 +108,32 @@ def main(): # Naming conventions vary so widely between versions and OSes # had to give up on checking them. [ - "python/cv2[^/]*%(ext)s" - % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} + "python/cv2/python-%s.%s/cv2[^/]*%s" + % (sys.version_info[0], sys.version_info[1], re.escape(sysconfig.get_config_var("EXT_SUFFIX"))) + ] + + + [ + r"python/cv2/__init__.py" + ] + + + [ + r"python/cv2/.*config.*.py" ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" ], + "cv2.gapi": [ + "python/cv2" + r"/gapi/.*\.py" + ], + "cv2.mat_wrapper": [ + "python/cv2" + r"/mat_wrapper/.*\.py" + ], + "cv2.misc": [ + "python/cv2" + r"/misc/.*\.py" + ], + "cv2.utils": [ + "python/cv2" + r"/utils/.*\.py" + ], } # Files in sourcetree outside package dir that should be copied to package. @@ -137,8 +157,6 @@ def main(): "-DBUILD_opencv_python2=OFF", # Disable the Java build by default as it is not needed "-DBUILD_opencv_java=%s" % build_java, - # When off, adds __init__.py and a few more helper .py's. We use our own helper files with a different structure. - "-DOPENCV_SKIP_PYTHON_LOADER=ON", # Relative dir to install the built module to in the build tree. # The default is generated from sysconfig, we'd rather have a constant for simplicity "-DOPENCV_PYTHON3_INSTALL_PATH=python", @@ -358,6 +376,22 @@ def _classify_installed_files_override( print("Copying files from CMake output") + with open('%spython/cv2/__init__.py' + % cmake_install_dir, 'r') as opencv_init: + opencv_init_data = "" + for line in opencv_init: + opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")') + opencv_init_data = opencv_init_data + opencv_init_replacement + with open('%spython/cv2/__init__.py' + % cmake_install_dir, 'w') as opencv_python_init: + opencv_python_init.write(opencv_init_data) + + with open('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]), 'a') as opencv_init_config: + opencv_init_config.write(custom_init_data) + 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: From 545fe24728bfee7e0092d0e37dbdd0371bb1c2d8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 15 Oct 2021 20:39:09 +0300 Subject: [PATCH 161/293] Added comments for new changes --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index dd1659d5..7766f96d 100644 --- a/setup.py +++ b/setup.py @@ -376,6 +376,7 @@ def _classify_installed_files_override( print("Copying files from CMake output") + # need for the proper import of a package with open('%spython/cv2/__init__.py' % cmake_install_dir, 'r') as opencv_init: opencv_init_data = "" @@ -386,6 +387,7 @@ def _classify_installed_files_override( % cmake_install_dir, 'w') as opencv_python_init: opencv_python_init.write(opencv_init_data) + # add lines from the old __init__.py file to the config file with open('scripts/__init__.py', 'r') as custom_init: custom_init_data = custom_init.read() with open('%spython/cv2/config-%s.%s.py' From 7e67ab5f10ae534d3902ff6883c4b1c9a4fccc02 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Sat, 16 Oct 2021 08:09:03 +0200 Subject: [PATCH 162/293] "Programming Language :: Python :: 3.10", --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index b5ba5bf0..e4f2ee76 100644 --- a/setup.py +++ b/setup.py @@ -260,6 +260,7 @@ def main(): "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", From 851182fbb01f1655fe5ca4da9ca24b917765758a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 18 Oct 2021 17:38:58 +0300 Subject: [PATCH 163/293] Removed useless lines and added replacing lines into init file --- scripts/__init__.py | 5 +++-- setup.py | 13 +------------ 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/scripts/__init__.py b/scripts/__init__.py index af17e205..587a42bf 100644 --- a/scripts/__init__.py +++ b/scripts/__init__.py @@ -1,5 +1,6 @@ -from .cv2 import * -from .data import * +PYTHON_EXTENSIONS_PATHS = [ + LOADER_DIR +] + PYTHON_EXTENSIONS_PATHS ci_and_not_headless = False diff --git a/setup.py b/setup.py index 7766f96d..6db572e3 100644 --- a/setup.py +++ b/setup.py @@ -376,22 +376,11 @@ def _classify_installed_files_override( print("Copying files from CMake output") - # need for the proper import of a package - with open('%spython/cv2/__init__.py' - % cmake_install_dir, 'r') as opencv_init: - opencv_init_data = "" - for line in opencv_init: - opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")') - opencv_init_data = opencv_init_data + opencv_init_replacement - with open('%spython/cv2/__init__.py' - % cmake_install_dir, 'w') as opencv_python_init: - opencv_python_init.write(opencv_init_data) - # add lines from the old __init__.py file to the config file with open('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]), 'a') as opencv_init_config: + % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: opencv_init_config.write(custom_init_data) for package_name, relpaths_re in cls.package_paths_re.items(): From 810ca4ecd3e694ed5d5506daadaec3d49bf49d93 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 17:56:25 +0300 Subject: [PATCH 164/293] 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 1b1f59c7..cf95aca1 100644 --- a/setup.py +++ b/setup.py @@ -378,7 +378,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 28eb5bfd48c47f01d582d7a57382dc1095030046 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 18:06:10 +0300 Subject: [PATCH 165/293] Updated attached commit for opencv repository --- opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencv b/opencv index 39c33341..4223495e 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 39c3334147ec02761b117f180c9c4518be18d1fa +Subproject commit 4223495e6cd67011f86b8ecd9be1fa105018f3b1 From 012f556411f9d63df169966b8e37e1065f6d5bc9 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 18:07:48 +0300 Subject: [PATCH 166/293] 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 d2831332..bade5faf 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 a25a2a8e5847335f269949797cc9aa9fb68ad256 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 3 Nov 2021 17:24:14 +0300 Subject: [PATCH 167/293] Added lines for a proper work using pylint and an autocomplete in IDE --- setup.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup.py b/setup.py index 1b1f59c7..a53d9911 100644 --- a/setup.py +++ b/setup.py @@ -377,6 +377,22 @@ 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 = 'from .cv2 import *\nglobals().update(importlib.import_module("cv2.cv2").__dict__)' + free_line_after_imports = 6 + opencv_init_lines.insert(free_line_after_imports, extra_imports) + opencv_init_data = "" + for line in opencv_init_lines: + opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")') + opencv_init_data = opencv_init_data + opencv_init_replacement + + with open("%spython/cv2/__init__.py" + % cmake_install_dir, 'w') as opencv_final_init: + opencv_final_init.write(opencv_init_data) + # add lines from the old __init__.py file to the config file with open('scripts/__init__.py', 'r') as custom_init: custom_init_data = custom_init.read() From e7ce0519e3a2241719342bac65d9693e7b4c9e1d Mon Sep 17 00:00:00 2001 From: John Reese Date: Wed, 3 Nov 2021 14:47:59 -0700 Subject: [PATCH 168/293] Use PEP-508 compliant dependency specifiers This allows correctly resolving the numpy version requirement via PyPI metadata, using the same metadata regardless of what version of Python the package was built with or which wheel is uploaded to PyPI first. --- setup.py | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/setup.py b/setup.py index 1b1f59c7..347cb5ba 100644 --- a/setup.py +++ b/setup.py @@ -22,26 +22,15 @@ def main(): build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" - if sys.version_info[:2] >= (3, 6): - minimum_supported_numpy = "1.13.3" - if sys.version_info[:2] >= (3, 7): - minimum_supported_numpy = "1.14.5" - if sys.version_info[:2] >= (3, 8): - minimum_supported_numpy = "1.17.3" - if sys.version_info[:2] >= (3, 9): - minimum_supported_numpy = "1.19.3" - if sys.version_info[:2] >= (3, 10): - minimum_supported_numpy = "1.21.2" - - # linux arm64 is a special case - if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.19.3" - - # macos arm64 is a special case - if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": - minimum_supported_numpy = "1.21.0" - - numpy_version = "numpy>=%s" % minimum_supported_numpy + install_requires = [ + 'numpy>=1.13.3; python_version<"3.7"', + 'numpy>=1.14.5; python_version>="3.7"', + 'numpy>=1.17.3; python_version>="3.8"', + 'numpy>=1.19.3; python_version>="3.9"', + 'numpy>=1.21.2; python_version>="3.10"', + 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', + 'numpy>=1.21.2; python_version>="3.6" and platform_system=="Darwin" and platform_machine=="arm64"', + ] python_version = cmaker.CMaker.get_python_version() python_lib_path = cmaker.CMaker.get_python_library(python_version).replace( @@ -257,7 +246,7 @@ def main(): package_data=package_data, maintainer="Olli-Pekka Heinisuo", ext_modules=EmptyListWithLength(), - install_requires=numpy_version, + install_requires=install_requires, python_requires=">=3.6", classifiers=[ "Development Status :: 5 - Production/Stable", From f46eabba1258834cabe2df669fbc56e7ceaa16fd Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 02:36:06 +0300 Subject: [PATCH 169/293] 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 2188a44884bdc232bac9f87109158a0b94928389 Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Mon, 8 Nov 2021 09:57:24 +0800 Subject: [PATCH 170/293] 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 20f4fb37..caeffe51 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1000,7 +1000,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 @@ -1025,7 +1025,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: @@ -1043,7 +1043,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 d2831332..6844bd9f 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 937e5a2d..75a22d26 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 9a7af2aa4090d40a981cf91ef2b3c4c363e356de Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 15:38:20 +0300 Subject: [PATCH 171/293] 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 cf95aca1..87632fe9 100644 --- a/setup.py +++ b/setup.py @@ -378,8 +378,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 b6e1ec80d8a362ea967b52ad5d64b635f63b43cf Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 9 Nov 2021 18:17:51 +0300 Subject: [PATCH 172/293] Fixed imports for a proper package work --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index a53d9911..27e61933 100644 --- a/setup.py +++ b/setup.py @@ -381,7 +381,8 @@ def _classify_installed_files_override( with open("%spython/cv2/__init__.py" % cmake_install_dir, 'r') as opencv_init: opencv_init_lines = opencv_init.readlines() - extra_imports = 'from .cv2 import *\nglobals().update(importlib.import_module("cv2.cv2").__dict__)' + extra_imports = ('\nfrom .cv2 import *\nfrom .cv2 import _registerMatType\nfrom . import mat_wrapper\nfrom . import gapi' + '\nfrom . import misc\nfrom . import utils\nfrom . import data\n') free_line_after_imports = 6 opencv_init_lines.insert(free_line_after_imports, extra_imports) opencv_init_data = "" From 8cb031a47fe8a9a9072723140f0c3ab2858ac751 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 12 Nov 2021 17:37:03 +0300 Subject: [PATCH 173/293] 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 27e61933..2fe7fc21 100644 --- a/setup.py +++ b/setup.py @@ -378,8 +378,7 @@ 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 .cv2 import _registerMatType\nfrom . import mat_wrapper\nfrom . import gapi' '\nfrom . import misc\nfrom . import utils\nfrom . import data\n') @@ -390,8 +389,7 @@ def _classify_installed_files_override( opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")') opencv_init_data = opencv_init_data + opencv_init_replacement - 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.write(opencv_init_data) # add lines from the old __init__.py file to the config file From 8f763b1ebcfa3f6dc62e226c61a5b8be7f141ec0 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 26 Nov 2021 11:45:37 +0100 Subject: [PATCH 174/293] Delete appveyor.yml The last run was a year ago. https://ci.appveyor.com/project/skvark/opencv-python/history --- appveyor.yml | 201 --------------------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c79e7de4..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,201 +0,0 @@ -environment: - USER: - secure: fXgF9uyy6sT0JoVOR7BoqA== - - PASS: - secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= - - matrix: - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - -matrix: - fast_finish: true - -install: - - ps: | - if (-not (Test-Path $env:PYTHON)) { - curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/devel/install_python.ps1 - .\install_python.ps1 - } - - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - python --version - -build_script: -- cmd: | - "%PYTHON%\\python.exe" -m pip install --upgrade pip - "%PYTHON%\\python.exe" -m pip install --upgrade setuptools - set "CI_BUILD=1" && "%PYTHON%\\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose - -before_test: -- ps: | - - cd ${Env:APPVEYOR_BUILD_FOLDER}\tests - $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command" - &"${Env:PYTHON}\\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - -test_script: -- cmd: | - - cd %APPVEYOR_BUILD_FOLDER%\tests - "%PYTHON%\\python.exe" -m unittest test - -artifacts: -- path: dist\opencv*.whl - name: wheels - -deploy_script: -- ps: | - - if (${Env:APPVEYOR_REPO_TAG} -eq "true") { - cd ${Env:APPVEYOR_BUILD_FOLDER} - if (${Env:ENABLE_CONTRIB} -eq 0) { - if (${Env:ENABLE_HEADLESS} -eq 0) { - echo "This is a default build. Deployment will be done to PyPI entry opencv-python." - } - else { - echo "This is a headless build. Deployment will be done to PyPI entry opencv-python-headless." - } - } - else { - if (${Env:ENABLE_HEADLESS} -eq 0) { - echo "This is a contrib build. Deployment will be done to PyPI entry opencv-contrib-python." - } - else { - echo "This is a headless contrib build. Deployment will be done to PyPI entry opencv-contrib-python-headless." - } - } - - &"${Env:PYTHON}\\python.exe" -m pip install twine - &"${Env:PYTHON}\\python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* - } - else { - echo "Tag not set, deployment skipped." - } From 040dc8d80fb3dffddc9bf235f0610f998d470a97 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 15 Dec 2021 15:58:12 +0300 Subject: [PATCH 175/293] Added python limited API support --- .github/workflows/build_wheels_linux.yml | 123 ++++++++++--- .github/workflows/build_wheels_linux_arm.yml | 121 +++++++++++-- .github/workflows/build_wheels_macos.yml | 144 +++++++++++++-- .github/workflows/build_wheels_macos_m1.yml | 109 ++++++++++-- .github/workflows/build_wheels_windows.yml | 174 +++++++++++++++++-- setup.py | 7 +- travis_config.sh | 6 +- 7 files changed, 592 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 7ff34a18..338673dc 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -37,13 +37,12 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 + PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -59,25 +58,108 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Setup Environment variables - run: | - if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi - if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi - if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: build + - name: Build a package run: source scripts/build.sh - - name: install and test - run: source scripts/install.sh - - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.2 + CONFIG_PATH: travis_config.sh + PLAT: x86_64 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Setup Environment variables + run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation and run tests + run: source scripts/install.sh build_sdist: runs-on: ${{ matrix.os }} @@ -131,12 +213,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Setup Environment variables - run: | - if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi - if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi - - - name: before install + - name: Build a package run: | set -e # Build and package @@ -157,7 +234,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build_sdist] + needs: [build, build_sdist, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -176,7 +253,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build_sdist] + needs: [build, build_sdist, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 89142a57..08badc5b 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ARM64] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -38,12 +38,9 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} - DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -61,26 +58,118 @@ jobs: submodules: false fetch-depth: 0 - - name: Setup Environment variables - run: | - if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: build + - name: Build a package run: source scripts/build.sh - - name: install and test - run: source scripts/install.sh - - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build_arm] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ARM64] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.4 + CONFIG_PATH: travis_config.sh + DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 + UNICODE_WIDTH: 32 + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Environment variables + run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation and run tests + run: source scripts/install.sh + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build_arm] + needs: [build_arm, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -99,7 +188,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build_arm] + needs: [build_arm, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index d4f10be0..0ff69ede 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [macos-10.15, macos-11] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -48,14 +48,13 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 + PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -71,15 +70,7 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Setup Environment variables - run: | - if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi - if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi - if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi - if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: before install + - name: Build a package run: | set -e # Check out and prepare the source @@ -96,19 +87,136 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT - git submodule update --init --recursive - install_run $PLAT - set +x - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [macos-10.15, macos-11] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + exclude: + - os: macos-10.15 + python-version: '3.10' + - os: macos-11 + python-version: '3.6' + - os: macos-11 + python-version: '3.7' + - os: macos-11 + python-version: '3.8' + - os: macos-11 + python-version: '3.9' + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.4 + CONFIG_PATH: travis_config.sh + PLAT: x86_64 + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation + run: | + python -m pip install wheelhouse/opencv*.whl + cd ${{ github.workspace }}/tests + python get_build_info.py + + - name: Run tests + run: | + cd ${{ github.workspace }}/opencv + python modules/python/test/test.py -v --repo . + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -127,7 +235,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 79164dcf..cd183389 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [macOS-M1] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -31,7 +31,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata steps: - name: Checkout @@ -44,36 +43,116 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: build script + - name: Build a package run: | git submodule update --init multibuild echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled export MACOSX_DEPLOYMENT_TARGET=11.0 - arch -arm64 python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose + arch -arm64 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin + arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - - name: before test + - name: Saving all wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macOS-M1] + python-version: ['3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation run: | - git submodule update --init --recursive arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} get_build_info.py - - name: run test + - name: Run tests run: | cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -92,7 +171,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 3eb13086..ade90ead 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -55,38 +55,184 @@ jobs: - name: Setup MSBuild.exe uses: warrenbuckley/Setup-MSBuild@v1 - - name: build script + - name: Build a package run: | python --version python -m pip install --upgrade pip python -m pip install --upgrade setuptools - set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose + python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - - name: before test + - name: Saving all wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + - name: Saving opencv-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels-x86 + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels-x64 + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels-x86 + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels-x64 + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels-x86 + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels-x64 + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x86 + path: wheelhouse/opencv_contrib_python_headless-*.whl + + - name: Saving opencv-contrib-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x64 + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build-windows-x86_64] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: powershell + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Download opencv-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-contrib-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-contrib-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x64 + path: wheelhouse/ + + - name: Package installation run: | - git submodule update --init --recursive cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} python get_build_info.py shell: powershell - - name: run test + - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . shell: cmd - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build-windows-x86_64] + needs: [build-windows-x86_64, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -105,7 +251,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build-windows-x86_64] + needs: [build-windows-x86_64, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/setup.py b/setup.py index a49fcc37..331631ea 100644 --- a/setup.py +++ b/setup.py @@ -97,8 +97,8 @@ def main(): # Naming conventions vary so widely between versions and OSes # had to give up on checking them. [ - "python/cv2/python-%s.%s/cv2[^/]*%s" - % (sys.version_info[0], sys.version_info[1], re.escape(sysconfig.get_config_var("EXT_SUFFIX"))) + r"python/cv2/python-%s/cv2.*" + % (sys.version_info[0]) ] + [ @@ -159,6 +159,7 @@ def main(): "-DBUILD_TESTS=OFF", "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", + "-DPYTHON3_LIMITED_API=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 @@ -370,7 +371,7 @@ def _classify_installed_files_override( 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 .cv2 import _registerMatType\nfrom . import mat_wrapper\nfrom . import gapi' - '\nfrom . import misc\nfrom . import utils\nfrom . import data\n') + '\nfrom . import misc\nfrom . import utils\nfrom . import data\nfrom . import version\n') free_line_after_imports = 6 opencv_init_lines.insert(free_line_after_imports, extra_imports) opencv_init_data = "" diff --git a/travis_config.sh b/travis_config.sh index 6d6cc06b..7bbfec68 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -14,7 +14,9 @@ function bdist_wheel_cmd { # copied from multibuild's common_utils.sh # 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 + # install all required packages in pyproject.toml, because bdist_wheel does not do it + python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin + CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp36 -v cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then # this path can be changed in the latest manylinux image @@ -22,8 +24,6 @@ function bdist_wheel_cmd { /opt/python/cp39-cp39/bin/python -m venv $TOOLS_PATH source $TOOLS_PATH/bin/activate python patch_auditwheel_whitelist.py - # to avoid issues with numpy wheels - rm /io/wheelhouse/numpy* deactivate fi if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi From edd6b14d97c51f077f2fae37271db4f77841df2c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 15 Dec 2021 21:04:34 +0300 Subject: [PATCH 176/293] Changed a path to config-X.py file after python limited API support, optimized uploading and downloading artifacts --- .github/workflows/build_wheels_linux.yml | 54 +-------- .github/workflows/build_wheels_linux_arm.yml | 54 +-------- .github/workflows/build_wheels_macos.yml | 54 +-------- .github/workflows/build_wheels_macos_m1.yml | 54 +-------- .github/workflows/build_wheels_windows.yml | 110 +------------------ setup.py | 4 +- 6 files changed, 27 insertions(+), 303 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 338673dc..bd42944c 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -67,33 +67,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -130,32 +108,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 08badc5b..a97bbc29 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -67,33 +67,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build_arm] @@ -136,32 +114,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 0ff69ede..87fe6f99 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -94,33 +94,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -175,32 +153,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index cd183389..3711e1b3 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -59,33 +59,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -111,32 +89,10 @@ jobs: submodules: true fetch-depth: 0 - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ade90ead..0f697291 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -70,61 +70,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels-x86 - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-wheels-x64 - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels-x86 - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels-x64 - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels-x86 - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels-x64 - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x86 - path: wheelhouse/opencv_contrib_python_headless-*.whl - - - name: Saving opencv-contrib-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x64 - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + path: wheelhouse/opencv* test: needs: [build-windows-x86_64] @@ -160,60 +110,10 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Download opencv-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-contrib-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-contrib-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels-x64 + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - name: Package installation diff --git a/setup.py b/setup.py index 331631ea..cef4c93f 100644 --- a/setup.py +++ b/setup.py @@ -385,8 +385,8 @@ def _classify_installed_files_override( # 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.%s.py' - % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: + with open('%spython/cv2/config-%s.py' + % (cmake_install_dir, sys.version_info[0]), 'w') as opencv_init_config: opencv_init_config.write(custom_init_data) for package_name, relpaths_re in cls.package_paths_re.items(): From cc12af622b06c2900bc134cf4c3ff7b9a3ee84e1 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sat, 25 Dec 2021 15:42:39 +0300 Subject: [PATCH 177/293] Updated commits to 4.5.5 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 4223495e..dad26339 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 4223495e6cd67011f86b8ecd9be1fa105018f3b1 +Subproject commit dad26339a975b49cfb6c7dbe4bd5276c9dcb36e2 diff --git a/opencv_contrib b/opencv_contrib index 2bc3e1a1..49e8f123 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 2bc3e1a169afd2675ef68221176f32cc0ea5427a +Subproject commit 49e8f123ca08e76891856a1ecce491b62d08ba20 diff --git a/opencv_extra b/opencv_extra index 822ee112..37294e3c 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 822ee11240b969e98e20546663bc481a5e7089cc +Subproject commit 37294e3c876a72c992d4718b9bbfc8346b9e779a From ec7b7e48ba145484e10f71bad0a804093dacc973 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sun, 26 Dec 2021 22:02:16 +0300 Subject: [PATCH 178/293] Added openexr build flag --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index cef4c93f..63c66320 100644 --- a/setup.py +++ b/setup.py @@ -160,6 +160,7 @@ def main(): "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", + "-DBUILD_OPENEXR=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 0a17e6c91b36baf133fbf2546483805d806bd5f2 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 24 Jan 2022 23:18:32 +0300 Subject: [PATCH 179/293] Updated dependencies to the latest releases (openssl and ffmpeg) in a dockerfile, turned on building libpng --- docker/manylinux2014/Dockerfile_aarch64 | 12 ++++++------ docker/manylinux2014/Dockerfile_i686 | 12 ++++++------ docker/manylinux2014/Dockerfile_x86_64 | 12 ++++++------ setup.py | 1 + 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index c76ccec4..9a5b0a48 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index 6a60a073..b434f5c0 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ # in i686, ./config detects x64 in i686 container without linux32 # when run from "docker build" linux32 ./config --prefix="$HOME/ffmpeg_build" no-pinshared shared zlib && \ @@ -52,9 +52,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 49622378..f07baf74 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/setup.py b/setup.py index 63c66320..5b79e389 100644 --- a/setup.py +++ b/setup.py @@ -161,6 +161,7 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", + "-DBUILD_PNG=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 0066feb17909a5fa2295bb9c376054febc902340 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 25 Jan 2022 11:32:45 +0300 Subject: [PATCH 180/293] Added versions of dependecies as arguments in dockerfiles --- docker/manylinux2014/Dockerfile_aarch64 | 47 ++++++++++++--------- docker/manylinux2014/Dockerfile_i686 | 56 ++++++++++++++----------- docker/manylinux2014/Dockerfile_x86_64 | 40 ++++++++++-------- 3 files changed, 82 insertions(+), 61 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 9a5b0a48..b380d3ba 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,26 +1,33 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest +ARG CCACHE_VERSION=3.7.9 +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -28,16 +35,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +57,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ @@ -61,9 +68,9 @@ RUN cd ~/ffmpeg_sources && \ ldconfig && \ rm -rf ~/ffmpeg_sources -RUN curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.9/ccache-3.7.9.tar.gz && \ - tar -xf ccache-3.7.9.tar.gz && \ - cd ccache-3.7.9 && \ +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index b434f5c0..3b866874 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -1,26 +1,34 @@ FROM quay.io/pypa/manylinux2014_i686:latest +ARG CCACHE_VERSION=3.7.9 +ARG CMAKE_VERSION=3.17.0 +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ # in i686, ./config detects x64 in i686 container without linux32 # when run from "docker build" linux32 ./config --prefix="$HOME/ffmpeg_build" no-pinshared shared zlib && \ @@ -30,16 +38,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -52,9 +60,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ @@ -63,22 +71,22 @@ RUN cd ~/ffmpeg_sources && \ ldconfig && \ rm -rf ~/ffmpeg_sources -RUN curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.9/ccache-3.7.9.tar.gz && \ - tar -xf ccache-3.7.9.tar.gz && \ - cd ccache-3.7.9 && \ +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install -RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz && \ - tar -xf cmake-3.17.0.tar.gz && \ - cd cmake-3.17.0 && \ +RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz && \ + tar -xf cmake-${CMAKE_VERSION}.tar.gz && \ + cd cmake-${CMAKE_VERSION} && \ export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ ./configure --system-curl && \ make && \ make install && \ cd .. && \ - rm -rf cmake-3.17.0* + rm -rf cmake-${CMAKE_VERSION}* ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index f07baf74..fb367c0a 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,26 +1,32 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -28,16 +34,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +56,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ From 700cb0095233e104d6c9e96bb45d3d3312015cd1 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 11:12:51 +0300 Subject: [PATCH 181/293] Defined static version of windows server --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0f697291..cb2beb12 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] + os: [windows-2019] python-version: ['3.6'] platform: [x86, x64] with_contrib: [0, 1] @@ -86,7 +86,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] + os: [windows-2019] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x86, x64] with_contrib: [0, 1] From 141a763d0e2675476b92e4a15359b19684c68eb2 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 11:30:02 +0300 Subject: [PATCH 182/293] Updated MSBuild action --- .github/workflows/build_wheels_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cb2beb12..0262c7b8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -53,7 +53,7 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe - uses: warrenbuckley/Setup-MSBuild@v1 + uses: microsoft/setup-msbuild@v1.1 - name: Build a package run: | From 602a8be9e21df225a32827a621f15d7be0e5eebd Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 14:00:43 +0300 Subject: [PATCH 183/293] Defined ffmpeg version for macos (4.4.1) and fixed MacOS build --- .github/workflows/build_wheels_macos.yml | 1 + travis_config.sh | 37 ++++++------------------ 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 87fe6f99..c70f2b2d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -55,6 +55,7 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 + FFMPEG_FORMULA_VERSION: '@4' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/travis_config.sh b/travis_config.sh index 7bbfec68..dfb656e8 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -50,7 +50,7 @@ if [ -n "$IS_OSX" ]; then function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" - local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") + local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}${FFMPEG_FORMULA_VERSION}") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" local REGENERATE @@ -70,8 +70,9 @@ if [ -n "$IS_OSX" ]; then if [ -n "$REGENERATE" ]; then echo "Regenerating custom ffmpeg formula" # Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language + # FfmpegAT4 is a class in ffmpeg@4 formula perl -wpe 'BEGIN {our ($found_blank, $bottle_block);} - if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1.$2."Opencv".$3."\n"; next;} + if (/(^class )(FfmpegAT4)(\s.*)/) {$_=$1."FfmpegOpencv".$3."\n"; next;} if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;} if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; } if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; } @@ -111,34 +112,14 @@ function pre_build { CACHE_STAGE= export HOMEBREW_NO_AUTO_UPDATE=1 - #after the cache stage, all bottles and Homebrew metadata should be already cached locally - # if [ -n "$CACHE_STAGE" ]; then - # brew update - # generate_ffmpeg_formula - # brew_add_local_bottles - # fi - echo 'Installing FFmpeg' - # if [ -n "$CACHE_STAGE" ]; then - # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } - # else - brew update - generate_ffmpeg_formula - brew_add_local_bottles - # brew unlink python@2 - brew install --build-bottle ffmpeg_opencv - # fi - - # echo 'Installing qt5' - - # if [ -n "$CACHE_STAGE" ]; then - # echo "Qt5 has bottle, no caching needed" - # else - # brew switch qt 5.13.2 - # brew pin qt - # export PATH="/usr/local/opt/qt/bin:$PATH" - # fi + brew update + generate_ffmpeg_formula + brew_add_local_bottles + brew install --build-bottle ffmpeg_opencv + # It needs when we use not the latest ffmpeg formula + brew link ffmpeg_opencv if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0 From 9de011e3885dc2a7d4f39f4a5d289857395b3eb8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 22 Mar 2022 17:57:51 +0300 Subject: [PATCH 184/293] Added pylint test --- .github/workflows/build_wheels_macos.yml | 5 +++ .github/workflows/build_wheels_macos_m1.yml | 5 +++ .github/workflows/build_wheels_windows.yml | 6 ++++ tests/pylint.py | 3 ++ travis_config.sh | 37 ++++++++++----------- 5 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 tests/pylint.py diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index c70f2b2d..2e434a5f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -171,6 +171,11 @@ jobs: cd ${{ github.workspace }}/opencv python modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3711e1b3..46ecb631 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -106,6 +106,11 @@ jobs: cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + arch -arm64 python${{ matrix.python-version }} -m pip install pylint + arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0262c7b8..cee1d848 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -130,6 +130,12 @@ jobs: python modules\python\test\test.py -v --repo . shell: cmd + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + shell: cmd + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build-windows-x86_64, test] diff --git a/tests/pylint.py b/tests/pylint.py new file mode 100644 index 00000000..d10ad684 --- /dev/null +++ b/tests/pylint.py @@ -0,0 +1,3 @@ +from cv2 import getStructuringElement, MORPH_ELLIPSE + +a = getStructuringElement(MORPH_ELLIPSE, (3, 3)) diff --git a/travis_config.sh b/travis_config.sh index dfb656e8..751a1772 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -141,37 +141,36 @@ function run_tests { PYTHON=python$PYTHON_VERSION - if [ -n "$IS_OSX" ]; then - echo "Running for OS X" - - cd ../tests - $PYTHON get_build_info.py - - cd ../opencv/ - export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata - else - echo "Running for linux" - - if [ $PYTHON == "python3.6" ]; then - $PYTHON -m pip install -U numpy==1.19.4 - fi - cd /io/tests - $PYTHON get_build_info.py + echo "Running for linux" - cd /io/opencv - export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 fi + cd /io/tests + $PYTHON get_build_info.py + + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata test_wheels + pylint_test } function test_wheels { - echo "Starting tests..." + echo "Starting OpenCV tests..." #Test package $PYTHON modules/python/test/test.py -v --repo . } +function pylint_test { + + echo "Starting Pylint tests..." + + $PYTHON -m pip install pylint + $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring +} + export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' set -x From 1e26c5d08c182fdbb09d73bc97594bab793e79f6 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 23 Mar 2022 10:38:47 +0300 Subject: [PATCH 185/293] Pinned pylint version --- .github/workflows/build_wheels_macos.yml | 2 +- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- travis_config.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 2e434a5f..f22d56e1 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -173,7 +173,7 @@ jobs: - name: Pylint test run: | - python -m pip install pylint + python -m pip install pylint==2.12.2 python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring test_release_opencv_python: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 46ecb631..1f51a342 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -108,7 +108,7 @@ jobs: - name: Pylint test run: | - arch -arm64 python${{ matrix.python-version }} -m pip install pylint + arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring test_release_opencv_python: diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cee1d848..bf9f9906 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -132,7 +132,7 @@ jobs: - name: Pylint test run: | - python -m pip install pylint + python -m pip install pylint==2.12.2 python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring shell: cmd diff --git a/travis_config.sh b/travis_config.sh index 751a1772..db3bf773 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -168,7 +168,7 @@ function pylint_test { echo "Starting Pylint tests..." - $PYTHON -m pip install pylint + $PYTHON -m pip install pylint==2.12.2 $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring } From ed16e8ef97a35647aa129f167ade956e4630714f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 23 Mar 2022 16:20:07 +0300 Subject: [PATCH 186/293] Changed using custom test for pylint to opencv sample --- .github/workflows/build_wheels_linux.yml | 2 +- .github/workflows/build_wheels_macos.yml | 4 +++- .github/workflows/build_wheels_macos_m1.yml | 4 +++- .github/workflows/build_wheels_windows.yml | 4 +++- tests/pylint.py | 3 --- tests/pylintrc | 12 ++++++++++++ travis_config.sh | 3 ++- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 tests/pylint.py create mode 100644 tests/pylintrc diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index bd42944c..5ed44e21 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -102,7 +102,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: false + submodules: true fetch-depth: 0 - name: Setup Environment variables diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index f22d56e1..bccec01f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -137,6 +137,7 @@ jobs: CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Checkout @@ -174,7 +175,8 @@ jobs: - name: Pylint test run: | python -m pip install pylint==2.12.2 - python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}/tests + python -m pylint $PYLINT_TEST_FILE test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 1f51a342..9f7b0f37 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -81,6 +81,7 @@ jobs: env: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Checkout @@ -109,7 +110,8 @@ jobs: - name: Pylint test run: | arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 - arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}/tests + arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bf9f9906..337c77b2 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -96,6 +96,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata + PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py steps: - name: Checkout @@ -133,7 +134,8 @@ jobs: - name: Pylint test run: | python -m pip install pylint==2.12.2 - python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}\tests + python -m pylint $PYLINT_TEST_FILE shell: cmd test_release_opencv_python: diff --git a/tests/pylint.py b/tests/pylint.py deleted file mode 100644 index d10ad684..00000000 --- a/tests/pylint.py +++ /dev/null @@ -1,3 +0,0 @@ -from cv2 import getStructuringElement, MORPH_ELLIPSE - -a = getStructuringElement(MORPH_ELLIPSE, (3, 3)) diff --git a/tests/pylintrc b/tests/pylintrc new file mode 100644 index 00000000..a3892018 --- /dev/null +++ b/tests/pylintrc @@ -0,0 +1,12 @@ +# Source: opencv/platforms/scripts/pylintrc + +[MESSAGES CONTROL] + +# Disable all to choose the Tests one by one +disable=all + +# Tests +enable=bad-indentation, # Used when an unexpected number of indentation’s tabulations or spaces has been found. + mixed-indentation, # Used when there are some mixed tabs and spaces in a module. + unnecessary-semicolon, # Used when a statement is ended by a semi-colon (”;”), which isn’t necessary. + unused-variable # Used when a variable is defined but not used. (Use _var to ignore var). diff --git a/travis_config.sh b/travis_config.sh index db3bf773..4560f726 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -169,7 +169,8 @@ function pylint_test { echo "Starting Pylint tests..." $PYTHON -m pip install pylint==2.12.2 - $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd /io/tests + $PYTHON -m pylint /io/opencv/samples/python/squares.py } export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' From 3a4c30e50438a3f50c28deb80d16b96235dc7bb7 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 24 Mar 2022 18:17:16 +0300 Subject: [PATCH 187/293] Added pre-downloaded 3rdparty files to source packages --- .github/workflows/build_wheels_linux.yml | 6 ++++-- scripts/source-packages-preparation.sh | 20 ++++++++++++++++++++ setup.py | 2 ++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 scripts/source-packages-preparation.sh diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5ed44e21..3e3e010b 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -171,12 +171,14 @@ jobs: - name: Build a package run: | + # Download all 3rdparty files + source scripts/source-packages-preparation.sh ${{ github.workspace }} set -e # Build and package set -x python -m pip install --upgrade pip python -m pip install scikit-build - python setup.py sdist + python setup.py sdist --formats=xztar set +x # Install and run tests set -x @@ -186,7 +188,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: wheels - path: dist/opencv*.tar.gz + path: dist/opencv*.tar.xz test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/scripts/source-packages-preparation.sh b/scripts/source-packages-preparation.sh new file mode 100755 index 00000000..be49b5b8 --- /dev/null +++ b/scripts/source-packages-preparation.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# ${1} variable is a path to repository opencv-python + +# Define flags +if [ "0" == $ENABLE_CONTRIB ]; then + git submodule update --init opencv + EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty" +else + git submodule update --init opencv opencv_contrib + EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules" +fi + +# Download 3rdparty files +cd opencv && \ +mkdir generate && \ +cd generate && \ +cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \ +cd ${1} && \ +rm -rf opencv/generate diff --git a/setup.py b/setup.py index 5b79e389..c9f09212 100644 --- a/setup.py +++ b/setup.py @@ -162,6 +162,8 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", "-DBUILD_PNG=ON", + # To have all 3rdparty files in one place for source packages + "-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")), ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 7ba53fc4f48894593bda7493709d542e38e2c36d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 25 Mar 2022 11:52:15 +0300 Subject: [PATCH 188/293] Revert changes for pre-downloaded files --- .github/workflows/build_wheels_linux.yml | 2 -- scripts/source-packages-preparation.sh | 20 -------------------- setup.py | 2 -- 3 files changed, 24 deletions(-) delete mode 100755 scripts/source-packages-preparation.sh diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 3e3e010b..a368661d 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -171,8 +171,6 @@ jobs: - name: Build a package run: | - # Download all 3rdparty files - source scripts/source-packages-preparation.sh ${{ github.workspace }} set -e # Build and package set -x diff --git a/scripts/source-packages-preparation.sh b/scripts/source-packages-preparation.sh deleted file mode 100755 index be49b5b8..00000000 --- a/scripts/source-packages-preparation.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# ${1} variable is a path to repository opencv-python - -# Define flags -if [ "0" == $ENABLE_CONTRIB ]; then - git submodule update --init opencv - EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty" -else - git submodule update --init opencv opencv_contrib - EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules" -fi - -# Download 3rdparty files -cd opencv && \ -mkdir generate && \ -cd generate && \ -cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \ -cd ${1} && \ -rm -rf opencv/generate diff --git a/setup.py b/setup.py index c9f09212..5b79e389 100644 --- a/setup.py +++ b/setup.py @@ -162,8 +162,6 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", "-DBUILD_PNG=ON", - # To have all 3rdparty files in one place for source packages - "-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")), ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From ad010427c7197033532b3f2238b273bb9a5513fb Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 25 Mar 2022 17:10:44 +0300 Subject: [PATCH 189/293] Skip only gapi if it was not found --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c9f09212..2fbdc816 100644 --- a/setup.py +++ b/setup.py @@ -414,7 +414,8 @@ def _classify_installed_files_override( final_install_relpaths.append(new_install_relpath) del m, fslash_relpath, new_install_relpath else: - if not found: + # gapi can be missed if ADE was not downloaded (network issue) + if not found and "gapi" not in relpath_re: raise Exception("Not found: '%s'" % relpath_re) del r, found From f68be384bb0310f1fdf95351fdffda7bf288b8d1 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 25 Mar 2022 17:10:44 +0300 Subject: [PATCH 190/293] Skip only gapi if it was not found --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 5b79e389..5784d5a4 100644 --- a/setup.py +++ b/setup.py @@ -412,7 +412,8 @@ def _classify_installed_files_override( final_install_relpaths.append(new_install_relpath) del m, fslash_relpath, new_install_relpath else: - if not found: + # gapi can be missed if ADE was not downloaded (network issue) + if not found and "gapi" not in relpath_re: raise Exception("Not found: '%s'" % relpath_re) del r, found From 96cffde198e5bc3411a9577b97021ce59477f97a Mon Sep 17 00:00:00 2001 From: Yclept Nemo Date: Mon, 21 Mar 2022 15:06:30 -0400 Subject: [PATCH 191/293] Synchronize with scikit-build scikit-build commit 94089992b353ea3e4b4c2f118ea1987ca54ecbb8: skbuild/setuptools_wrap.py:_classify_installed_files cmake_install_dir -> _cmake_install_dir This allows tracking scikit-build versions >= 0.13.2. The dependencies file has been updated. --- pyproject.toml | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6aaab1d3..a47525d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ - "setuptools", "wheel", "scikit-build", "cmake", "pip", + "setuptools", "wheel", "cmake", "pip", + "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index 5b79e389..3714e9e3 100644 --- a/setup.py +++ b/setup.py @@ -451,7 +451,7 @@ def _classify_installed_files_override( data_files, # To get around a check that prepends source dir to paths and breaks package detection code. cmake_source_dir="", - cmake_install_dir=cmake_install_reldir, + _cmake_install_dir=cmake_install_reldir, ) From 7419f5820ea9c4d2d816f484f1930f2eca23e9cb Mon Sep 17 00:00:00 2001 From: Niyas Sait Date: Mon, 28 Mar 2022 10:13:56 +0100 Subject: [PATCH 192/293] add support for building windows/arm64 package --- setup.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 5784d5a4..b5c5580a 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def main(): ) # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode - x64 = sys.maxsize > 2 ** 32 + is64 = sys.maxsize > 2 ** 32 package_name = "opencv-python" @@ -88,7 +88,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if x64 else "")] + [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if is64 else "")] if os.name == "nt" else [] ) @@ -130,7 +130,7 @@ def main(): files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} ci_cmake_generator = ( - ["-G", "Visual Studio 14" + (" Win64" if x64 else "")] + ["-G", "Visual Studio 14" + (" Win64" if is64 else "")] if os.name == "nt" else ["-G", "Unix Makefiles"] ) @@ -164,9 +164,15 @@ def main(): "-DBUILD_PNG=ON", ] + ( + # CMake flags for windows/arm64 build + ["-DCMAKE_GENERATOR_PLATFORM=ARM64", + # Emulated cmake requires following flags to correctly detect + # target architecture for windows/arm64 build + "-DOPENCV_WORKAROUND_CMAKE_20989=ON", + "-DCMAKE_SYSTEM_PROCESSOR=ARM64"] + if platform.machine() == "ARM64" and sys.platform == "win32" # If it is not defined 'linker flags: /machine:X86' on Windows x64 - ["-DCMAKE_GENERATOR_PLATFORM=x64"] - if x64 and sys.platform == "win32" + else ["-DCMAKE_GENERATOR_PLATFORM=x64"] if is64 and sys.platform == "win32" else [] ) + ( @@ -186,7 +192,7 @@ def main(): "-DWITH_MSMF=OFF" ) # see: https://github.com/skvark/opencv-python/issues/263 - if sys.platform.startswith("linux") and not x64 and "bdist_wheel" in sys.argv: + if sys.platform.startswith("linux") and not is64 and "bdist_wheel" in sys.argv: subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True) # OS-specific components during CI builds From 4b068fcba76c2d61a041ed87f7e36b8248b53397 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 7 Apr 2022 13:34:12 +0300 Subject: [PATCH 193/293] Pinned versions for dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a47525d5..f237ddbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools", "wheel", "cmake", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake==3.22.3", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From f89dca7a27c9ba9659b0b3091e4f64ac1c9bc13d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Apr 2022 10:01:04 +0300 Subject: [PATCH 194/293] Downgraded cmake version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f237ddbc..ade9bc2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools==59.2.0", "wheel==0.37.0", "cmake==3.22.3", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.6.3", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From 443b747a4ee7ff8d23af221e0361d7f199d5c8ae Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Apr 2022 10:30:35 +0300 Subject: [PATCH 195/293] Downgraded cmake version to 3.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ade9bc2d..ff535e86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.6.3", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From 3ac27ad2f3648e4c750a4c3230171713cd2d1edf Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 01:23:49 +0300 Subject: [PATCH 196/293] Updated dependecies for the next release --- .github/workflows/build_wheels_linux.yml | 4 +- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 77 +++++++++++++++---- docker/manylinux2014/Dockerfile_x86_64 | 79 ++++++++++++++++---- setup.py | 1 - travis_config.sh | 5 -- 6 files changed, 127 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a368661d..fac5ebad 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -39,7 +39,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -145,7 +145,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index a97bbc29..c58e0631 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -40,7 +40,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index b380d3ba..fedf1e98 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -2,29 +2,60 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=4.4.1 +ARG FREETYPE_VERSION=2.12.1 +ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1m +ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel -y && \ + cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ + # libpng will be built from source + yum remove libpng -y + +RUN mkdir ~/libpng_sources && \ + cd ~/libpng_sources && \ + curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \ + tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \ + cd libpng-${LIBPNG_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/libpng_sources + +RUN mkdir ~/freetype_sources && \ + cd ~/freetype_sources && \ + curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ + cd freetype-${FREETYPE_VERSION} && \ + ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/freetype_sources RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qt-everywhere* && \ + cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-${QT_VERSION} && \ - rm qt-everywhere-src-${QT_VERSION}.tar.xz + rm -rf qt-everywhere* ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" -RUN mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +RUN mkdir ~/openssl_sources && \ + cd ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ @@ -32,31 +63,40 @@ RUN mkdir ~/ffmpeg_sources && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ - rm -rf ~/openssl_build + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/nasm_sources && \ + cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/nasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/yasm_sources && \ + cd ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/yasm_sources -RUN cd ~/ffmpeg_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 https://github.com/webmproject/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ @@ -66,7 +106,8 @@ RUN cd ~/ffmpeg_sources && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources + rm -rf ~/ffmpeg_sources && \ + yum remove bzip2-devel -y RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ @@ -75,6 +116,10 @@ RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERS make -j$(getconf _NPROCESSORS_ONLN) && \ make install +# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced +RUN mkdir /io && \ + git config --global --add safe.directory /io + ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib ENV PATH "$HOME/bin:$PATH" diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index fb367c0a..13325756 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,29 +1,60 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest ARG FFMPEG_VERSION=4.4.1 +ARG FREETYPE_VERSION=2.12.1 +ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1m +ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel -y && \ + cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ + # libpng will be built from source + yum remove libpng -y + +RUN mkdir ~/libpng_sources && \ + cd ~/libpng_sources && \ + curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \ + tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \ + cd libpng-${LIBPNG_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/libpng_sources + +RUN mkdir ~/freetype_sources && \ + cd ~/freetype_sources && \ + curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ + cd freetype-${FREETYPE_VERSION} && \ + ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/freetype_sources RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ - cd qt-everywhere* && \ + cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-${QT_VERSION} && \ - rm qt-everywhere-src-${QT_VERSION}.tar.xz + rm -rf qt-everywhere* ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" -RUN mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +RUN mkdir ~/openssl_sources && \ + cd ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ @@ -31,31 +62,42 @@ RUN mkdir ~/ffmpeg_sources && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ - rm -rf ~/openssl_build + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/nasm_sources && \ + cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/nasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/yasm_sources && \ + cd ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/yasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ @@ -65,7 +107,12 @@ RUN cd ~/ffmpeg_sources && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources + rm -rf ~/ffmpeg_sources && \ + yum remove bzip2-devel -y + +# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced +RUN mkdir /io && \ + git config --global --add safe.directory /io ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib diff --git a/setup.py b/setup.py index 02d991b9..e9255907 100644 --- a/setup.py +++ b/setup.py @@ -161,7 +161,6 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", - "-DBUILD_PNG=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 diff --git a/travis_config.sh b/travis_config.sh index 4560f726..366d35ad 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -98,11 +98,6 @@ function pre_build { if [ -n "$IS_OSX" ]; then brew install lapack - else - # epel-release need for aarch64 to get openblas packages - yum install -y lapack-devel epel-release && yum install -y openblas-devel - cp /usr/include/lapacke/lapacke*.h /usr/include/ - curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h fi if [ -n "$IS_OSX" ]; then From 4f8289d4627a42621303d9fce6f46b630950186e Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 10:48:58 +0300 Subject: [PATCH 197/293] Updated dependecies for the next release --- docker/manylinux2014/Dockerfile_aarch64 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index fedf1e98..03889a51 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -93,7 +93,9 @@ RUN mkdir ~/libvpx_sources && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ @@ -114,7 +116,9 @@ RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERS cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ccache-${CCACHE_VERSION}.tar.gz # Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced RUN mkdir /io && \ From 9ec924e1818c9ee755458cb8ac71fd2475d0153d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 13:31:34 +0300 Subject: [PATCH 198/293] Updated submodules to the latest commits --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index dad26339..d6151eae 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit dad26339a975b49cfb6c7dbe4bd5276c9dcb36e2 +Subproject commit d6151eae23aebdb3fce524a86026c2753daed685 diff --git a/opencv_contrib b/opencv_contrib index 49e8f123..84f8ea8e 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 49e8f123ca08e76891856a1ecce491b62d08ba20 +Subproject commit 84f8ea8e99f98d8ab7868dbd29cccb6bdd26fb94 diff --git a/opencv_extra b/opencv_extra index 37294e3c..c2cf721e 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 37294e3c876a72c992d4718b9bbfc8346b9e779a +Subproject commit c2cf721e3b8ce535900bc0f97a5cd17efb35361e From df365e5d8ca5cc0b4b29e26fdcc1837a38e8318e Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 13:33:43 +0300 Subject: [PATCH 199/293] Check changes on 3.4 branch in PRs --- .github/workflows/build_wheels_linux.yml | 1 + .github/workflows/build_wheels_linux_arm.yml | 1 + .github/workflows/build_wheels_macos.yml | 1 + .github/workflows/build_wheels_macos_m1.yml | 1 + .github/workflows/build_wheels_windows.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index fac5ebad..362001fb 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c58e0631..a892040b 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index bccec01f..c453ab85 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 9f7b0f37..1ac065f1 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 337c77b2..0dad17b5 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_macos*' From 5633cf319efadb628e8369b48834d74491c10b1a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 14:09:35 +0300 Subject: [PATCH 200/293] Removed unused lines --- setup.py | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/setup.py b/setup.py index 37366d9a..11014d6b 100644 --- a/setup.py +++ b/setup.py @@ -374,21 +374,6 @@ 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 .cv2 import _registerMatType\nfrom . import mat_wrapper\nfrom . import gapi' - '\nfrom . import misc\nfrom . import utils\nfrom . import data\nfrom . import version\n') - free_line_after_imports = 6 - opencv_init_lines.insert(free_line_after_imports, extra_imports) - opencv_init_data = "" - for line in opencv_init_lines: - opencv_init_replacement = line.replace('importlib.import_module("cv2")', 'importlib.import_module("cv2.cv2")') - opencv_init_data = opencv_init_data + opencv_init_replacement - - with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'w') as opencv_final_init: - opencv_final_init.write(opencv_init_data) - # 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 04b1a52ac69811a33db2fb2110a03b2971c110e5 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 6 Jun 2022 00:48:04 +0300 Subject: [PATCH 201/293] Updated submodules to 4.6.0 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index d6151eae..b0dc4741 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit d6151eae23aebdb3fce524a86026c2753daed685 +Subproject commit b0dc474160e389b9c9045da5db49d03ae17c6a6b diff --git a/opencv_contrib b/opencv_contrib index 84f8ea8e..db16caf6 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 84f8ea8e99f98d8ab7868dbd29cccb6bdd26fb94 +Subproject commit db16caf6ceee76b43b94c846be276e92a43e9700 diff --git a/opencv_extra b/opencv_extra index c2cf721e..936854e2 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit c2cf721e3b8ce535900bc0f97a5cd17efb35361e +Subproject commit 936854e2b666853d6d0732a8eabc2d699f4fa3d8 From 8d045058df0245039a8a8754d140a820548dedb8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 8 Jun 2022 13:36:57 +0300 Subject: [PATCH 202/293] Changed format of an archive for source packages --- .github/workflows/build_wheels_linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 362001fb..5315e161 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -177,7 +177,7 @@ jobs: set -x python -m pip install --upgrade pip python -m pip install scikit-build - python setup.py sdist --formats=xztar + python setup.py sdist --formats=gztar set +x # Install and run tests set -x @@ -187,7 +187,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: wheels - path: dist/opencv*.tar.xz + path: dist/opencv*.tar.gz test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease From 54473f17f7c138d4632b003a5e6f736e80481572 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Fri, 24 Jun 2022 22:09:56 +1000 Subject: [PATCH 203/293] Updated multibuild to upgrade default 64-bit test image to focal --- .gitmodules | 2 +- multibuild | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 655467e8..7193d3b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -6,7 +6,7 @@ url = https://github.com/opencv/opencv_contrib.git [submodule "multibuild"] path = multibuild - url = https://github.com/matthew-brett/multibuild.git + url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git diff --git a/multibuild b/multibuild index b89bb903..bce1637e 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit b89bb903e94308be79abefa4f436bf123ebb1313 +Subproject commit bce1637e202cb52b0e7ea42baa1cccc894b82806 From 4638ce51fa4ce1b8a8752acdb2320a8b328d275f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 4 Jul 2022 16:08:39 +0300 Subject: [PATCH 204/293] Changed labeles for macOS ARM64 and Linux ARM64 builds (#681) * Changed labeles for macOS ARM64 and Linux ARM64 builds * Changed labeles for macOS ARM64 and Linux ARM64 builds * Added proper cleanup step for all workflows, removed unused lines, changed ubuntu-latest to ubuntu-20.04 * Updated docker images to work under non-root user, unified cleanup step --- .github/workflows/build_wheels_linux.yml | 53 +++++++------------- .github/workflows/build_wheels_linux_arm.yml | 41 ++++----------- .github/workflows/build_wheels_macos.yml | 31 +++--------- .github/workflows/build_wheels_macos_m1.yml | 31 ++++-------- .github/workflows/build_wheels_windows.yml | 51 +++++++------------ docker/manylinux2014/Dockerfile_aarch64 | 35 +++++++++---- docker/manylinux2014/Dockerfile_x86_64 | 45 +++++++++++++---- 7 files changed, 121 insertions(+), 166 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5315e161..98ad3dc8 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -15,21 +15,18 @@ on: jobs: build: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 defaults: run: shell: bash - strategy: fail-fast: false matrix: - os: [ubuntu-latest] python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -40,34 +37,32 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} - USE_CCACHE: 1 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 + USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Update submodules if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Build a package run: source scripts/build.sh - - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: @@ -76,21 +71,18 @@ jobs: test: needs: [build] - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 defaults: run: shell: bash - strategy: fail-fast: false matrix: - os: [ubuntu-latest] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -98,42 +90,38 @@ jobs: NP_TEST_DEP_LATEST: numpy==1.21.2 CONFIG_PATH: travis_config.sh PLAT: x86_64 - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - - name: Package installation and run tests run: source scripts/install.sh build_sdist: - runs-on: ${{ matrix.os }} + runs-on: ubuntu-20.04 defaults: run: shell: bash - strategy: fail-fast: false matrix: - os: [ubuntu-latest] python-version: [3.8] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [1] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -146,30 +134,29 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Update submodules if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Build a package run: | set -e @@ -182,7 +169,6 @@ jobs: # Install and run tests set -x echo "skipping tests because of sdist" - - name: saving artifacts uses: actions/upload-artifact@v2 with: @@ -192,7 +178,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, build_sdist, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -202,7 +188,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -211,7 +196,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease needs: [build, build_sdist, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: @@ -221,22 +206,18 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* wheelhouse/opencv-python-[^h]* - - name: Upload wheels for opencv_contrib_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* wheelhouse/opencv-contrib-python-[^h]* - - name: Upload wheels for opencv_python_headless run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* wheelhouse/opencv-python-headless-* - - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index a892040b..4d0c3daf 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -15,21 +15,18 @@ on: jobs: build_arm: - runs-on: ${{ matrix.os }} + runs-on: opencv-cn-lin-arm64 defaults: run: shell: bash - strategy: fail-fast: false matrix: - os: [ARM64] python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -41,33 +38,30 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220628 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - steps: + - name: UID + run: id -u - name: Cleanup - if: always() - uses: AutoModality/action-clean@v1 - + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Build a package run: source scripts/build.sh - - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: @@ -76,21 +70,18 @@ jobs: test: needs: [build_arm] - runs-on: ${{ matrix.os }} + runs-on: opencv-cn-lin-arm64 defaults: run: shell: bash - strategy: fail-fast: false matrix: - os: [ARM64] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -100,34 +91,29 @@ jobs: CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 - steps: - name: Cleanup - if: always() - uses: AutoModality/action-clean@v1 - + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - - name: Package installation and run tests run: source scripts/install.sh test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build_arm, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -137,7 +123,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -146,7 +131,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease needs: [build_arm, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: @@ -156,22 +141,18 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index c453ab85..af892101 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -19,7 +19,6 @@ jobs: defaults: run: shell: bash - strategy: fail-fast: false matrix: @@ -40,7 +39,6 @@ jobs: python-version: '3.8' - os: macos-11 python-version: '3.9' - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -60,18 +58,18 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Update submodules if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Build a package run: | set -e @@ -89,13 +87,11 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT - - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: @@ -108,7 +104,6 @@ jobs: defaults: run: shell: bash - strategy: fail-fast: false matrix: @@ -129,7 +124,6 @@ jobs: python-version: '3.8' - os: macos-11 python-version: '3.9' - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -139,40 +133,36 @@ jobs: PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - - name: Package installation run: | python -m pip install wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests python get_build_info.py - - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules/python/test/test.py -v --repo . - - name: Pylint test run: | python -m pip install pylint==2.12.2 @@ -182,7 +172,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -192,7 +182,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -201,7 +190,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease needs: [build, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: @@ -211,22 +200,18 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 1ac065f1..a1d7c924 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -15,35 +15,32 @@ on: jobs: build: - runs-on: ${{ matrix.os }} - + runs-on: opencv-cn-mac-arm64 strategy: fail-fast: false matrix: - os: [macOS-M1] python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Update submodules if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Build a package run: | git submodule update --init multibuild @@ -53,13 +50,11 @@ jobs: arch -arm64 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: @@ -68,46 +63,41 @@ jobs: test: needs: [build] - runs-on: ${{ matrix.os }} - + runs-on: opencv-cn-mac-arm64-tests strategy: fail-fast: false matrix: - os: [macOS-M1] python-version: ['3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py - steps: + - name: Cleanup + run: find . -mindepth 1 -delete + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - - name: Package installation run: | arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} get_build_info.py - - name: Run tests run: | cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - - name: Pylint test run: | arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 @@ -117,7 +107,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -136,7 +126,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease needs: [build, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: @@ -146,7 +136,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python run: | python -m pip install twine diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0dad17b5..087efc04 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -14,48 +14,43 @@ on: jobs: build-windows-x86_64: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: powershell - + runs-on: windows-2019 strategy: fail-fast: false matrix: - os: [windows-2019] python-version: ['3.6'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata - steps: + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: false fetch-depth: 0 - - name: Update submodules if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 - - name: Build a package run: | python --version @@ -64,13 +59,11 @@ jobs: python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: @@ -79,45 +72,44 @@ jobs: test: needs: [build-windows-x86_64] - runs-on: ${{ matrix.os }} + runs-on: windows-2019 defaults: run: - shell: powershell - + shell: cmd strategy: fail-fast: false matrix: - os: [windows-2019] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py - steps: + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} - name: Checkout uses: actions/checkout@v2 with: submodules: true fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - - name: Package installation run: | cd ${{ github.workspace }}/tests @@ -125,24 +117,20 @@ jobs: if ($LastExitCode -ne 0) {throw $LastExitCode} python get_build_info.py shell: powershell - - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . - shell: cmd - - name: Pylint test run: | python -m pip install pylint==2.12.2 cd ${{ github.workspace }}\tests python -m pylint $PYLINT_TEST_FILE - shell: cmd test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build-windows-x86_64, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -152,7 +140,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -161,7 +148,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease needs: [build-windows-x86_64, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: @@ -171,22 +158,18 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless run: | python -m pip install twine python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 03889a51..2679cbbf 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,3 +1,6 @@ +# Version: 20220628 +# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 + FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 @@ -35,7 +38,7 @@ RUN mkdir ~/freetype_sources && \ curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ cd freetype-${FREETYPE_VERSION} && \ - ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \ make && \ make install && \ cd .. && \ @@ -59,7 +62,7 @@ RUN mkdir ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ - ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ + ./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ @@ -70,7 +73,7 @@ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -81,7 +84,7 @@ RUN mkdir ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -91,7 +94,7 @@ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ git clone --depth 1 https://github.com/webmproject/libvpx.git && \ cd libvpx && \ - ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -103,10 +106,10 @@ RUN mkdir ~/ffmpeg_sources && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ - echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ rm -rf ~/ffmpeg_sources && \ yum remove bzip2-devel -y @@ -120,10 +123,20 @@ RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERS cd .. && \ rm -rf ccache-${CCACHE_VERSION}.tar.gz +# Self-hosted runner UID is 1004 +RUN useradd ci -m -s /bin/bash -G users --uid=1004 && \ + mkdir /io && \ + chown -R ci:ci /io && \ + # This needs to find ffmpeg packages from ci user + chown -R ci:ci /ffmpeg_build && \ + # This calls in mutlibuild scripts and cannot be run without permissions + chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel + +USER ci + # Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced -RUN mkdir /io && \ - git config --global --add safe.directory /io +RUN git config --global --add safe.directory /io -ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig -ENV LDFLAGS -L/root/ffmpeg_build/lib +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib ENV PATH "$HOME/bin:$PATH" diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 13325756..8bb77341 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,5 +1,9 @@ +# Version: 20220628 +# Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 + FROM quay.io/pypa/manylinux2014_x86_64:latest +ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=4.4.1 ARG FREETYPE_VERSION=2.12.1 ARG LIBPNG_VERSION=1.6.37 @@ -34,7 +38,7 @@ RUN mkdir ~/freetype_sources && \ curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ cd freetype-${FREETYPE_VERSION} && \ - ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \ make && \ make install && \ cd .. && \ @@ -58,7 +62,7 @@ RUN mkdir ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ - ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ + ./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ @@ -69,7 +73,7 @@ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -80,7 +84,7 @@ RUN mkdir ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ - ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ + ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -90,7 +94,7 @@ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ - ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ cd .. && \ @@ -102,18 +106,37 @@ RUN mkdir ~/ffmpeg_sources && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ - PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ - echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ rm -rf ~/ffmpeg_sources && \ yum remove bzip2-devel -y +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ + ./configure && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ccache-${CCACHE_VERSION}.tar.gz + +# GitHub Actions user`s UID is 1001 +RUN useradd ci -m -s /bin/bash -G users --uid=1001 && \ + mkdir /io && \ + chown -R ci:ci /io && \ + # This needs to find ffmpeg packages from ci user + chown -R ci:ci /ffmpeg_build && \ + # This calls in mutlibuild scripts and cannot be run without permissions + chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel + +USER ci + # Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced -RUN mkdir /io && \ - git config --global --add safe.directory /io +RUN git config --global --add safe.directory /io -ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig -ENV LDFLAGS -L/root/ffmpeg_build/lib +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib ENV PATH "$HOME/bin:$PATH" From 7b10157d8cc8bac6089e181a52f2dd50edffa979 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 29 Jul 2022 18:13:48 +0300 Subject: [PATCH 205/293] Updated submodules to the latest in 5.x (#696) --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index b0dc4741..638a0788 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b0dc474160e389b9c9045da5db49d03ae17c6a6b +Subproject commit 638a0788fe8ba58d735ac0eddbc8297bb3105da0 diff --git a/opencv_contrib b/opencv_contrib index db16caf6..b9ccfebf 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit db16caf6ceee76b43b94c846be276e92a43e9700 +Subproject commit b9ccfebf24d993ce5009c1b28c2bcbbdb3721a2c diff --git a/opencv_extra b/opencv_extra index 936854e2..a13afb81 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 936854e2b666853d6d0732a8eabc2d699f4fa3d8 +Subproject commit a13afb81a66b95c25d83bcc4d661ae516bdfedde From 2585d6f6b39141e3e3d1b9ffd52f4faed3d0296e Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 1 Aug 2022 09:21:27 +0300 Subject: [PATCH 206/293] Run pipelines on 4.x and 5.x branches (#697) --- .github/workflows/build_wheels_linux.yml | 2 ++ .github/workflows/build_wheels_linux_arm.yml | 2 ++ .github/workflows/build_wheels_macos.yml | 2 ++ .github/workflows/build_wheels_macos_m1.yml | 2 ++ .github/workflows/build_wheels_windows.yml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 98ad3dc8..76a6d649 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 4d0c3daf..0a4dadbc 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index af892101..438373bb 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a1d7c924..134d5450 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 087efc04..f7d2c408 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_macos*' From 3336f6717fa24a74d59e6116593d3acdcb247576 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 1 Aug 2022 09:21:27 +0300 Subject: [PATCH 207/293] Run pipelines on 4.x and 5.x branches (#697) --- .github/workflows/build_wheels_linux.yml | 2 ++ .github/workflows/build_wheels_linux_arm.yml | 2 ++ .github/workflows/build_wheels_macos.yml | 2 ++ .github/workflows/build_wheels_macos_m1.yml | 2 ++ .github/workflows/build_wheels_windows.yml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 98ad3dc8..76a6d649 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 4d0c3daf..0a4dadbc 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index af892101..438373bb 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a1d7c924..134d5450 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 087efc04..f7d2c408 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_macos*' From 5aad8e1c6a131ae08e240973ed58fd49c48ee05c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Aug 2022 09:45:37 +0300 Subject: [PATCH 208/293] Fix path to opencv 5.x for haarcascades --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11014d6b..3a1a7cfd 100644 --- a/setup.py +++ b/setup.py @@ -109,7 +109,7 @@ def main(): r"python/cv2/.*config.*.py" ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/opencv5") + r"/haarcascades/.*\.xml" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 615f3dff836d820398105b82b6ada39d0155cbdc Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:12:49 +0300 Subject: [PATCH 209/293] Scheduled rolling workflows (#699) * Scheduled rolling workflows * Fixed a bug in commit/date for package version * Changed the name of Windows pipelines --- .github/workflows/build_wheels_linux.yml | 96 ++++++++++++++------ .github/workflows/build_wheels_linux_arm.yml | 80 ++++++++++++---- .github/workflows/build_wheels_macos.yml | 78 +++++++++++----- .github/workflows/build_wheels_macos_m1.yml | 81 +++++++++++++---- .github/workflows/build_wheels_windows.yml | 76 ++++++++++++---- find_version.py | 13 ++- scripts/build.sh | 1 + scripts/install.sh | 1 + setup.py | 39 +++++--- 9 files changed, 345 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 76a6d649..a0933da5 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux x86_64 +name: Linux x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ubuntu-20.04 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -50,29 +53,33 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ubuntu-20.04 defaults: run: @@ -97,21 +104,21 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - build_sdist: + Build_sdist: runs-on: ubuntu-20.04 defaults: run: @@ -127,7 +134,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -142,20 +149,25 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} + ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -172,21 +184,51 @@ jobs: set -x echo "skipping tests because of sdist" - name: saving artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: dist/opencv*.tar.gz - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Build_sdist, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -195,16 +237,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 0a4dadbc..d2c5ea35 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux ARM +name: Linux ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build_arm: + Build: runs-on: opencv-cn-lin-arm64 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -47,31 +50,36 @@ jobs: ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} steps: - - name: UID - run: id -u - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build_arm] + Test: + needs: [Build] runs-on: opencv-cn-lin-arm64 defaults: run: @@ -88,6 +96,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 + BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -97,31 +106,66 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -130,16 +174,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 438373bb..5b110fb7 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos +name: macOS x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ${{ matrix.os }} defaults: run: @@ -44,7 +47,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -52,7 +55,6 @@ jobs: TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -64,14 +66,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | set -e @@ -90,18 +96,18 @@ jobs: set -x build_wheel $REPO_DIR $PLAT - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ${{ matrix.os }} defaults: run: @@ -140,19 +146,19 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -171,16 +177,46 @@ jobs: cd ${{ github.workspace }}/tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -189,16 +225,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 134d5450..91d70ff3 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos M1 +name: macOS ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: opencv-cn-mac-arm64 strategy: fail-fast: false @@ -27,6 +30,7 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -35,14 +39,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | git submodule update --init multibuild @@ -53,18 +61,18 @@ jobs: arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: opencv-cn-mac-arm64-tests strategy: fail-fast: false @@ -75,19 +83,25 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -106,35 +120,64 @@ jobs: cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f7d2c408..f8970768 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Windows +name: Windows x86_64 on: pull_request: @@ -12,10 +12,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build-windows-x86_64: + Build: runs-on: windows-2019 strategy: fail-fast: false @@ -38,16 +41,19 @@ jobs: rm -rf ./* || true rm -rf ./.??* || true working-directory: ${{ github.workspace }} + - name: Setup environment + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -62,18 +68,18 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* - test: - needs: [build-windows-x86_64] + Test: + needs: [Build] runs-on: windows-2019 defaults: run: @@ -98,17 +104,17 @@ jobs: rm -rf ./.??* || true working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -129,16 +135,46 @@ jobs: cd ${{ github.workspace }}\tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -147,16 +183,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/find_version.py b/find_version.py index 6c676b23..274c93e6 100644 --- a/find_version.py +++ b/find_version.py @@ -1,11 +1,12 @@ import sys -import os import subprocess +from datetime import date if __name__ == "__main__": contrib = sys.argv[1] headless = sys.argv[2] - ci_build = sys.argv[3] + rolling = sys.argv[3] + ci_build = sys.argv[4] opencv_version = "" # dig out the version from OpenCV sources @@ -56,13 +57,19 @@ # tag identifies the build and should be a sequential revision number version = tag[0] opencv_version += ".{}".format(version) + # rolling has converted into string using get_and_set_info() function in setup.py + elif rolling == "True": + # rolling version identifier, will be published in a dedicated rolling PyPI repository + version = date.today().strftime('%Y%m%d') + opencv_version += ".{}".format(version) else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += "+{}".format(version) + opencv_version += ".{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) f.write("contrib = {}\n".format(contrib)) f.write("headless = {}\n".format(headless)) + f.write("rolling = {}\n".format(rolling)) f.write("ci_build = {}".format(ci_build)) diff --git a/scripts/build.sh b/scripts/build.sh index f48ca066..e5c83d83 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,5 +13,6 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x build_wheel $REPO_DIR $PLAT diff --git a/scripts/install.sh b/scripts/install.sh index 6e019d1c..f20080ae 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -13,6 +13,7 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x install_run $PLAT set +x diff --git a/setup.py b/setup.py index 11014d6b..dd44ae8f 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ def main(): build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" + build_rolling = get_build_env_var_by_name("rolling") install_requires = [ 'numpy>=1.13.3; python_version<"3.7"', @@ -46,17 +47,28 @@ def main(): g = git.Git() # NOTE: pip API's are internal, this has to be refactored g.run_command(["submodule", "sync"]) - g.run_command( - ["submodule", "update", "--init", "--recursive", cmake_source_dir] - ) - if build_contrib: + if build_rolling: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", cmake_source_dir] + ) + + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", "opencv_contrib"] + ) + else: g.run_command( - ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ["submodule", "update", "--init", "--recursive", cmake_source_dir] ) - package_version, build_contrib, build_headless = get_and_set_info( - build_contrib, build_headless, is_CI_build + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ) + + package_version, build_contrib, build_headless, build_rolling = get_and_set_info( + build_contrib, build_headless, build_rolling, is_CI_build ) # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode @@ -73,6 +85,9 @@ def main(): if build_headless and not build_contrib: package_name = "opencv-python-headless" + if build_rolling: + package_name += "-rolling" + long_description = io.open("README.md", encoding="utf-8").read() packages = ["cv2", "cv2.data"] @@ -245,14 +260,14 @@ def main(): skbuild.setup( name=package_name, version=package_version, - url="https://github.com/skvark/opencv-python", + url="https://github.com/opencv/opencv-python", license="MIT", description="Wrapper package for OpenCV python bindings.", long_description=long_description, long_description_content_type="text/markdown", packages=packages, package_data=package_data, - maintainer="Olli-Pekka Heinisuo", + maintainer="OpenCV Team", ext_modules=EmptyListWithLength(), install_requires=install_requires, python_requires=">=3.6", @@ -446,7 +461,7 @@ def _classify_installed_files_override( ) -def get_and_set_info(contrib, headless, ci_build): +def get_and_set_info(contrib, headless, rolling, ci_build): # cv2/version.py should be generated by running find_version.py version = {} here = os.path.abspath(os.path.dirname(__file__)) @@ -456,14 +471,14 @@ def get_and_set_info(contrib, headless, ci_build): # (in sdists the version.py file already exists) if os.path.exists(".git"): old_args = sys.argv.copy() - sys.argv = ["", str(contrib), str(headless), str(ci_build)] + sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)] runpy.run_path("find_version.py", run_name="__main__") sys.argv = old_args with open(version_file) as fp: exec(fp.read(), version) - return version["opencv_version"], version["contrib"], version["headless"] + return version["opencv_version"], version["contrib"], version["headless"], version["rolling"] def get_build_env_var_by_name(flag_name): From 60630d15f998a5827c8afaf575e7077c28d378a6 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 5 Aug 2022 18:43:33 +0300 Subject: [PATCH 210/293] macOS x86_64 runner change to macos-11 (#701) --- .github/workflows/build_wheels_macos.yml | 29 +++--------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 5b110fb7..adc3724d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,30 +20,18 @@ on: jobs: Build: - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -62,6 +50,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + MACOSX_DEPLOYMENT_TARGET: 10.15 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -108,30 +97,18 @@ jobs: Test: needs: [Build] - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} From 3d0b585fc1b83761a2d2d3d83f1ad55c1266831c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:12:49 +0300 Subject: [PATCH 211/293] Scheduled rolling workflows (#699) * Scheduled rolling workflows * Fixed a bug in commit/date for package version * Changed the name of Windows pipelines --- .github/workflows/build_wheels_linux.yml | 96 ++++++++++++++------ .github/workflows/build_wheels_linux_arm.yml | 80 ++++++++++++---- .github/workflows/build_wheels_macos.yml | 78 +++++++++++----- .github/workflows/build_wheels_macos_m1.yml | 81 +++++++++++++---- .github/workflows/build_wheels_windows.yml | 76 ++++++++++++---- find_version.py | 13 ++- scripts/build.sh | 1 + scripts/install.sh | 1 + setup.py | 39 +++++--- 9 files changed, 345 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 76a6d649..a0933da5 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux x86_64 +name: Linux x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ubuntu-20.04 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -50,29 +53,33 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ubuntu-20.04 defaults: run: @@ -97,21 +104,21 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - build_sdist: + Build_sdist: runs-on: ubuntu-20.04 defaults: run: @@ -127,7 +134,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -142,20 +149,25 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} + ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -172,21 +184,51 @@ jobs: set -x echo "skipping tests because of sdist" - name: saving artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: dist/opencv*.tar.gz - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Build_sdist, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -195,16 +237,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 0a4dadbc..d2c5ea35 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux ARM +name: Linux ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build_arm: + Build: runs-on: opencv-cn-lin-arm64 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -47,31 +50,36 @@ jobs: ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} steps: - - name: UID - run: id -u - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build_arm] + Test: + needs: [Build] runs-on: opencv-cn-lin-arm64 defaults: run: @@ -88,6 +96,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 + BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -97,31 +106,66 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -130,16 +174,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 438373bb..5b110fb7 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos +name: macOS x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ${{ matrix.os }} defaults: run: @@ -44,7 +47,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -52,7 +55,6 @@ jobs: TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -64,14 +66,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | set -e @@ -90,18 +96,18 @@ jobs: set -x build_wheel $REPO_DIR $PLAT - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ${{ matrix.os }} defaults: run: @@ -140,19 +146,19 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -171,16 +177,46 @@ jobs: cd ${{ github.workspace }}/tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -189,16 +225,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 134d5450..91d70ff3 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos M1 +name: macOS ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: opencv-cn-mac-arm64 strategy: fail-fast: false @@ -27,6 +30,7 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -35,14 +39,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | git submodule update --init multibuild @@ -53,18 +61,18 @@ jobs: arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: opencv-cn-mac-arm64-tests strategy: fail-fast: false @@ -75,19 +83,25 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -106,35 +120,64 @@ jobs: cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f7d2c408..f8970768 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Windows +name: Windows x86_64 on: pull_request: @@ -12,10 +12,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build-windows-x86_64: + Build: runs-on: windows-2019 strategy: fail-fast: false @@ -38,16 +41,19 @@ jobs: rm -rf ./* || true rm -rf ./.??* || true working-directory: ${{ github.workspace }} + - name: Setup environment + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -62,18 +68,18 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* - test: - needs: [build-windows-x86_64] + Test: + needs: [Build] runs-on: windows-2019 defaults: run: @@ -98,17 +104,17 @@ jobs: rm -rf ./.??* || true working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -129,16 +135,46 @@ jobs: cd ${{ github.workspace }}\tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -147,16 +183,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/find_version.py b/find_version.py index 6c676b23..274c93e6 100644 --- a/find_version.py +++ b/find_version.py @@ -1,11 +1,12 @@ import sys -import os import subprocess +from datetime import date if __name__ == "__main__": contrib = sys.argv[1] headless = sys.argv[2] - ci_build = sys.argv[3] + rolling = sys.argv[3] + ci_build = sys.argv[4] opencv_version = "" # dig out the version from OpenCV sources @@ -56,13 +57,19 @@ # tag identifies the build and should be a sequential revision number version = tag[0] opencv_version += ".{}".format(version) + # rolling has converted into string using get_and_set_info() function in setup.py + elif rolling == "True": + # rolling version identifier, will be published in a dedicated rolling PyPI repository + version = date.today().strftime('%Y%m%d') + opencv_version += ".{}".format(version) else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += "+{}".format(version) + opencv_version += ".{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) f.write("contrib = {}\n".format(contrib)) f.write("headless = {}\n".format(headless)) + f.write("rolling = {}\n".format(rolling)) f.write("ci_build = {}".format(ci_build)) diff --git a/scripts/build.sh b/scripts/build.sh index f48ca066..e5c83d83 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,5 +13,6 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x build_wheel $REPO_DIR $PLAT diff --git a/scripts/install.sh b/scripts/install.sh index 6e019d1c..f20080ae 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -13,6 +13,7 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x install_run $PLAT set +x diff --git a/setup.py b/setup.py index 3a1a7cfd..9b937e59 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ def main(): build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" + build_rolling = get_build_env_var_by_name("rolling") install_requires = [ 'numpy>=1.13.3; python_version<"3.7"', @@ -46,17 +47,28 @@ def main(): g = git.Git() # NOTE: pip API's are internal, this has to be refactored g.run_command(["submodule", "sync"]) - g.run_command( - ["submodule", "update", "--init", "--recursive", cmake_source_dir] - ) - if build_contrib: + if build_rolling: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", cmake_source_dir] + ) + + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", "opencv_contrib"] + ) + else: g.run_command( - ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ["submodule", "update", "--init", "--recursive", cmake_source_dir] ) - package_version, build_contrib, build_headless = get_and_set_info( - build_contrib, build_headless, is_CI_build + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ) + + package_version, build_contrib, build_headless, build_rolling = get_and_set_info( + build_contrib, build_headless, build_rolling, is_CI_build ) # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode @@ -73,6 +85,9 @@ def main(): if build_headless and not build_contrib: package_name = "opencv-python-headless" + if build_rolling: + package_name += "-rolling" + long_description = io.open("README.md", encoding="utf-8").read() packages = ["cv2", "cv2.data"] @@ -245,14 +260,14 @@ def main(): skbuild.setup( name=package_name, version=package_version, - url="https://github.com/skvark/opencv-python", + url="https://github.com/opencv/opencv-python", license="MIT", description="Wrapper package for OpenCV python bindings.", long_description=long_description, long_description_content_type="text/markdown", packages=packages, package_data=package_data, - maintainer="Olli-Pekka Heinisuo", + maintainer="OpenCV Team", ext_modules=EmptyListWithLength(), install_requires=install_requires, python_requires=">=3.6", @@ -446,7 +461,7 @@ def _classify_installed_files_override( ) -def get_and_set_info(contrib, headless, ci_build): +def get_and_set_info(contrib, headless, rolling, ci_build): # cv2/version.py should be generated by running find_version.py version = {} here = os.path.abspath(os.path.dirname(__file__)) @@ -456,14 +471,14 @@ def get_and_set_info(contrib, headless, ci_build): # (in sdists the version.py file already exists) if os.path.exists(".git"): old_args = sys.argv.copy() - sys.argv = ["", str(contrib), str(headless), str(ci_build)] + sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)] runpy.run_path("find_version.py", run_name="__main__") sys.argv = old_args with open(version_file) as fp: exec(fp.read(), version) - return version["opencv_version"], version["contrib"], version["headless"] + return version["opencv_version"], version["contrib"], version["headless"], version["rolling"] def get_build_env_var_by_name(flag_name): From f9c40212eb060f5b56a7545b2dbaea2fa62a94b3 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 5 Aug 2022 18:43:33 +0300 Subject: [PATCH 212/293] macOS x86_64 runner change to macos-11 (#701) --- .github/workflows/build_wheels_macos.yml | 29 +++--------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 5b110fb7..adc3724d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,30 +20,18 @@ on: jobs: Build: - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -62,6 +50,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + MACOSX_DEPLOYMENT_TARGET: 10.15 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -108,30 +97,18 @@ jobs: Test: needs: [Build] - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} From e65f21f7bc82949d3588eb5b0a059cf4706cb807 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:07:00 +0300 Subject: [PATCH 213/293] Adapted rolling releases to workflow_dispatch event (#708) --- .github/workflows/build_wheels_linux.yml | 7 ++++--- .github/workflows/build_wheels_linux_arm.yml | 3 ++- .github/workflows/build_wheels_macos.yml | 3 ++- .github/workflows/build_wheels_macos_m1.yml | 3 ++- .github/workflows/build_wheels_windows.yml | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a0933da5..5a09e933 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout @@ -149,7 +150,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} - ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -158,7 +158,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index d2c5ea35..c6b9b4c5 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index adc3724d..1ac459cd 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -59,7 +59,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 91d70ff3..3d8f9b62 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -43,7 +43,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f8970768..e6874ffe 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -44,7 +44,7 @@ jobs: - name: Setup environment shell: bash run: | - if [[ "${{ github.event_name }}" == "schedule" ]]; then + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout From 710c89ec0263f0a1fa882dd66891a11e46ff4e46 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:07:50 +0300 Subject: [PATCH 214/293] Adapted rolling releases to workflow_dispatch event (#709) --- .github/workflows/build_wheels_linux.yml | 7 ++++--- .github/workflows/build_wheels_linux_arm.yml | 3 ++- .github/workflows/build_wheels_macos.yml | 3 ++- .github/workflows/build_wheels_macos_m1.yml | 3 ++- .github/workflows/build_wheels_windows.yml | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a0933da5..5a09e933 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout @@ -149,7 +150,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} - ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -158,7 +158,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index d2c5ea35..c6b9b4c5 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index adc3724d..1ac459cd 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -59,7 +59,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 91d70ff3..3d8f9b62 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -43,7 +43,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f8970768..e6874ffe 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -44,7 +44,7 @@ jobs: - name: Setup environment shell: bash run: | - if [[ "${{ github.event_name }}" == "schedule" ]]; then + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout From c9a96a60fc0bc25272f48ad27b48a985a547bd0f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Sun, 21 Aug 2022 17:51:26 +0300 Subject: [PATCH 215/293] Defined 5.x branch for submodules (#710) --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 7193d3b9..99476363 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 5.x [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 5.x [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git + branch = 5.x From 7bb3e773c1f07b02da94682ef3340dedb4a7f64e Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:37:11 +0300 Subject: [PATCH 216/293] Remove source packages for rolling packages (#711) --- .github/workflows/build_wheels_linux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5a09e933..a8cdd34e 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -192,7 +192,7 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - needs: [Build, Build_sdist, Test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-rolling-release defaults: @@ -206,19 +206,19 @@ jobs: - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* - name: Upload wheels for opencv_contrib_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* - name: Upload wheels for opencv_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* - name: Upload wheels for opencv_contrib_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* Pre-release: if: github.event_name == 'release' && github.event.release.prerelease From ebd7b5aa14ac79dfc650370ed200e31a2a8aa045 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:37:19 +0300 Subject: [PATCH 217/293] Remove source packages for rolling packages (#712) --- .github/workflows/build_wheels_linux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5a09e933..a8cdd34e 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -192,7 +192,7 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - needs: [Build, Build_sdist, Test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-rolling-release defaults: @@ -206,19 +206,19 @@ jobs: - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* - name: Upload wheels for opencv_contrib_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* - name: Upload wheels for opencv_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* - name: Upload wheels for opencv_contrib_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* Pre-release: if: github.event_name == 'release' && github.event.release.prerelease From 379d281600b11842f9fd7495efa313077998082d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 26 Aug 2022 15:27:15 +0300 Subject: [PATCH 218/293] Build zlib from the source on Linux with the latest version (#715) * Added zlib build from the source on Linux, handling auditwheel issues * Removed unused variable * Removed bzip2 from dependencies for OpenCV Python packages --- .github/workflows/build_wheels_linux.yml | 10 +---- .github/workflows/build_wheels_linux_arm.yml | 12 +----- .github/workflows/build_wheels_macos.yml | 4 -- .github/workflows/build_wheels_macos_m1.yml | 10 ----- docker/manylinux2014/Dockerfile_aarch64 | 29 +++++++++----- docker/manylinux2014/Dockerfile_x86_64 | 29 +++++++++----- patch_auditwheel_whitelist.py | 40 ++++++++++++++++---- 7 files changed, 75 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a8cdd34e..ab377325 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -35,14 +35,13 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -135,7 +131,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -156,9 +151,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c6b9b4c5..079efbe1 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -43,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -97,7 +93,6 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 - BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -107,11 +102,6 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1ac459cd..1c2a1614 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -57,9 +56,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3d8f9b62..b51801ab 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -30,7 +30,6 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -41,9 +40,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -84,18 +80,12 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 2679cbbf..48ad3f98 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 8bb77341..85fc22fd 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index b32da17a..150f97ca 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -3,13 +3,39 @@ from auditwheel import policy -policies = None -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: - policies = json.load(f) +def add_zlib_versions(): + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'r') as manylinux_policy: + manylinux_policy_lines = manylinux_policy.readlines() -for p in policies: - p["lib_whitelist"].append("libxcb.so.1") + manylinux_policy_data = "" + for line in manylinux_policy_lines: + if "ZLIB" in line: + if len(line) > 22: + updated_line = line[:-2] + ', "1.2.9", "1.2.12"]' + else: + updated_line = line[:-2] + '"1.2.9", "1.2.12"]' + manylinux_policy_replacement = line.replace(line, updated_line) + else: + manylinux_policy_replacement = line + manylinux_policy_data = manylinux_policy_data + manylinux_policy_replacement -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: - f.write(json.dumps(policies)) + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'w') as manylinux_final_policy: + manylinux_final_policy.write(manylinux_policy_data) + +def add_whitelisted_libs(): + policies = None + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: + policies = json.load(f) + + for p in policies: + p["lib_whitelist"].append("libxcb.so.1") + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: + f.write(json.dumps(policies)) + + +if __name__ == '__main__': + add_zlib_versions() + add_whitelisted_libs() From ec5c8b55b61cbc18d2e38cf7ac260dc72f15b516 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 29 Aug 2022 09:34:59 +0300 Subject: [PATCH 219/293] Build zlib from the source on Linux with the latest version (#715) (#718) * Added zlib build from the source on Linux, handling auditwheel issues * Removed unused variable * Removed bzip2 from dependencies for OpenCV Python packages --- .github/workflows/build_wheels_linux.yml | 10 +---- .github/workflows/build_wheels_linux_arm.yml | 12 +----- .github/workflows/build_wheels_macos.yml | 4 -- .github/workflows/build_wheels_macos_m1.yml | 10 ----- docker/manylinux2014/Dockerfile_aarch64 | 29 +++++++++----- docker/manylinux2014/Dockerfile_x86_64 | 29 +++++++++----- patch_auditwheel_whitelist.py | 40 ++++++++++++++++---- 7 files changed, 75 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a8cdd34e..ab377325 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -35,14 +35,13 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -135,7 +131,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -156,9 +151,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c6b9b4c5..079efbe1 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -43,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -97,7 +93,6 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 - BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -107,11 +102,6 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1ac459cd..1c2a1614 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -57,9 +56,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3d8f9b62..b51801ab 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -30,7 +30,6 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -41,9 +40,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -84,18 +80,12 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 2679cbbf..48ad3f98 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 8bb77341..85fc22fd 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index b32da17a..150f97ca 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -3,13 +3,39 @@ from auditwheel import policy -policies = None -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: - policies = json.load(f) +def add_zlib_versions(): + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'r') as manylinux_policy: + manylinux_policy_lines = manylinux_policy.readlines() -for p in policies: - p["lib_whitelist"].append("libxcb.so.1") + manylinux_policy_data = "" + for line in manylinux_policy_lines: + if "ZLIB" in line: + if len(line) > 22: + updated_line = line[:-2] + ', "1.2.9", "1.2.12"]' + else: + updated_line = line[:-2] + '"1.2.9", "1.2.12"]' + manylinux_policy_replacement = line.replace(line, updated_line) + else: + manylinux_policy_replacement = line + manylinux_policy_data = manylinux_policy_data + manylinux_policy_replacement -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: - f.write(json.dumps(policies)) + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'w') as manylinux_final_policy: + manylinux_final_policy.write(manylinux_policy_data) + +def add_whitelisted_libs(): + policies = None + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: + policies = json.load(f) + + for p in policies: + p["lib_whitelist"].append("libxcb.so.1") + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: + f.write(json.dumps(policies)) + + +if __name__ == '__main__': + add_zlib_versions() + add_whitelisted_libs() From deb39036bddf23d520b65684a8e698c36a47167c Mon Sep 17 00:00:00 2001 From: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com> Date: Mon, 29 Aug 2022 02:36:17 -0400 Subject: [PATCH 220/293] Build x64 macOS wheels for 10.13 build target (#716) --- .github/workflows/build_wheels_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1c2a1614..584520b2 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -49,7 +49,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - MACOSX_DEPLOYMENT_TARGET: 10.15 + MACOSX_DEPLOYMENT_TARGET: 10.13 steps: - name: Cleanup run: find . -mindepth 1 -delete From 37258984cf4b7ba64da84c0fb8d2fc326173e505 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:00:15 +0300 Subject: [PATCH 221/293] Bump numpy version to 1.21.4 for macOS builds (#720) --- pyproject.toml | 3 ++- setup.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ff535e86..5993a2ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,5 +8,6 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10'" + "numpy==1.21.2; python_version>='3.10'", + "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" ] diff --git a/setup.py b/setup.py index dd44ae8f..39b8b9bd 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ def main(): 'numpy>=1.19.3; python_version>="3.9"', 'numpy>=1.21.2; python_version>="3.10"', 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', - 'numpy>=1.21.2; python_version>="3.6" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', ] python_version = cmaker.CMaker.get_python_version() From 66bbd9d95cb03cb36f9a3f5c1e7a78e4ef7c64c2 Mon Sep 17 00:00:00 2001 From: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com> Date: Mon, 29 Aug 2022 02:36:17 -0400 Subject: [PATCH 222/293] Build x64 macOS wheels for 10.13 build target (#716) --- .github/workflows/build_wheels_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1c2a1614..584520b2 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -49,7 +49,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - MACOSX_DEPLOYMENT_TARGET: 10.15 + MACOSX_DEPLOYMENT_TARGET: 10.13 steps: - name: Cleanup run: find . -mindepth 1 -delete From b0b7f9f7f29a9de17131be5b68a983a3f86e1d27 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:00:15 +0300 Subject: [PATCH 223/293] Bump numpy version to 1.21.4 for macOS builds (#720) --- pyproject.toml | 3 ++- setup.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ff535e86..5993a2ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,5 +8,6 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10'" + "numpy==1.21.2; python_version>='3.10'", + "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" ] diff --git a/setup.py b/setup.py index 9b937e59..11d2cb0f 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ def main(): 'numpy>=1.19.3; python_version>="3.9"', 'numpy>=1.21.2; python_version>="3.10"', 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', - 'numpy>=1.21.2; python_version>="3.6" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', ] python_version = cmaker.CMaker.get_python_version() From 3b13ba78fae3276884b73d5f180fe16ba20c257a Mon Sep 17 00:00:00 2001 From: "peter.kovacs" Date: Mon, 7 Nov 2022 22:07:13 +0100 Subject: [PATCH 224/293] Add Vulkan license text to LICENSE-3RD-PARTY.txt --- LICENSE-3RD-PARTY.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index caeffe51..1478ae56 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -2435,4 +2435,22 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings -in this Software without prior written authorization from The Open Group. \ No newline at end of file +in this Software without prior written authorization from The Open Group. + +------------------------------------------------------------------------------ +Vulkan headers are redistributed within all opencv-python packages. +This license applies to Vulkan headers in the directory 3rdparty/include/vulkan. + +Copyright (c) 2015-2018 The Khronos Group Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. From f6be1c8a13ff66e8074ad497fb3fd7b29ba1e205 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 29 Nov 2022 18:37:02 +0300 Subject: [PATCH 225/293] OpenCV dependnecies update. --- docker/manylinux2014/Dockerfile_aarch64 | 4 ++-- docker/manylinux2014/Dockerfile_i686 | 4 ++-- docker/manylinux2014/Dockerfile_x86_64 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 2679cbbf..5139fe79 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -4,11 +4,11 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=4.4.1 +ARG FFMPEG_VERSION=5.1.2 ARG FREETYPE_VERSION=2.12.1 ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1o +ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index 3b866874..c11f6a4d 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -2,9 +2,9 @@ FROM quay.io/pypa/manylinux2014_i686:latest ARG CCACHE_VERSION=3.7.9 ARG CMAKE_VERSION=3.17.0 -ARG FFMPEG_VERSION=4.4.1 +ARG FFMPEG_VERSION=5.1.2 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1m +ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 8bb77341..08b0e421 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -4,11 +4,11 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=4.4.1 +ARG FFMPEG_VERSION=5.1.2 ARG FREETYPE_VERSION=2.12.1 ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1o +ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 From 0bff35d06d77bfc2b53a9b84f9bf95ea3c8cbbd6 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 5 Dec 2022 10:39:06 +0300 Subject: [PATCH 226/293] Stick to CMake 3.24 on Windows to work around 3.25 regression. --- .github/workflows/build_wheels_windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index e6874ffe..07bb00cc 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -60,10 +60,12 @@ jobs: - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 - name: Build a package + # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | python --version python -m pip install --upgrade pip python -m pip install --upgrade setuptools + python -m pip install cmake==3.24.2 python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd From 8f26419d49c214593c62988619f7f427702f0988 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 13 Dec 2022 00:10:36 +0300 Subject: [PATCH 227/293] Update pypi default index url --- .github/workflows/build_wheels_macos_m1.yml | 2 ++ travis_config.sh | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index b51801ab..5e60c47d 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -34,6 +34,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -82,6 +83,7 @@ jobs: env: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete diff --git a/travis_config.sh b/travis_config.sh index 366d35ad..042cbd43 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -36,6 +36,11 @@ else echo " > Linux environment " export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.0/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" + if [[ $PLAT == 'aarch64' ]]; then + # To avoid network issues with pypi.org on OpenCV CN machines + export PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple + echo "Running for linux aarch64" + fi fi if [ -n "$IS_OSX" ]; then From 7da6fce0b06e8692f53d828f087e6fe5db61e098 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Tue, 13 Dec 2022 02:09:21 +0300 Subject: [PATCH 228/293] Define arch for all workflows on aarch64 --- travis_config.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 042cbd43..10182f91 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -36,7 +36,8 @@ else echo " > Linux environment " export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.0/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" - if [[ $PLAT == 'aarch64' ]]; then + CURRENT_ARCH=$(uname -m) + if [[ $CURRENT_ARCH == 'aarch64' ]]; then # To avoid network issues with pypi.org on OpenCV CN machines export PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple echo "Running for linux aarch64" From 8f71702978de872efea372fc7ba26452eb92a615 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 5 Dec 2022 14:41:55 +0300 Subject: [PATCH 229/293] Pipelines update for FFmpeg 5 and security fixes. --- .github/workflows/build_wheels_linux.yml | 2 +- .github/workflows/build_wheels_linux_arm.yml | 2 +- .github/workflows/build_wheels_macos.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 4 ++-- docker/manylinux2014/Dockerfile_x86_64 | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index ab377325..ce656ac0 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220824 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20221205 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 079efbe1..3f62a213 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220824 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20221205 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 584520b2..579002cf 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -45,7 +45,7 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 - FFMPEG_FORMULA_VERSION: '@4' + FFMPEG_FORMULA_VERSION: '@5' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 38a7764d..7e02bd60 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20220824 +# Version: 20221205 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -11,7 +11,7 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -ARG ZLIB_VERSION=1.2.12 +ARG ZLIB_VERSION=1.2.13 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 1302e8aa..a6e6b5cc 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20220824 +# Version: 20221205 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -11,7 +11,7 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -ARG ZLIB_VERSION=1.2.12 +ARG ZLIB_VERSION=1.2.13 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH From 4510a683dcb1f63d2dc6a539b3193eeae8f857ab Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 8 Dec 2022 14:18:11 +0300 Subject: [PATCH 230/293] Update OpenCV to upstream version to get FFmpeg 5 fixes. --- .github/workflows/build_wheels_macos.yml | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 579002cf..412bd754 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -45,7 +45,7 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 - FFMPEG_FORMULA_VERSION: '@5' + FFMPEG_FORMULA_VERSION: '' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/opencv b/opencv index b0dc4741..ab912329 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b0dc474160e389b9c9045da5db49d03ae17c6a6b +Subproject commit ab912329b67d3a142a1b399b4bc9fa9b68cd8df6 diff --git a/opencv_contrib b/opencv_contrib index db16caf6..d6102ef6 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit db16caf6ceee76b43b94c846be276e92a43e9700 +Subproject commit d6102ef65f9ccdb37bba0ea9b8254951eb89dc39 diff --git a/opencv_extra b/opencv_extra index 936854e2..531785fb 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 936854e2b666853d6d0732a8eabc2d699f4fa3d8 +Subproject commit 531785fb1a42b2665e0e06c8b191de58db6deb10 From 46f21093f2880f75453458f80613d2230b8e236c Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 9 Dec 2022 13:25:35 +0300 Subject: [PATCH 231/293] Added fonts needed for Qt. --- docker/manylinux2014/Dockerfile_aarch64 | 2 +- docker/manylinux2014/Dockerfile_x86_64 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 7e02bd60..bbb06b72 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -17,7 +17,7 @@ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ - yum install openblas-devel -y && \ + yum install openblas-devel dejavu-sans-fonts -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index a6e6b5cc..89eb353f 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -17,7 +17,7 @@ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ - yum install openblas-devel -y && \ + yum install openblas-devel dejavu-sans-fonts -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source From d780d933772c0532a4d61374b43161aad8a485d6 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 9 Dec 2022 17:39:34 +0300 Subject: [PATCH 232/293] Reverted some changes from 602a8be9e21df225a32827a621f15d7be0e5eebd to use default FFmpeg on Mac --- .github/workflows/build_wheels_macos.yml | 1 - travis_config.sh | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 412bd754..6545902e 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -45,7 +45,6 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 - FFMPEG_FORMULA_VERSION: '' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/travis_config.sh b/travis_config.sh index 10182f91..465baf77 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -56,7 +56,7 @@ if [ -n "$IS_OSX" ]; then function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" - local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}${FFMPEG_FORMULA_VERSION}") + local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" local REGENERATE @@ -76,9 +76,8 @@ if [ -n "$IS_OSX" ]; then if [ -n "$REGENERATE" ]; then echo "Regenerating custom ffmpeg formula" # Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language - # FfmpegAT4 is a class in ffmpeg@4 formula perl -wpe 'BEGIN {our ($found_blank, $bottle_block);} - if (/(^class )(FfmpegAT4)(\s.*)/) {$_=$1."FfmpegOpencv".$3."\n"; next;} + if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1."Opencv".$3."\n"; next;} if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;} if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; } if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; } From 2b57f536e626647d82711e656f55db1c332b0d81 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 15 Dec 2022 12:38:45 +0300 Subject: [PATCH 233/293] Use ffmpeg instead of opencv_ffmpeg everywhere. --- travis_config.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/travis_config.sh b/travis_config.sh index 465baf77..e0ba15e1 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -50,12 +50,12 @@ if [ -n "$IS_OSX" ]; then BREW_SLOW_BUILIDING_PACKAGES=$(printf '%s\n' \ "cmake 15" \ - "ffmpeg_opencv 10" \ + "ffmpeg 10" \ ) function generate_ffmpeg_formula { local FF="ffmpeg" - local LFF="ffmpeg_opencv" + local LFF="ffmpeg" local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" @@ -117,9 +117,9 @@ function pre_build { brew update generate_ffmpeg_formula brew_add_local_bottles - brew install --build-bottle ffmpeg_opencv + brew install --build-bottle ffmpeg # It needs when we use not the latest ffmpeg formula - brew link ffmpeg_opencv + brew link ffmpeg if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0 From 339bca572ecd866b56df1f61214cbf03c5f276f2 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Thu, 29 Dec 2022 21:59:32 +0300 Subject: [PATCH 234/293] OpenCV 4.7.0 release preparation - Python 3.7 as baseline - Python 3.11 support - Various updates --- .github/workflows/build_wheels_linux.yml | 8 ++++---- .github/workflows/build_wheels_linux_arm.yml | 8 ++++---- .github/workflows/build_wheels_macos.yml | 16 +++++++++++----- .github/workflows/build_wheels_macos_m1.yml | 4 ++-- .github/workflows/build_wheels_windows.yml | 8 ++++---- multibuild | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- patch_auditwheel_whitelist.py | 5 +++-- pyproject.toml | 2 +- setup.py | 2 +- travis_config.sh | 6 +++--- 13 files changed, 37 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index ce656ac0..95e35898 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 + NP_TEST_DEP_LATEST: numpy==1.24.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: @@ -106,7 +106,7 @@ jobs: submodules: true fetch-depth: 0 - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 3f62a213..b025e285 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.4 + NP_TEST_DEP_LATEST: numpy==1.24.0 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 @@ -108,7 +108,7 @@ jobs: submodules: true fetch-depth: 0 - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 6545902e..43f98c7f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -58,6 +58,12 @@ jobs: if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi + # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817 + rm /usr/local/bin/2to3* + rm /usr/local/bin/idle3* + rm /usr/local/bin/pydoc3* + rm /usr/local/bin/python3* + # end hack - name: Checkout uses: actions/checkout@v3 with: @@ -100,7 +106,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -109,7 +115,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.4 + NP_TEST_DEP_LATEST: numpy==1.24.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -129,7 +135,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: @@ -146,7 +152,7 @@ jobs: python modules/python/test/test.py -v --repo . - name: Pylint test run: | - python -m pip install pylint==2.12.2 + python -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests python -m pylint $PYLINT_TEST_FILE diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 5e60c47d..8d383088 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -109,7 +109,7 @@ jobs: arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - name: Pylint test run: | - arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 + arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 07bb00cc..b1a98d26 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -67,7 +67,7 @@ jobs: python -m pip install --upgrade setuptools python -m pip install cmake==3.24.2 python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt - set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels uses: actions/upload-artifact@v3 @@ -89,7 +89,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -133,7 +133,7 @@ jobs: python modules\python\test\test.py -v --repo . - name: Pylint test run: | - python -m pip install pylint==2.12.2 + python -m pip install pylint==2.15.9 cd ${{ github.workspace }}\tests python -m pylint $PYLINT_TEST_FILE diff --git a/multibuild b/multibuild index bce1637e..15fd8770 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit bce1637e202cb52b0e7ea42baa1cccc894b82806 +Subproject commit 15fd8770abe6b12e94c2362ae8f21cd876bd998e diff --git a/opencv b/opencv index ab912329..725e440d 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit ab912329b67d3a142a1b399b4bc9fa9b68cd8df6 +Subproject commit 725e440d278aca07d35a5e8963ef990572b07316 diff --git a/opencv_contrib b/opencv_contrib index d6102ef6..e247b680 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit d6102ef65f9ccdb37bba0ea9b8254951eb89dc39 +Subproject commit e247b680a6bd396f110274b6c214406a93171350 diff --git a/opencv_extra b/opencv_extra index 531785fb..5abbd7e0 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 531785fb1a42b2665e0e06c8b191de58db6deb10 +Subproject commit 5abbd7e0546bbb34ae7487170383d3e571fb1dd1 diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index 150f97ca..d1345911 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -12,9 +12,10 @@ def add_zlib_versions(): for line in manylinux_policy_lines: if "ZLIB" in line: if len(line) > 22: - updated_line = line[:-2] + ', "1.2.9", "1.2.12"]' + updated_line = line[:-2] + ', "1.2.9", "1.2.12", "1.2.13"]' else: - updated_line = line[:-2] + '"1.2.9", "1.2.12"]' + updated_line = line[:-2] + '"1.2.9", "1.2.12", "1.2.13"]' + print("auditwheel patch: replace policy line \"%s\" with \"%s\"" % (line, updated_line)) manylinux_policy_replacement = line.replace(line, updated_line) else: manylinux_policy_replacement = line diff --git a/pyproject.toml b/pyproject.toml index 5993a2ac..e30a76fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", diff --git a/setup.py b/setup.py index 39b8b9bd..a5f5fc0e 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def main(): install_requires = [ 'numpy>=1.13.3; python_version<"3.7"', - 'numpy>=1.14.5; python_version>="3.7"', + 'numpy>=1.17.0; python_version>="3.7"', # https://github.com/numpy/numpy/pull/13725 'numpy>=1.17.3; python_version>="3.8"', 'numpy>=1.19.3; python_version>="3.9"', 'numpy>=1.21.2; python_version>="3.10"', diff --git a/travis_config.sh b/travis_config.sh index e0ba15e1..b91d63c4 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -16,7 +16,7 @@ function bdist_wheel_cmd { local abs_wheelhouse=$1 # install all required packages in pyproject.toml, because bdist_wheel does not do it python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin - CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp36 -v + CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp37 -v cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then # this path can be changed in the latest manylinux image @@ -143,7 +143,7 @@ function run_tests { echo "Running for linux" - if [ $PYTHON == "python3.6" ]; then + if [ $PYTHON == "python3.7" ]; then $PYTHON -m pip install -U numpy==1.19.4 fi cd /io/tests @@ -168,7 +168,7 @@ function pylint_test { echo "Starting Pylint tests..." - $PYTHON -m pip install pylint==2.12.2 + $PYTHON -m pip install pylint==2.15.9 cd /io/tests $PYTHON -m pylint /io/opencv/samples/python/squares.py } From e2ba09d23be35e8c36826e7031dd7ef5081f16e9 Mon Sep 17 00:00:00 2001 From: AlexeySalmin Date: Thu, 5 Jan 2023 17:26:10 +0100 Subject: [PATCH 235/293] Fix typo in README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d60fcdf2..bd818bc1 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ A: Make sure you have removed old manual installations of OpenCV Python bindings **Q: Function foo() or method bar() returns wrong result, throws exception or crashes interpreter. What should I do?** -A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check {OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the official OpenCV forum](https://forum.opencv.org/) before file new bugs. +A: The repository contains only OpenCV-Python package build scripts, but not OpenCV itself. Python bindings for OpenCV are developed in official OpenCV repository and it's the best place to report issues. Also please check [OpenCV wiki](https://github.com/opencv/opencv/wiki) and [the official OpenCV forum](https://forum.opencv.org/) before file new bugs. **Q: Why the packages do not include non-free algorithms?** From e33b16b1b3b68ae2853505a1777ca37416c0de35 Mon Sep 17 00:00:00 2001 From: Adam Weeden Date: Wed, 11 Jan 2023 15:40:26 -0500 Subject: [PATCH 236/293] fix: Stop trying to use two different numpy on mac with python >= 3.10 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index e30a76fc..a06416f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,6 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10'", + "numpy==1.21.2; python_version>='3.10' and platform_system!='Darwin''", "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" ] From 736b905a4f61d79d275a4c9bb6efc476cdeaec8e Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Fri, 20 Jan 2023 09:23:55 +0300 Subject: [PATCH 237/293] OpenCV package does not distribute zlib (#780) Roll back to manylinux version to presume binary compatibility. Related changes: https://github.com/opencv/opencv-python/pull/715 Address: - https://github.com/opencv/opencv-python/issues/765 - https://github.com/opencv/opencv-python/issues/772 --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 18 +++------------ docker/manylinux2014/Dockerfile_x86_64 | 18 +++------------ patch_auditwheel_whitelist.py | 23 -------------------- 5 files changed, 9 insertions(+), 56 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 95e35898..6fa602fb 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20221205 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index b025e285..ea5e2bb8 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20221205 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230117 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index bbb06b72..6a298f61 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20221205 +# Version: 20230117 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -11,28 +11,16 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -ARG ZLIB_VERSION=1.2.13 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel dejavu-sans-fonts -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng zlib-devel bzip2-devel -y - -RUN mkdir ~/zlib_sources && \ - cd ~/zlib_sources && \ - curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ - tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ - cd zlib-${ZLIB_VERSION} && \ - ./configure --prefix=/usr/local && \ - make && \ - make install && \ - cd .. && \ - rm -rf ~/zlib_sources + yum remove libpng -y RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 89eb353f..5cc8251c 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20221205 +# Version: 20230117 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -11,28 +11,16 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1s ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -ARG ZLIB_VERSION=1.2.13 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel dejavu-sans-fonts -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng zlib-devel bzip2-devel -y - -RUN mkdir ~/zlib_sources && \ - cd ~/zlib_sources && \ - curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ - tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ - cd zlib-${ZLIB_VERSION} && \ - ./configure --prefix=/usr/local && \ - make && \ - make install && \ - cd .. && \ - rm -rf ~/zlib_sources + yum remove libpng -y RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index d1345911..b396ab55 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -3,27 +3,6 @@ from auditwheel import policy - -def add_zlib_versions(): - with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'r') as manylinux_policy: - manylinux_policy_lines = manylinux_policy.readlines() - - manylinux_policy_data = "" - for line in manylinux_policy_lines: - if "ZLIB" in line: - if len(line) > 22: - updated_line = line[:-2] + ', "1.2.9", "1.2.12", "1.2.13"]' - else: - updated_line = line[:-2] + '"1.2.9", "1.2.12", "1.2.13"]' - print("auditwheel patch: replace policy line \"%s\" with \"%s\"" % (line, updated_line)) - manylinux_policy_replacement = line.replace(line, updated_line) - else: - manylinux_policy_replacement = line - manylinux_policy_data = manylinux_policy_data + manylinux_policy_replacement - - with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'w') as manylinux_final_policy: - manylinux_final_policy.write(manylinux_policy_data) - def add_whitelisted_libs(): policies = None @@ -36,7 +15,5 @@ def add_whitelisted_libs(): with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: f.write(json.dumps(policies)) - if __name__ == '__main__': - add_zlib_versions() add_whitelisted_libs() From 28b8277e4d1be7264b1689bdba71fb3649894cda Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 24 Jan 2023 11:24:54 +0300 Subject: [PATCH 238/293] Typo fix. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a06416f3..fa0c3a32 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,6 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10' and platform_system!='Darwin''", + "numpy==1.21.2; python_version>='3.10' and platform_system!='Darwin'", "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" ] From 876f5e3cc58ef016a88d04a049defd359241b8e5 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 2 Feb 2023 15:04:53 +0300 Subject: [PATCH 239/293] Migrate Mac M1 builds to another host. --- .github/workflows/build_wheels_macos_m1.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 8d383088..2aed7d4b 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: opencv-cn-mac-arm64 + runs-on: python-macos11-m1 strategy: fail-fast: false matrix: From 6e097a876e7a0b2f3968bcc849907c4f96c446a0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 3 Feb 2023 09:38:34 +0300 Subject: [PATCH 240/293] Docs and meta information update for release. --- .github/workflows/build_wheels_macos.yml | 2 +- README.md | 3 ++- setup.py | 5 +++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 43f98c7f..df60217d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -48,7 +48,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - MACOSX_DEPLOYMENT_TARGET: 10.13 + MACOSX_DEPLOYMENT_TARGET: '11.0' steps: - name: Cleanup run: find . -mindepth 1 -delete diff --git a/README.md b/README.md index bd818bc1..78861466 100644 --- a/README.md +++ b/README.md @@ -216,11 +216,11 @@ The default ``manylinux2014`` images have been extended with some OpenCV depende Python 3.x compatible pre-built wheels are provided for the officially supported Python versions (not in EOL): -- 3.6 - 3.7 - 3.8 - 3.9 - 3.10 +- 3.11 ### Backward compatibility @@ -228,3 +228,4 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. +Starting from version 4.7.0 the Mac OS Github Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 diff --git a/setup.py b/setup.py index a5f5fc0e..123bb83a 100644 --- a/setup.py +++ b/setup.py @@ -262,7 +262,7 @@ def main(): name=package_name, version=package_version, url="https://github.com/opencv/opencv-python", - license="MIT", + license="Apache 2.0", description="Wrapper package for OpenCV python bindings.", long_description=long_description, long_description_content_type="text/markdown", @@ -279,7 +279,7 @@ def main(): "Intended Audience :: Education", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", - "License :: OSI Approved :: MIT License", + "License :: OSI Approved :: Apache 2.0", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", @@ -292,6 +292,7 @@ def main(): "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", From 352caf14261e427faf688bc2fe0b7e3d99b88a3f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 7 Feb 2023 10:09:32 +0300 Subject: [PATCH 241/293] Use default deployment target on Mac OS x64. --- .github/workflows/build_wheels_macos.yml | 1 - README.md | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index df60217d..1defd1e5 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -48,7 +48,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - MACOSX_DEPLOYMENT_TARGET: '11.0' steps: - name: Cleanup run: find . -mindepth 1 -delete diff --git a/README.md b/README.md index 78861466..60cdebea 100644 --- a/README.md +++ b/README.md @@ -228,4 +228,4 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. -Starting from version 4.7.0 the Mac OS Github Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 +Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 From 277cab960f6a349744be2f2bffb8155faed538f7 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 20 Feb 2023 10:46:11 +0300 Subject: [PATCH 242/293] Fixed numpy dependency issue with Python 3.11. --- pyproject.toml | 5 +++-- setup.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fa0c3a32..659bbf03 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,6 +8,7 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10' and platform_system!='Darwin'", - "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" + "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", + "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", + "numpy==1.22.0; python_version>='3.11'" ] diff --git a/setup.py b/setup.py index 123bb83a..e0e3ed31 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ def main(): 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', + "numpy>=1.22.0; python_version>='3.11'" ] python_version = cmaker.CMaker.get_python_version() From fdf8fa45bb6e72fac1f54b715a8b288cdbe245cb Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 22 Feb 2023 09:12:40 +0300 Subject: [PATCH 243/293] Renamed license to match Pypi classifier. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e0e3ed31..4e64f230 100644 --- a/setup.py +++ b/setup.py @@ -280,7 +280,7 @@ def main(): "Intended Audience :: Education", "Intended Audience :: Information Technology", "Intended Audience :: Science/Research", - "License :: OSI Approved :: Apache 2.0", + "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", From e10f83dba27433c035c11eab73a9ebd927b54300 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 15 Mar 2023 15:15:20 +0300 Subject: [PATCH 244/293] Handle setup with and without PYTHON3_LIMITED_API. --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 4e64f230..9f43680d 100644 --- a/setup.py +++ b/setup.py @@ -395,8 +395,14 @@ def _classify_installed_files_override( # 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(): From 2a76f21217b48ee1107379bed85bf3849abb1f60 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 26 Apr 2023 12:05:36 +0200 Subject: [PATCH 245/293] py38 build requires: update numpy for compatibility with OpenCV src --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 659bbf03..7d5fa930 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ requires = [ "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From 76e62b2926fdfc1c213770c07d5f50ad9cdf6414 Mon Sep 17 00:00:00 2001 From: Robert Sachunsky Date: Wed, 26 Apr 2023 17:32:53 +0200 Subject: [PATCH 246/293] find_version: use + for git_hash to conform to PEP 440 --- find_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/find_version.py b/find_version.py index 274c93e6..13e8003c 100644 --- a/find_version.py +++ b/find_version.py @@ -65,7 +65,7 @@ else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += ".{}".format(version) + opencv_version += "+{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) From 2e44d30e4c3841ca911d50ca18d10770310719eb Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 27 Apr 2023 11:32:17 -0400 Subject: [PATCH 247/293] fix: handle None case for python library --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9f43680d..0a32520f 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ def main(): ] python_version = cmaker.CMaker.get_python_version() - python_lib_path = cmaker.CMaker.get_python_library(python_version).replace( + python_lib_path = (cmaker.CMaker.get_python_library(python_version) or "").replace( "\\", "/" ) python_include_dir = cmaker.CMaker.get_python_include_dir(python_version).replace( From 46d2ddf7753634ee367a86b89f27835a46c5e284 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Sat, 27 May 2023 18:40:15 +0300 Subject: [PATCH 248/293] Temporary hack to fix build regression with Scikit-build 0.17.3 and newer. --- setup.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 0a32520f..1556207a 100644 --- a/setup.py +++ b/setup.py @@ -36,9 +36,14 @@ def main(): ] python_version = cmaker.CMaker.get_python_version() - python_lib_path = (cmaker.CMaker.get_python_library(python_version) or "").replace( - "\\", "/" - ) + python_lib_path = cmaker.CMaker.get_python_library(python_version) or "" + # HACK: For Scikit-build 0.17.3 and newer that returns None or empty sptring for PYTHON_LIBRARY in manylinux2014 + # A small release related to PYTHON_LIBRARY handling changes in 0.17.2; scikit-build 0.17.3 returns an empty string from get_python_library if no Python library is present (like on manylinux), where 0.17.2 returned None, and previous versions returned a non-existent path. Note that adding REQUIRED to find_package(PythonLibs will fail, but it is incorrect (you must not link to libPython.so) and was really just injecting a non-existent path before. + # TODO: Remove the hack when the issue is handled correctly in main OpenCV CMake. + if python_lib_path == "": + python_lib_path = "libpython%sm.a" % python_version + python_lib_path = python_lib_path.replace("\\", "/") + python_include_dir = cmaker.CMaker.get_python_include_dir(python_version).replace( "\\", "/" ) From ad3e75936fe5a2a04a7fd0f85bf5bbf820c7e605 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 26 May 2023 18:38:27 +0300 Subject: [PATCH 249/293] Force python3 in build procedure to generate python stubs. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 1556207a..26092543 100644 --- a/setup.py +++ b/setup.py @@ -162,6 +162,7 @@ def main(): + [ # skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3 "-DPYTHON3_EXECUTABLE=%s" % sys.executable, + "-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable, "-DPYTHON3_INCLUDE_DIR=%s" % python_include_dir, "-DPYTHON3_LIBRARY=%s" % python_lib_path, "-DBUILD_opencv_python3=ON", From 45e535e34d3dc21cd4b798267bfa94ee7c61e11c Mon Sep 17 00:00:00 2001 From: Tom Sweeting Date: Wed, 31 May 2023 08:28:54 -0400 Subject: [PATCH 250/293] Fix: numpy version for python 3.11 (#839) Fix for issue #835 I encountered the same issue today. By updating to require numpy 1.24.3 I was about to build successfully for my environment (python 3.11.3 / macos ventura arm64 / gstreamer support enabled) --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7d5fa930..4190956f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,5 +10,5 @@ requires = [ "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", - "numpy==1.22.0; python_version>='3.11'" + "numpy==1.23.2; python_version>='3.11'" ] diff --git a/setup.py b/setup.py index 1556207a..85ff1084 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,7 @@ def main(): 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', - "numpy>=1.22.0; python_version>='3.11'" + "numpy>=1.23.5; python_version>='3.11'" ] python_version = cmaker.CMaker.get_python_version() From 3dee384cd4ccaba03f7ff86a21916efb97b4cc67 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 1 Jun 2023 13:49:12 +0300 Subject: [PATCH 251/293] Try to add pyi files to package. --- setup.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/setup.py b/setup.py index 203be547..e4aa1066 100644 --- a/setup.py +++ b/setup.py @@ -129,6 +129,10 @@ def main(): + [ r"python/cv2/.*config.*.py" + ] + + + [ + r"python/cv2/.*\.pyi" ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" From e4da6a05bb3158c44de46425d3b675e9548f3438 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 1 Jun 2023 14:25:58 +0300 Subject: [PATCH 252/293] Update OpenCV to current 4.x to get PR #20370 --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- setup.py | 19 +++++++++++++++---- 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/opencv b/opencv index 725e440d..2104d61d 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 725e440d278aca07d35a5e8963ef990572b07316 +Subproject commit 2104d61d4a3fb363e5c7d29a8d14eac038e2b3b2 diff --git a/opencv_contrib b/opencv_contrib index e247b680..8dfeed73 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit e247b680a6bd396f110274b6c214406a93171350 +Subproject commit 8dfeed73b9389ba09411498dc1e923431d7fe292 diff --git a/opencv_extra b/opencv_extra index 5abbd7e0..847035ec 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 5abbd7e0546bbb34ae7487170383d3e571fb1dd1 +Subproject commit 847035ec7e1d388def99ecee4905fb9b01d1cabf diff --git a/setup.py b/setup.py index e4aa1066..5107e8ea 100644 --- a/setup.py +++ b/setup.py @@ -131,9 +131,8 @@ def main(): r"python/cv2/.*config.*.py" ] + - [ - r"python/cv2/.*\.pyi" - ], + [ 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" ], @@ -396,7 +395,6 @@ def _classify_installed_files_override( 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 = [] @@ -415,6 +413,19 @@ def _classify_installed_files_override( 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: From e26e6e4611b40ea5344e4e4b6e2467539a07a11f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 28 Jun 2023 15:07:08 +0300 Subject: [PATCH 253/293] Build environment update on Linux. --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 10 +++++----- docker/manylinux2014/Dockerfile_x86_64 | 10 +++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 6fa602fb..3176df1a 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230117 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index ea5e2bb8..5a9de23f 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230117 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230628 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 6a298f61..26c45e80 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,14 +1,14 @@ -# Version: 20230117 +# Version: 20230628 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.2 -ARG FREETYPE_VERSION=2.12.1 -ARG LIBPNG_VERSION=1.6.37 +ARG FFMPEG_VERSION=5.1.3 +ARG FREETYPE_VERSION=2.13.1 +ARG LIBPNG_VERSION=1.6.40 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1s +ARG OPENSSL_VERSION=1_1_1u ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 5cc8251c..d34f19f5 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,14 +1,14 @@ -# Version: 20230117 +# Version: 20230628 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.2 -ARG FREETYPE_VERSION=2.12.1 -ARG LIBPNG_VERSION=1.6.37 +ARG FFMPEG_VERSION=5.1.3 +ARG FREETYPE_VERSION=2.13.1 +ARG LIBPNG_VERSION=1.6.40 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1s +ARG OPENSSL_VERSION=1_1_1u ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 From d82d7c2befd1e830287e8c1c125fdab8462836c2 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Tue, 11 Apr 2023 06:17:28 -0700 Subject: [PATCH 254/293] fix: update build system with CMAKE_ARGS from scikit-build --- pyproject.toml | 8 +++++--- setup.py | 9 +-------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4190956f..00176366 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,6 @@ [build-system] requires = [ - "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip", - "scikit-build>=0.13.2", + "cmake>=3.1", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", @@ -10,5 +9,8 @@ requires = [ "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", - "numpy==1.23.2; python_version>='3.11'" + "numpy==1.22.2; python_version>='3.11'", + "pip", + "scikit-build>=0.14.0", + "setuptools==59.2.0", ] diff --git a/setup.py b/setup.py index 5107e8ea..b17c11e6 100644 --- a/setup.py +++ b/setup.py @@ -256,13 +256,6 @@ def main(): cmake_args.append("-DWITH_LAPACK=ON") cmake_args.append("-DENABLE_PRECOMPILED_HEADERS=OFF") - # https://github.com/scikit-build/scikit-build/issues/479 - if "CMAKE_ARGS" in os.environ: - import shlex - - cmake_args.extend(shlex.split(os.environ["CMAKE_ARGS"])) - del shlex - # works via side effect RearrangeCMakeOutput( rearrange_cmake_output_data, files_outside_package_dir, package_data.keys() @@ -314,7 +307,7 @@ def main(): ) -class RearrangeCMakeOutput(object): +class RearrangeCMakeOutput: """ Patch SKBuild logic to only take files related to the Python package and construct a file hierarchy that SKBuild expects (see below) From 49505b9654f70006e4611adc5bf9f4536ba4b4c6 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 29 Jun 2023 18:25:32 +0300 Subject: [PATCH 255/293] OpenCV submodules update to 4.8.0. --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 2104d61d..f9a59f25 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 2104d61d4a3fb363e5c7d29a8d14eac038e2b3b2 +Subproject commit f9a59f2592993d3dcc080e495f4f5e02dd8ec7ef diff --git a/opencv_contrib b/opencv_contrib index 8dfeed73..f10c84d4 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 8dfeed73b9389ba09411498dc1e923431d7fe292 +Subproject commit f10c84d48b0714f2b408c9e5cccfac1277c8e6cc diff --git a/opencv_extra b/opencv_extra index 847035ec..fdd66bfc 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 847035ec7e1d388def99ecee4905fb9b01d1cabf +Subproject commit fdd66bfcc3ced243d682fe03f0858bf43867656c From 7f0002bc450a83336a2b6a37382faf370d1443ee Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 29 Jun 2023 19:24:14 +0300 Subject: [PATCH 256/293] Added more licenses for 3rd party components distributed with opencv-python. --- LICENSE-3RD-PARTY.txt | 581 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 556 insertions(+), 25 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 1478ae56..e64ea511 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -304,7 +304,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -360,7 +360,7 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -407,7 +407,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -465,7 +465,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -516,7 +516,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -578,7 +578,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -619,7 +619,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -671,7 +671,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -893,16 +893,16 @@ are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product +2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. -4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written +4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -1502,8 +1502,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libopenjp2 is redistributed within opencv-python macOS packages. This license applies to libopenjp2 binary in the directory cv2/. -The copyright in this software is being made available under the 2-clauses -BSD License, included below. This software may be subject to other third +The copyright in this software is being made available under the 2-clauses +BSD License, included below. This software may be subject to other third party and contributor rights, including patent rights, and no such rights are granted under this license. @@ -1514,7 +1514,7 @@ Copyright (c) 2003-2009, Francois-Olivier Devaux Copyright (c) 2005, Herve Drolon, FreeImage Team Copyright (c) 2002-2003, Yannick Verschueren Copyright (c) 2001-2003, David Janssens -Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France +Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France Copyright (c) 2012, CS Systemes d'Information, France All rights reserved. @@ -1659,7 +1659,7 @@ This license applies to libspeex binary in the directory cv2/. Copyright 2002-2008 Xiph.org Foundation Copyright 2002-2008 Jean-Marc Valin Copyright 2005-2007 Analog Devices Inc. -Copyright 2005-2008 Commonwealth Scientific and Industrial Research +Copyright 2005-2008 Commonwealth Scientific and Industrial Research Organisation (CSIRO) Copyright 1993, 2002, 2006 David Rowe Copyright 2003 EpicGames @@ -1697,26 +1697,26 @@ libsrt is redistributed within opencv-python macOS packages. This license applies to libsrt binary in the directory cv2/. /* - * + * * Copyright (c) 2001-2017 Cisco Systems, Inc. * All rights reserved. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: - * + * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. - * + * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following * disclaimer in the documentation and/or other materials provided * with the distribution. - * + * * Neither the name of the Cisco Systems, Inc. nor the names of its * contributors may be used to endorse or promote products derived * from this software without specific prior written permission. - * + * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS @@ -1770,7 +1770,7 @@ This license applies to libsrt binary in the directory cv2/. means any form of the work other than Source Code Form. 1.7. "Larger Work" - means a work that combines Covered Software with other material, in + means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" @@ -2141,7 +2141,7 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ------------------------------------------------------------------------------ -libwebp and libwebpmux are redistributed within opencv-python macOS packages. +libwebp and libwebpmux are redistributed within all opencv-python packages. This license applies to libwebp and libwebpmux binaries in the directory cv2/. Copyright (c) 2010, Google Inc. All rights reserved. @@ -2454,3 +2454,534 @@ distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. + +------------------------------------------------------------------------------ +Libjpeg-turbo is redistributed within all opencv-python packages as build option. + +libjpeg-turbo Licenses +====================== + +libjpeg-turbo is covered by three compatible BSD-style open source licenses: + +- The IJG (Independent JPEG Group) License, which is listed in + [README.ijg](README.ijg) + + This license applies to the libjpeg API library and associated programs + (any code inherited from libjpeg, and any modifications to that code.) + +- The Modified (3-clause) BSD License, which is listed below + + This license covers the TurboJPEG API library and associated programs, as + well as the build system. + +- The [zlib License](https://opensource.org/licenses/Zlib) + + This license is a subset of the other two, and it covers the libjpeg-turbo + SIMD extensions. + + +Complying with the libjpeg-turbo Licenses +========================================= + +This section provides a roll-up of the libjpeg-turbo licensing terms, to the +best of our understanding. + +1. If you are distributing a modified version of the libjpeg-turbo source, + then: + + 1. You cannot alter or remove any existing copyright or license notices + from the source. + + **Origin** + - Clause 1 of the IJG License + - Clause 1 of the Modified BSD License + - Clauses 1 and 3 of the zlib License + + 2. You must add your own copyright notice to the header of each source + file you modified, so others can tell that you modified that file (if + there is not an existing copyright header in that file, then you can + simply add a notice stating that you modified the file.) + + **Origin** + - Clause 1 of the IJG License + - Clause 2 of the zlib License + + 3. You must include the IJG README file, and you must not alter any of the + copyright or license text in that file. + + **Origin** + - Clause 1 of the IJG License + +2. If you are distributing only libjpeg-turbo binaries without the source, or + if you are distributing an application that statically links with + libjpeg-turbo, then: + + 1. Your product documentation must include a message stating: + + This software is based in part on the work of the Independent JPEG + Group. + + **Origin** + - Clause 2 of the IJG license + + 2. If your binary distribution includes or uses the TurboJPEG API, then + your product documentation must include the text of the Modified BSD + License (see below.) + + **Origin** + - Clause 2 of the Modified BSD License + +3. You cannot use the name of the IJG or The libjpeg-turbo Project or the + contributors thereof in advertising, publicity, etc. + + **Origin** + - IJG License + - Clause 3 of the Modified BSD License + +4. The IJG and The libjpeg-turbo Project do not warrant libjpeg-turbo to be + free of defects, nor do we accept any liability for undesirable + consequences resulting from your use of the software. + + **Origin** + - IJG License + - Modified BSD License + - zlib License + + +The Modified (3-clause) BSD License +=================================== + +Copyright (C)2009-2022 D. R. Commander. All Rights Reserved.
+Copyright (C)2015 Viktor Szathmáry. All Rights Reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +- Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. +- Neither the name of the libjpeg-turbo Project nor the names of its + contributors may be used to endorse or promote products derived from this + software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS", +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + + +Why Three Licenses? +=================== + +The zlib License could have been used instead of the Modified (3-clause) BSD +License, and since the IJG License effectively subsumes the distribution +conditions of the zlib License, this would have effectively placed +libjpeg-turbo binary distributions under the IJG License. However, the IJG +License specifically refers to the Independent JPEG Group and does not extend +attribution and endorsement protections to other entities. Thus, it was +desirable to choose a license that granted us the same protections for new code +that were granted to the IJG for code derived from their software. + +------------------------------------------------------------------------------ +Libspng is redistributed within all opencv-python packages as build option. + +BSD 2-Clause License + +Copyright (c) 2018-2022, Randy +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +* Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. + +* Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +QUIRC library is redistributed within all opencv-python packages. + +quirc -- QR-code recognition library +Copyright (C) 2010-2012 Daniel Beer + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all +copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE +AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL +DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR +PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +Flatbuffers library is redistributed within all opencv-python packages. + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + +------------------------------------------------------------------------------ +Protobuf library is redistributed within all opencv-python packages. + +Copyright 2008 Google Inc. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above +copyright notice, this list of conditions and the following disclaimer +in the documentation and/or other materials provided with the +distribution. + * Neither the name of Google Inc. nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Code generated by the Protocol Buffer compiler is owned by the owner +of the input file used when generating it. This code is not +standalone and requires a support library to be linked with it. This +support library is itself covered by the above license. + +------------------------------------------------------------------------------ +OpenJPEG library is redistributed within all opencv-python packages. + +/* + * The copyright in this software is being made available under the 2-clauses + * BSD License, included below. This software may be subject to other third + * party and contributor rights, including patent rights, and no such rights + * are granted under this license. + * + * Copyright (c) 2002-2014, Universite catholique de Louvain (UCL), Belgium + * Copyright (c) 2002-2014, Professor Benoit Macq + * Copyright (c) 2003-2014, Antonin Descampe + * Copyright (c) 2003-2009, Francois-Olivier Devaux + * Copyright (c) 2005, Herve Drolon, FreeImage Team + * Copyright (c) 2002-2003, Yannick Verschueren + * Copyright (c) 2001-2003, David Janssens + * Copyright (c) 2011-2012, Centre National d'Etudes Spatiales (CNES), France + * Copyright (c) 2012, CS Systemes d'Information, France + * + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS' + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +------------------------------------------------------------------------------ +TIFF library is redistributed within all opencv-python packages. + +Copyright (c) 1988-1997 Sam Leffler +Copyright (c) 1991-1997 Silicon Graphics, Inc. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, provided +that (i) the above copyright notices and this permission notice appear in +all copies of the software and related documentation, and (ii) the names of +Sam Leffler and Silicon Graphics may not be used in any advertising or +publicity relating to the software without the specific, prior written +permission of Sam Leffler and Silicon Graphics. + +THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, +EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY +WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + +IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR +ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF +LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE +OF THIS SOFTWARE. + +------------------------------------------------------------------------------ +OpenEXR library is redistributed within all opencv-python packages. + +Copyright (c) 2006, Industrial Light & Magic, a division of Lucasfilm +Entertainment Company Ltd. Portions contributed and copyright held by +others as indicated. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above + copyright notice, this list of conditions and the following + disclaimer. + + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with + the distribution. + + * Neither the name of Industrial Light & Magic nor the names of + any other contributors to this software may be used to endorse or + promote products derived from this software without specific prior + written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. From 04bfb4742926498a49cd5d67260b0232b3fc1046 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 29 Jun 2023 22:55:15 +0300 Subject: [PATCH 257/293] Updated wheel location for custom builds. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 60cdebea..95e56be3 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ If some dependency is not enabled in the pre-built wheels, you can also run the 4. Select the package flavor which you wish to build with `ENABLE_CONTRIB` and `ENABLE_HEADLESS`: i.e. `export ENABLE_CONTRIB=1` if you wish to build `opencv-contrib-python` 5. Run ``pip wheel . --verbose``. NOTE: make sure you have the latest ``pip`` version, the ``pip wheel`` command replaces the old ``python setup.py bdist_wheel`` command which does not support ``pyproject.toml``. - this might take anything from 5 minutes to over 2 hours depending on your hardware -6. You'll have the wheel file in the `dist` folder and you can do with that whatever you wish +6. Pip will print fresh will location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish. - Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build - Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability From 921bae43ba3fcbc8ae86fada2eb3550df69cda5b Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 5 Jul 2023 10:43:15 +0300 Subject: [PATCH 258/293] Added missing typing/__init__.py to package. --- setup.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/setup.py b/setup.py index b17c11e6..f6056969 100644 --- a/setup.py +++ b/setup.py @@ -150,6 +150,9 @@ def main(): ], } + if sys.version_info >= (3, 6): + rearrange_cmake_output_data["cv2.typing"] = ["python/cv2" + r"/typing/.*\.py"] + # Files in sourcetree outside package dir that should be copied to package. # Raw paths relative to sourcetree root. files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} From 5308d0bf5274e07fe306fba411db265341cd0248 Mon Sep 17 00:00:00 2001 From: Nicholas Nadeau Date: Mon, 7 Aug 2023 13:16:30 -0400 Subject: [PATCH 259/293] docs: added TOC to README for easier navigation --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 95e56be3..771fa3dc 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ [![Downloads](http://pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) +- [OpenCV on Wheels](#opencv-on-wheels) + - [Installation and Usage](#installation-and-usage) +- [Frequently Asked Questions](#frequently-asked-questions) +- [Documentation for opencv-python](#documentation-for-opencv-python) + - [CI build process](#ci-build-process) + - [Manual builds](#manual-builds) + - [Manual debug builds](#manual-debug-builds) + - [Source distributions](#source-distributions) + - [Licensing](#licensing) + - [Versioning](#versioning) + - [Releases](#releases) + - [Development builds](#development-builds) + - [Manylinux wheels](#manylinux-wheels) + - [Supported Python versions](#supported-python-versions) + - [Backward compatibility](#backward-compatibility) + ## OpenCV on Wheels Pre-built CPU-only OpenCV packages for Python. From ca13925ac4f6536cca3edcb7bdd525bdc09d5f58 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 27 Sep 2023 15:29:32 +0300 Subject: [PATCH 260/293] Update to OpenCV 4.8.1. --- opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencv b/opencv index f9a59f25..51998500 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit f9a59f2592993d3dcc080e495f4f5e02dd8ec7ef +Subproject commit 5199850039ad23f1f0e6cccea5061a9fea5efca6 From 44939451722fd28f4ecd874d306dc0cd71d15517 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 12 Oct 2023 11:57:06 +0300 Subject: [PATCH 261/293] Docker images update for Python 3.12 and security fixes. --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 11 ++++++----- docker/manylinux2014/Dockerfile_x86_64 | 6 +++--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 3176df1a..0bfb6ba3 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231006 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231006 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 5a9de23f..0db992cc 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231006 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 26c45e80..dc4909f3 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,14 +1,14 @@ -# Version: 20230628 +# Version: 20231006 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=5.1.3 -ARG FREETYPE_VERSION=2.13.1 +ARG FREETYPE_VERSION=2.13.2 ARG LIBPNG_VERSION=1.6.40 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1u +ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 @@ -33,9 +33,10 @@ RUN mkdir ~/libpng_sources && \ cd .. && \ rm -rf ~/libpng_sources +# looks like download.savannah.gnu.org suffers from https://savannah.gnu.org/bugs/?48150 in Manylinux 2014 env on aarch64 RUN mkdir ~/freetype_sources && \ cd ~/freetype_sources && \ - curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + curl -O -L https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ cd freetype-${FREETYPE_VERSION} && \ ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \ @@ -44,7 +45,7 @@ RUN mkdir ~/freetype_sources && \ cd .. && \ rm -rf ~/freetype_sources -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ +RUN curl -C - -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index d34f19f5..9fd6f0fb 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,14 +1,14 @@ -# Version: 20230628 +# Version: 20231006 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=5.1.3 -ARG FREETYPE_VERSION=2.13.1 +ARG FREETYPE_VERSION=2.13.2 ARG LIBPNG_VERSION=1.6.40 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1u +ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 From c9145d909193ad3b06b5d300be1e97bd7bb34acf Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Wed, 18 Oct 2023 15:32:00 +0300 Subject: [PATCH 262/293] Update downloads badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 771fa3dc..0984e421 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Downloads](http://pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) +[![Downloads](https://static.pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) - [OpenCV on Wheels](#opencv-on-wheels) - [Installation and Usage](#installation-and-usage) From 98573cebac8fd08b55d95041fcd9bb77fbe621ce Mon Sep 17 00:00:00 2001 From: Dmitry Kurtaev Date: Sat, 9 Dec 2023 10:55:25 +0300 Subject: [PATCH 263/293] Change setup.py to trigger GitHub show dependents --- setup.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index f6056969..78998a03 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,7 @@ import re import sysconfig import platform -import skbuild -from skbuild import cmaker +from skbuild import cmaker, setup def main(): @@ -264,7 +263,7 @@ def main(): rearrange_cmake_output_data, files_outside_package_dir, package_data.keys() ) - skbuild.setup( + setup( name=package_name, version=package_version, url="https://github.com/opencv/opencv-python", From 0da732e80d492c61170ee43ea76c74bf265bce24 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 3 Oct 2023 13:41:12 +0300 Subject: [PATCH 264/293] Python 3.12 support. --- .github/workflows/build_wheels_linux.yml | 6 +++--- .github/workflows/build_wheels_linux_arm.yml | 8 ++++---- .github/workflows/build_wheels_macos.yml | 6 +++--- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- docker/manylinux2014/Dockerfile_x86_64 | 2 +- multibuild | 2 +- setup.py | 4 +++- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 0bfb6ba3..b880c1f7 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: @@ -106,7 +106,7 @@ jobs: submodules: true fetch-depth: 0 - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 0db992cc..7edb0c91 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231006 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231109 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.0 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 @@ -108,7 +108,7 @@ jobs: submodules: true fetch-depth: 0 - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1defd1e5..d40c4697 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -105,7 +105,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,7 +114,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -134,7 +134,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2aed7d4b..5d638fd8 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b1a98d26..19470a5d 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 9fd6f0fb..9233bffa 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20231006 +# Version: 20231109 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest diff --git a/multibuild b/multibuild index 15fd8770..0714f52e 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 15fd8770abe6b12e94c2362ae8f21cd876bd998e +Subproject commit 0714f52ea1ea57a0bc33c7f8b74bae457e1fa8e0 diff --git a/setup.py b/setup.py index f6056969..d8e3c920 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,8 @@ def main(): 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', - "numpy>=1.23.5; python_version>='3.11'" + "numpy>=1.23.5; python_version>='3.11'", + "numpy>=1.26.0; python_version>='3.12'" ] python_version = cmaker.CMaker.get_python_version() @@ -299,6 +300,7 @@ def main(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", From 984ff7378a3132c35cc52f24645c31f6cd00cac0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 21 Dec 2023 13:17:01 +0300 Subject: [PATCH 265/293] Include Intel IPP license text to 3rd party licenses list. --- LICENSE-3RD-PARTY.txt | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index e64ea511..f7d91a4f 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -2985,3 +2985,81 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +Intel(R) IPP ICV library statically linked within x86 and x86_64 opencv-python packages. + +Intel(R) Integrated Performance Primitives 2021 Update 10 + +Intel Simplified Software License (Version October 2022) + +Intel(R) Integrated Performance Primitives (Intel(R) IPP) : Copyright (C) 1997 Intel Corporation + +Use and Redistribution. You may use and redistribute the software, which is +provided in binary form only, (the "Software"), without modification, +provided the following conditions are met: + +* Redistributions must reproduce the above copyright notice and these + terms of use in the Software and in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel nor the names of its suppliers may be used to + endorse or promote products derived from this Software without specific + prior written permission. +* No reverse engineering, decompilation, or disassembly of the Software is + permitted, nor any modification or alteration of the Software or its operation + at any time, including during execution. + +No other licenses. Except as provided in the preceding section, Intel grants no +licenses or other rights by implication, estoppel or otherwise to, patent, +copyright, trademark, trade name, service mark or other intellectual property +licenses or rights of Intel. + +Third party software. "Third Party Software" means the files (if any) listed +in the "third-party-software.txt" or other similarly-named text file that may +be included with the Software. Third Party Software, even if included with the +distribution of the Software, may be governed by separate license terms, including +without limitation, third party license terms, open source software notices and +terms, and/or other Intel software license terms. These separate license terms +solely govern Your use of the Third Party Software. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE +DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS +WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE +THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND +ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT +INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE. + +LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +No support. Intel may make changes to the Software, at any time without notice, +and is not obligated to support, update or provide training for the Software. + +Termination. Your right to use the Software is terminated in the event of your +breach of this license. + +Feedback. Should you provide Intel with comments, modifications, corrections, +enhancements or other input ("Feedback") related to the Software, Intel will be +free to use, disclose, reproduce, license or otherwise distribute or exploit the +Feedback in its sole discretion without any obligations or restrictions of any +kind, including without limitation, intellectual property rights or licensing +obligations. + +Compliance with laws. You agree to comply with all relevant laws and regulations +governing your use, transfer, import or export (or prohibition thereof) of the +Software. + +Governing law. All disputes will be governed by the laws of the United States of +America and the State of Delaware without reference to conflict of law +principles and subject to the exclusive jurisdiction of the state or federal +courts sitting in the State of Delaware, and each party agrees that it submits +to the personal jurisdiction and venue of those courts and waives any +objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL +SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE. From f5c47b367e3f0e3d1546c8192aae21c6ae52a73d Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 25 Dec 2023 16:18:41 +0300 Subject: [PATCH 266/293] Linux environment update for release 4.9.0 Fixes https://github.com/opencv/opencv-python/issues/926 - FFmpeg update to 5.1.4. - Stick to lates vpx release 1.13.1 with security fixes. --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 7 ++++--- docker/manylinux2014/Dockerfile_i686 | 4 ++-- docker/manylinux2014/Dockerfile_x86_64 | 7 ++++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index b880c1f7..45a38d06 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231006 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231225 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231006 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231225 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 7edb0c91..6371e360 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231109 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231225 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index dc4909f3..196c97bb 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,12 +1,13 @@ -# Version: 20231006 +# Version: 20231225 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.3 +ARG FFMPEG_VERSION=5.1.4 ARG FREETYPE_VERSION=2.13.2 ARG LIBPNG_VERSION=1.6.40 +ARG VPX_VERSION=v1.13.1 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 @@ -93,7 +94,7 @@ RUN mkdir ~/yasm_sources && \ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ - git clone --depth 1 https://github.com/webmproject/libvpx.git && \ + git clone --depth 1 -b ${VPX_VERSION} https://github.com/webmproject/libvpx.git && \ cd libvpx && \ ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index c11f6a4d..1c94b1fc 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -2,9 +2,9 @@ FROM quay.io/pypa/manylinux2014_i686:latest ARG CCACHE_VERSION=3.7.9 ARG CMAKE_VERSION=3.17.0 -ARG FFMPEG_VERSION=5.1.2 +ARG FFMPEG_VERSION=5.1.4 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1s +ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 9233bffa..ac28b689 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,12 +1,13 @@ -# Version: 20231109 +# Version: 20231225 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.3 +ARG FFMPEG_VERSION=5.1.4 ARG FREETYPE_VERSION=2.13.2 ARG LIBPNG_VERSION=1.6.40 +ARG VPX_VERSION=v1.13.1 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 @@ -92,7 +93,7 @@ RUN mkdir ~/yasm_sources && \ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ From e7a86f982713d565c211f6059d52d5f200d97813 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 26 Dec 2023 18:44:55 +0300 Subject: [PATCH 267/293] Use native Mac M1 Github Runner for the configuration. --- .github/workflows/build_wheels_macos_m1.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 5d638fd8..85f42fb9 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -55,8 +55,8 @@ jobs: echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled export MACOSX_DEPLOYMENT_TARGET=11.0 - arch -arm64 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin - arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v + python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin + python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving all wheels uses: actions/upload-artifact@v3 @@ -100,18 +100,18 @@ jobs: path: wheelhouse/ - name: Package installation run: | - arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl + python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests - arch -arm64 python${{ matrix.python-version }} get_build_info.py + python${{ matrix.python-version }} get_build_info.py - name: Run tests run: | cd ${{ github.workspace }}/opencv - arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - name: Pylint test run: | - arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.15.9 + python${{ matrix.python-version }} -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests - arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE + python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} From 1e1b0ca86ffcbeb9261378707279c4a116381f3b Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 26 Dec 2023 21:23:09 +0300 Subject: [PATCH 268/293] Migrate Mac OS Intel to OSX 12. --- .github/workflows/build_wheels_macos.yml | 4 ++-- travis_osx_brew_cache.sh | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index d40c4697..dd3bc654 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: macos-11 + runs-on: macos-12 defaults: run: shell: bash @@ -98,7 +98,7 @@ jobs: Test: needs: [Build] - runs-on: macos-11 + runs-on: macos-12 defaults: run: shell: bash diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 1a2a1c6c..42e71446 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -265,14 +265,14 @@ function _brew_parse_bottle_json { local JSON; JSON="${1:?}"; shift - local JSON_DATA; JSON_DATA=$(python2.7 -c 'if True: + local JSON_DATA; JSON_DATA=$(python3 -c 'if True: import sys,json; j=json.load(open(sys.argv[1],"rb")); [name]=j.keys(); [pdata]=j.values() - print name - print pdata["formula"]["pkg_version"] - print pdata["bottle"]["rebuild"] + print(name) + print(pdata["formula"]["pkg_version"]) + print(pdata["bottle"]["rebuild"]) [(tag_name, tag_dict)]=pdata["bottle"]["tags"].items() - print tag_name - print tag_dict["sha256"] + print(tag_name) + print(tag_dict["sha256"]) ' "$JSON") unset JSON @@ -292,15 +292,15 @@ function _brew_parse_package_info { PACKAGE="${1:?}"; shift OS_CODENAME="${1:?}"; shift - local JSON_DATA; JSON_DATA=$(python2.7 -c 'if True: + local JSON_DATA; JSON_DATA=$(python3 -c 'if True: import sys, json, subprocess; j=json.loads(subprocess.check_output(("brew","info","--json=v1",sys.argv[1]))) data=j[0] revision=data["revision"] # in bottle''s json, revision is included into version; here, they are separate - print data["versions"]["stable"]+("_"+str(revision) if revision else "") + print(data["versions"]["stable"]+("_"+str(revision) if revision else "")) bottle_data=data["bottle"].get("stable",{"rebuild":"","files":{}}) - print bottle_data["rebuild"] - print bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"] #prevent losing trailing blank line to command substitution + print(bottle_data["rebuild"]) + print(bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"]) #prevent losing trailing blank line to command substitution ' \ "$PACKAGE" "$OS_CODENAME"); JSON_DATA="${JSON_DATA%\!\?}" #!? can't occur in a hash From 042e0e04a5e39ddfc6582d13787269916a3f4c06 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 27 Dec 2023 13:35:35 +0300 Subject: [PATCH 269/293] Submodules update to tag 4.9.0. --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 51998500..dad8af6b 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 5199850039ad23f1f0e6cccea5061a9fea5efca6 +Subproject commit dad8af6b17f8e60d7b95a1203a1b4d22f56574cf diff --git a/opencv_contrib b/opencv_contrib index f10c84d4..c7602a8f 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f10c84d48b0714f2b408c9e5cccfac1277c8e6cc +Subproject commit c7602a8f74205e44389bd6a4e8d727d32e7e27b4 diff --git a/opencv_extra b/opencv_extra index fdd66bfc..7f0ba7ad 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit fdd66bfcc3ced243d682fe03f0858bf43867656c +Subproject commit 7f0ba7adefcbbbe3df7d939f5246ba0382c7c629 From eaa9512a04c8f1c1f7aeb9f093fa948d3542561b Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 29 Dec 2023 13:53:52 +0300 Subject: [PATCH 270/293] Added donation notification. --- README.md | 4 ++++ setup.py | 1 + 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 0984e421..514143c6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ [![Downloads](https://static.pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) +### Keep OpenCV Free + +OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. [Donate to OpenCV on IndieGoGo](http://igg.me/at/opencv5) to show your support. + - [OpenCV on Wheels](#opencv-on-wheels) - [Installation and Usage](#installation-and-usage) - [Frequently Asked Questions](#frequently-asked-questions) diff --git a/setup.py b/setup.py index 907e3329..766b4bb4 100644 --- a/setup.py +++ b/setup.py @@ -310,6 +310,7 @@ def main(): cmake_source_dir=cmake_source_dir, ) + print("OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. Donate to OpenCV on IndieGoGo:\nhttps://www.indiegogo.com/projects/opencv-5-support-non-profit-open-source-cv-ai#/") class RearrangeCMakeOutput: """ From 080da76b1534607cb648b07a6dd5df30beb61f8d Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 29 Dec 2023 14:03:50 +0300 Subject: [PATCH 271/293] Run Python test on Mac M1 in virtual environment to prevent "error: externally-managed-environment". --- .github/workflows/build_wheels_macos_m1.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 85f42fb9..4f1f214c 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -98,17 +98,24 @@ jobs: with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ + - name: Create Venv for test + run: | + test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test" + python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test - name: Package installation run: | - python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl + source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests python${{ matrix.python-version }} get_build_info.py - name: Run tests run: | + source ${{ github.workspace }}/opencv_test/bin/activate cd ${{ github.workspace }}/opencv python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - name: Pylint test run: | + source ${{ github.workspace }}/opencv_test/bin/activate python${{ matrix.python-version }} -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE From 949b65ea40f5141bdf46f738f7751a16d6309e04 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Sat, 30 Dec 2023 13:13:41 +0300 Subject: [PATCH 272/293] Upgrade pip on Mac M1 before package installation. --- .github/workflows/build_wheels_macos_m1.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 4f1f214c..f0e41d3a 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -105,6 +105,7 @@ jobs: - name: Package installation run: | source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install --upgrade pip python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests python${{ matrix.python-version }} get_build_info.py From fcf02c69070c7b6ee58ceef00e6a54ca8f0e1bc0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Sun, 31 Dec 2023 11:09:48 +0300 Subject: [PATCH 273/293] Readme update for 4.9.0. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 514143c6..7f1e3a4c 100644 --- a/README.md +++ b/README.md @@ -241,6 +241,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.9 - 3.10 - 3.11 +- 3.12 ### Backward compatibility @@ -249,3 +250,5 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 + +Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support depricated by Brew and most of used packages. From ebd0aee2004dc4e53a2c8b8b70231c718b313769 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 21 May 2024 09:49:15 +0300 Subject: [PATCH 274/293] Use Github sponsor link. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f1e3a4c..aa19f439 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ### Keep OpenCV Free -OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. [Donate to OpenCV on IndieGoGo](http://igg.me/at/opencv5) to show your support. +OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. [Donate to OpenCV on Github](https://github.com/sponsors/opencv) to show your support. - [OpenCV on Wheels](#opencv-on-wheels) - [Installation and Usage](#installation-and-usage) From 542cf06b308cdcf3d5e0a32e33482fe6b22997d6 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Thu, 30 May 2024 15:46:29 +0300 Subject: [PATCH 275/293] Dependencies update for 4.10.0 release. (#984) * Dependences update for 4.10 release. * Updated docker tags. * New docker tags in pipelines. * Fixed Qt version. * Added QT to LD_LIBRARY_PATH --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 12 ++++++------ docker/manylinux2014/Dockerfile_x86_64 | 12 ++++++------ patches/patchQtPlugins | 2 +- travis_config.sh | 2 +- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 45a38d06..0e202f63 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231225 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20231225 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 6371e360..4c1fc48e 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231225 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20240524 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 196c97bb..e19492ff 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20231225 +# Version: 20240524 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -6,11 +6,11 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=5.1.4 ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.40 -ARG VPX_VERSION=v1.13.1 +ARG LIBPNG_VERSION=1.6.43 +ARG VPX_VERSION=v1.14.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.0 +ARG QT_VERSION=5.15.13 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -46,8 +46,8 @@ RUN mkdir ~/freetype_sources && \ cd .. && \ rm -rf ~/freetype_sources -RUN curl -C - -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ - tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ +RUN curl -C - -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index ac28b689..eceae25e 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20231225 +# Version: 20240524 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -6,11 +6,11 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=5.1.4 ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.40 -ARG VPX_VERSION=v1.13.1 +ARG LIBPNG_VERSION=1.6.43 +ARG VPX_VERSION=v1.14.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.0 +ARG QT_VERSION=5.15.13 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -45,8 +45,8 @@ RUN mkdir ~/freetype_sources && \ cd .. && \ rm -rf ~/freetype_sources -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ - tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ +RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index a05a5f83..70c6975a 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() + if(UNIX AND NOT APPLE) -+ install(DIRECTORY /opt/Qt5.15.0/plugins DESTINATION lib/qt) ++ install(DIRECTORY /opt/Qt5.15.13/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() if(HAVE_QT_OPENGL) diff --git a/travis_config.sh b/travis_config.sh index b91d63c4..903ceafb 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -34,7 +34,7 @@ if [ -n "$IS_OSX" ]; then export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" else echo " > Linux environment " - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.0/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.13/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then From d261ecbd0f4f937dc9cf99ef37be8278534e370e Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 3 Jun 2024 11:14:10 +0300 Subject: [PATCH 276/293] Added license text for OrbbecSDK needed on MacOS ARM64. --- LICENSE-3RD-PARTY.txt | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index f7d91a4f..0462eee3 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -3063,3 +3063,28 @@ courts sitting in the State of Delaware, and each party agrees that it submits to the personal jurisdiction and venue of those courts and waives any objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE. + +------------------------------------------------------------------------------ +Orbbec SDK distributed with arm64 MacOS packages. + +MIT License + +Copyright (c) 2023 OrbbecDeveloper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 63eed93e6d372795f6b6ca3d90c5d9cefc1b5a77 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:28:02 +0300 Subject: [PATCH 277/293] Update submodules to 4.10.0-pre for testing. (#990) * Submodules update to tag 4.10.0. * Update donation link. * Use 4 digits in OpenCV version since 4.10.0 * Add OrbbecSDK library to package for MacOS ARM. It's aways enabled during library build. --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- setup.py | 10 ++++++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/opencv b/opencv index dad8af6b..71d3237a 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit dad8af6b17f8e60d7b95a1203a1b4d22f56574cf +Subproject commit 71d3237a093b60a27601c20e9ee6c3e52154e8b1 diff --git a/opencv_contrib b/opencv_contrib index c7602a8f..1ed3dd2c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit c7602a8f74205e44389bd6a4e8d727d32e7e27b4 +Subproject commit 1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87 diff --git a/opencv_extra b/opencv_extra index 7f0ba7ad..dd1fbd07 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 7f0ba7adefcbbbe3df7d939f5246ba0382c7c629 +Subproject commit dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f diff --git a/setup.py b/setup.py index 766b4bb4..48d5a65f 100644 --- a/setup.py +++ b/setup.py @@ -110,11 +110,17 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if is64 else "")] + [r"bin/opencv_videoio_ffmpeg\d{4}%s\.dll" % ("_64" if is64 else "")] if os.name == "nt" else [] ) + + ( + [r"lib/libOrbbecSDK.dylib", r"lib/libOrbbecSDK.\d.\d.dylib", r"lib/libOrbbecSDK.\d.\d.\d.dylib"] + if platform.system() == "Darwin" and platform.machine() == "arm64" + else [] + ) + + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. @@ -310,7 +316,7 @@ def main(): cmake_source_dir=cmake_source_dir, ) - print("OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. Donate to OpenCV on IndieGoGo:\nhttps://www.indiegogo.com/projects/opencv-5-support-non-profit-open-source-cv-ai#/") + print("OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. Donate to OpenCV on GitHub:\nhttps://github.com/sponsors/opencv\n") class RearrangeCMakeOutput: """ From 512209a631c9e4a3b10b17d853de31a89c449612 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 3 Jun 2024 15:38:59 +0300 Subject: [PATCH 278/293] Update Numpy requirements in the project. --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 00176366..7486f132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,8 @@ requires = [ "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", - "numpy==1.22.2; python_version>='3.11'", + "numpy==1.23.5; python_version=='3.11'", + "numpy>=1.26.4; python_version>='3.12'", "pip", "scikit-build>=0.14.0", "setuptools==59.2.0", From 00e120989b55ba1734db211766344e0237dbd477 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 17 Jun 2024 12:09:37 +0300 Subject: [PATCH 279/293] Alternative solution to use Numpy 2.0 for Python 3.9+ packages. --- .github/workflows/build_wheels_linux.yml | 4 ++-- .github/workflows/build_wheels_linux_arm.yml | 4 ++-- .github/workflows/build_wheels_macos.yml | 4 ++-- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- pyproject.toml | 10 +++------- 6 files changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 0e202f63..746395e4 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.26.0 + NP_TEST_DEP_LATEST: numpy==2.0.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 4c1fc48e..928ded7d 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.26.0 + NP_TEST_DEP_LATEST: numpy==2.0.0 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index dd3bc654..97df456e 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,7 +114,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.26.0 + NP_TEST_DEP_LATEST: numpy==2.0.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index f0e41d3a..a3bcac63 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -24,7 +24,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 19470a5d..d69f17ec 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/pyproject.toml b/pyproject.toml index 7486f132..71de7f9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,9 @@ requires = [ "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", - "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", - "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", - "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", - "numpy==1.23.5; python_version=='3.11'", - "numpy>=1.26.4; python_version>='3.12'", + "numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", + "numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", + "numpy>=2.0.0; python_version>='3.9'", "pip", "scikit-build>=0.14.0", "setuptools==59.2.0", From 92204bda0e8cca6a8e76aa25005ca7af5d220131 Mon Sep 17 00:00:00 2001 From: Lukas Hennies <45569834+Gornoka@users.noreply.github.com> Date: Tue, 16 Jul 2024 16:40:52 +0200 Subject: [PATCH 280/293] chore: minor text fixes in readme found typo while waiting for clone, maybe it saves someone else 2s of confusion. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index aa19f439..03396b56 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ If some dependency is not enabled in the pre-built wheels, you can also run the 4. Select the package flavor which you wish to build with `ENABLE_CONTRIB` and `ENABLE_HEADLESS`: i.e. `export ENABLE_CONTRIB=1` if you wish to build `opencv-contrib-python` 5. Run ``pip wheel . --verbose``. NOTE: make sure you have the latest ``pip`` version, the ``pip wheel`` command replaces the old ``python setup.py bdist_wheel`` command which does not support ``pyproject.toml``. - this might take anything from 5 minutes to over 2 hours depending on your hardware -6. Pip will print fresh will location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish. +6. Pip will print fresh wheel location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish. - Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build - Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability From f9577797693ad3750d0fab0330b044b249068653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Artificial=E6=9B=BE=E5=B0=8F=E5=81=A5?= <875100501@qq.com> Date: Sun, 11 Aug 2024 23:17:32 +0800 Subject: [PATCH 281/293] fix fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 03396b56..3a4b46c2 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,6 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. -Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 +Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support deprecated. See https://github.com/actions/runner-images/issues/5583 -Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support depricated by Brew and most of used packages. +Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support deprecated by Brew and most of used packages. From ec3604aae5cd0bee4b05dbf102dc3956728b4eff Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:39:28 +0300 Subject: [PATCH 282/293] Revert "5.x merge 4.x and submodules update" --- .gitmodules | 3 --- find_version.py | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index 99476363..7193d3b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,12 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git - branch = 5.x [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git - branch = 5.x [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git - branch = 5.x diff --git a/find_version.py b/find_version.py index 274c93e6..13e8003c 100644 --- a/find_version.py +++ b/find_version.py @@ -65,7 +65,7 @@ else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += ".{}".format(version) + opencv_version += "+{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) diff --git a/opencv b/opencv index b31bc1a2..71d3237a 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b31bc1a2954e22d87f8384212c5e3dfbe7024f16 +Subproject commit 71d3237a093b60a27601c20e9ee6c3e52154e8b1 diff --git a/opencv_contrib b/opencv_contrib index f7d6288a..1ed3dd2c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f7d6288aeb38ff1b8af70ecf50a98258e8cd1bef +Subproject commit 1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87 diff --git a/opencv_extra b/opencv_extra index 0e3b933a..dd1fbd07 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 0e3b933aa762b28b54a40034c58f8c734f1ed759 +Subproject commit dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f diff --git a/pyproject.toml b/pyproject.toml index 270a25d1..71de7f9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "cmake>=3.13", + "cmake>=3.1", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index edf813b4..48d5a65f 100644 --- a/setup.py +++ b/setup.py @@ -140,7 +140,7 @@ def main(): [ 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/opencv5") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 3f50d3281f82d1c6733bbb2872adacca29995e12 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:07:30 +0300 Subject: [PATCH 283/293] Linux dependencies update (#1052) * Base manylinux2014 image update. * Use command line git to checkout repo instead of actions step. * Qt and others update. * Updated submodules to current 4.x branch. --- .github/workflows/build_wheels_linux.yml | 28 ++++++++++---------- .github/workflows/build_wheels_linux_arm.yml | 18 ++++++------- docker/manylinux2014/Dockerfile_aarch64 | 12 ++++----- docker/manylinux2014/Dockerfile_x86_64 | 12 ++++----- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- patches/patchQtPlugins | 2 +- travis_config.sh | 2 +- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 746395e4..9df69240 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -101,10 +101,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -155,10 +155,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 928ded7d..bd5c0040 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20241202 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -103,10 +103,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index e19492ff..9a8bfdde 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,16 +1,16 @@ -# Version: 20240524 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.4 -ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.43 -ARG VPX_VERSION=v1.14.0 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.13 +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index eceae25e..088d8df5 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,16 +1,16 @@ -# Version: 20240524 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.4 -ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.43 -ARG VPX_VERSION=v1.14.0 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.13 +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/opencv b/opencv index 71d3237a..03cedee0 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 71d3237a093b60a27601c20e9ee6c3e52154e8b1 +Subproject commit 03cedee0b0258875eafd1576b59d686ba805da7a diff --git a/opencv_contrib b/opencv_contrib index 1ed3dd2c..67337620 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87 +Subproject commit 673376203b0a8371a31ec5e8f08910a9744c0f32 diff --git a/opencv_extra b/opencv_extra index dd1fbd07..08fe33c7 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f +Subproject commit 08fe33c733cabec70ffb6e5eac49708b073e5277 diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index 70c6975a..b274aa08 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() + if(UNIX AND NOT APPLE) -+ install(DIRECTORY /opt/Qt5.15.13/plugins DESTINATION lib/qt) ++ install(DIRECTORY /opt/Qt5.15.16/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() if(HAVE_QT_OPENGL) diff --git a/travis_config.sh b/travis_config.sh index 903ceafb..fcdd4f60 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -34,7 +34,7 @@ if [ -n "$IS_OSX" ]; then export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" else echo " > Linux environment " - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.13/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.16/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then From b12aea12d288351b542a83d98333a35c95eb1dea Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 4 Dec 2024 11:10:09 +0300 Subject: [PATCH 284/293] Try to update to macos-13 to fix home brew dependencies. --- .github/workflows/build_wheels_macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 97df456e..6940cc55 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: macos-12 + runs-on: macos-13 defaults: run: shell: bash @@ -98,7 +98,7 @@ jobs: Test: needs: [Build] - runs-on: macos-12 + runs-on: macos-13 defaults: run: shell: bash From d23e79634dc0f6014b6b879d80626dd993a87705 Mon Sep 17 00:00:00 2001 From: Bill Clark Date: Thu, 12 Dec 2024 11:26:20 -0500 Subject: [PATCH 285/293] Update pyproject.toml Attempting to get building on 3.12 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 71de7f9b..10201b8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,5 +9,6 @@ requires = [ "numpy>=2.0.0; python_version>='3.9'", "pip", "scikit-build>=0.14.0", - "setuptools==59.2.0", + "setuptools==59.2.0; python_version<'3.12'", + "setuptools<70.0.0; python_version>='3.12'", ] From ae90ee753908ae55fd3045719408441c6b18af67 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 24 Dec 2024 09:00:35 +0300 Subject: [PATCH 286/293] Submodules update to 4.11.0-pre --- .github/workflows/build_wheels_macos_m1.yml | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- setup.py | 6 ------ 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a3bcac63..dd119fcb 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: python-macos11-m1 + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: diff --git a/opencv b/opencv index 03cedee0..b42075f3 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 03cedee0b0258875eafd1576b59d686ba805da7a +Subproject commit b42075f3e2c7eca4a12e55b32cfc95fa90982a21 diff --git a/opencv_contrib b/opencv_contrib index 67337620..3e776c87 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 673376203b0a8371a31ec5e8f08910a9744c0f32 +Subproject commit 3e776c876ef8527ad639d2c792521b6cede291e5 diff --git a/opencv_extra b/opencv_extra index 08fe33c7..a74cf6ba 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 08fe33c733cabec70ffb6e5eac49708b073e5277 +Subproject commit a74cf6bae7fd75d91282b877c559168b3a62148a diff --git a/setup.py b/setup.py index 48d5a65f..fd4181d0 100644 --- a/setup.py +++ b/setup.py @@ -115,12 +115,6 @@ def main(): else [] ) + - ( - [r"lib/libOrbbecSDK.dylib", r"lib/libOrbbecSDK.\d.\d.dylib", r"lib/libOrbbecSDK.\d.\d.\d.dylib"] - if platform.system() == "Darwin" and platform.machine() == "arm64" - else [] - ) - + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From ef9443d618d0b297b75c6cfb276beadcebf3dedc Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 21 Sep 2024 21:22:52 +0200 Subject: [PATCH 287/293] fix: add CMake as a build requirement only if required The PyPI distribution of CMake shall not be listed as an unconditional build requirement. It shall only be added as a build requirement if not installed or too low a version. This helps building from sources on platforms where no wheels are available for CMake but the system already provides a recent enough CMake version. In case of error checking the version, the backend falls back to using the PyPI distribution of CMake. --- MANIFEST.in | 1 + _build_backend/backend.py | 23 +++++++++++++++++++++++ pyproject.toml | 6 +++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 _build_backend/backend.py diff --git a/MANIFEST.in b/MANIFEST.in index b429eae0..cb9a7e7b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include README.md include find_version.py include setup.py include pyproject.toml +include _build_backend/backend.py recursive-include cv2 * recursive-include docker * recursive-include opencv * diff --git a/_build_backend/backend.py b/_build_backend/backend.py new file mode 100644 index 00000000..7fc84138 --- /dev/null +++ b/_build_backend/backend.py @@ -0,0 +1,23 @@ +from setuptools import build_meta as _orig + +prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel +build_wheel = _orig.build_wheel +build_sdist = _orig.build_sdist +get_requires_for_build_sdist = _orig.get_requires_for_build_sdist + +def get_requires_for_build_wheel(config_settings=None): + from packaging import version + from skbuild.exceptions import SKBuildError + from skbuild.cmaker import get_cmake_version + packages = _orig.get_requires_for_build_wheel(config_settings) + # check if system cmake can be used if present + # if not, append cmake PyPI distribution to required packages + # scikit-build>=0.18 itself requires cmake 3.5+ + min_version = "3.5" + try: + if version.parse(get_cmake_version().split("-")[0]) < version.parse(min_version): + packages.append(f'cmake>={min_version}') + except SKBuildError: + packages.append(f'cmake>={min_version}') + + return packages diff --git a/pyproject.toml b/pyproject.toml index 71de7f9b..7a37ec46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,17 @@ [build-system] requires = [ - "cmake>=3.1", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy>=2.0.0; python_version>='3.9'", + "packaging", "pip", "scikit-build>=0.14.0", "setuptools==59.2.0", ] +# use a custom backend to manage CMake check / installation +# see https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version +build-backend = "backend" +backend-path = ["_build_backend"] From 02648ce49748032a78937c8cdb8c015577b9ff2a Mon Sep 17 00:00:00 2001 From: Zhanwen Chen Date: Fri, 14 Jun 2024 16:55:51 -0700 Subject: [PATCH 288/293] Fix Python Source RelPath for PY_LIMITED_API=OFF --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fd4181d0..4f50b3e3 100644 --- a/setup.py +++ b/setup.py @@ -118,8 +118,11 @@ def main(): # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. + # If not specifying PY_LIMITED_API, the Python sources go under python/cv2/python-3.MINOR_VERSION/ instead of python/cv2/python-3/ [ - r"python/cv2/python-%s/cv2.*" + r"python/cv2/python-%s*/cv2.*" + % (sys.version_info[0]) if 'CMAKE_ARGS' in os.environ and "-DPYTHON3_LIMITED_API=ON" in os.environ['CMAKE_ARGS'] + else r"python/cv2/python-%s.*/cv2.*" % (sys.version_info[0]) ] + From 5da0b6e74467b3be2bd297dbb565b30661c77ebf Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 13 Jan 2025 18:06:49 +0300 Subject: [PATCH 289/293] Add NASM assembler to Windows build for jpeg-turbo. --- .github/workflows/build_wheels_windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index d69f17ec..4469f7b9 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -59,6 +59,8 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 + - name: Setup NASM + uses: ilammy/setup-nasm@v1 - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | From 58257dc9079d94afd319bd8b863dd884582ea6e0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 9 Jan 2025 15:23:43 +0300 Subject: [PATCH 290/293] Switched to tag 4.11.0 --- .github/workflows/build_wheels_macos_m1.yml | 4 ++-- opencv | 2 +- opencv_contrib | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index dd119fcb..effc27fe 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -54,7 +54,7 @@ jobs: git submodule update --init multibuild echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - export MACOSX_DEPLOYMENT_TARGET=11.0 + export MACOSX_DEPLOYMENT_TARGET=13.0 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* @@ -71,7 +71,7 @@ jobs: Test: needs: [Build] - runs-on: opencv-cn-mac-arm64-tests + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: diff --git a/opencv b/opencv index b42075f3..31b0eeea 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b42075f3e2c7eca4a12e55b32cfc95fa90982a21 +Subproject commit 31b0eeea0b44b370fd0712312df4214d4ae1b158 diff --git a/opencv_contrib b/opencv_contrib index 3e776c87..0e5254eb 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 3e776c876ef8527ad639d2c792521b6cede291e5 +Subproject commit 0e5254ebf54d2aed6e7eaf6660bf3b797cf50a02 From ca68df575d75c916097c642f5f0c508e38b7c2e7 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 15 Jan 2025 12:50:06 +0300 Subject: [PATCH 291/293] Python 3.13 support. --- .github/workflows/build_wheels_linux.yml | 6 +++--- .github/workflows/build_wheels_linux_arm.yml | 6 +++--- .github/workflows/build_wheels_macos.yml | 6 +++--- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- setup.py | 1 + 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 9df69240..653d4975 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: @@ -106,7 +106,7 @@ jobs: echo "Target branch name: ${{ github.base_ref }}" git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index bd5c0040..385f696d 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 @@ -108,7 +108,7 @@ jobs: echo "Target branch name: ${{ github.base_ref }}" git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 6940cc55..eb797d46 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -105,7 +105,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,7 +114,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -134,7 +134,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index effc27fe..ffbdc752 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4469f7b9..bb7b548b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -91,7 +91,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/setup.py b/setup.py index 4f50b3e3..1dfab2fb 100644 --- a/setup.py +++ b/setup.py @@ -303,6 +303,7 @@ def main(): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", From 28172087e47d6575ecd6853b2915e1e679f5fb6f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 16 Jan 2025 11:08:39 +0300 Subject: [PATCH 292/293] Reverted back to Github actions checkout as self-made command does not handle releases. --- .github/workflows/build_wheels_linux.yml | 24 ++++++++++---------- .github/workflows/build_wheels_linux_arm.yml | 16 ++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 653d4975..7bfe8cec 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -101,10 +101,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix @@ -155,10 +155,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 385f696d..d643ba8e 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -103,10 +103,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix From 2606a6032ee8206f331e927041d9d7cf67fb9980 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 19 May 2025 09:22:36 +0300 Subject: [PATCH 293/293] Merge pull request #1100 from avdivan:4.x * Update build_wheels_windows.yml * Update setup.py --- .github/workflows/build_wheels_windows.yml | 24 ++++++++-------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bb7b548b..a1a36ff8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,7 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* @@ -118,7 +113,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -142,15 +137,14 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python_rolling run: | @@ -172,15 +166,14 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload all wheels run: | @@ -190,15 +183,14 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python run: |