From eb0efe2fa05e4ef1e596bad2509e870fc2c5377f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Fri, 16 Jul 2021 15:58:54 +0300 Subject: [PATCH 01/25] 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 02/25] 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 03/25] 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 04/25] 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 05/25] 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 06/25] 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 07/25] 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 08/25] 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 09/25] 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 10/25] 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 11/25] 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 12/25] 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 13/25] 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 14/25] 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 15/25] 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 16/25] 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 17/25] 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 18/25] "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 19/25] 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 96fbc6043a17d52a5cb0d46eea7f1359f7cf6c5a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 20 Oct 2021 12:16:01 +0300 Subject: [PATCH 20/25] Updated submodules to 3.4.16 Release --- multibuild | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) 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/opencv b/opencv index 59170890..62252d15 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 591708903b4393b5d33c3a2f4af5be4daeb94c4d +Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 diff --git a/opencv_contrib b/opencv_contrib index e9e50703..02c2b56c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit e9e507039d41fed009b72f9e163a22d9ae9f0712 +Subproject commit 02c2b56c44503e983c3eacd5b79744a24f433c36 diff --git a/opencv_extra b/opencv_extra index e79fc182..38d49ada 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit e79fc1824042cc57ff95547a50d5084881cb6056 +Subproject commit 38d49adaabb08618ff9fb224004362de80fdcbcc From 5094e4ea07e454cda623274bedcc85784558558a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:10:21 +0200 Subject: [PATCH 21/25] 3.4.x uses BSD --- LICENSE-3RD-PARTY.txt | 242 +++++++----------------------------------- 1 file changed, 41 insertions(+), 201 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 20f4fb37..60c34bc0 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1,208 +1,48 @@ 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. - 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. + + 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. ------------------------------------------------------------------------------ libvpx is redistributed within all opencv-python Linux packages. From c19b05aefc717c2d90f0b96f423d06b7492a9ed2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:13:15 +0200 Subject: [PATCH 22/25] update 3.4.x specific parts --- README.md | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2831332..32eb8ecc 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,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 [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. +OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE). Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). diff --git a/setup.py b/setup.py index 1b1f59c7..57544289 100644 --- a/setup.py +++ b/setup.py @@ -99,7 +99,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_ffmpeg\d{3,4}%s\.dll" % ("_64" if x64 else "")] if os.name == "nt" else [] ) @@ -120,7 +120,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/OpenCV") + r"/haarcascades/.*\.xml" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 27c1aa45cf7780224401a9906e24409a4ced2eb5 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:15:57 +0200 Subject: [PATCH 23/25] OpenCV 3.4.16 release preparations --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 39c33341..62252d15 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 39c3334147ec02761b117f180c9c4518be18d1fa +Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 diff --git a/opencv_contrib b/opencv_contrib index 2bc3e1a1..02c2b56c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 2bc3e1a169afd2675ef68221176f32cc0ea5427a +Subproject commit 02c2b56c44503e983c3eacd5b79744a24f433c36 diff --git a/opencv_extra b/opencv_extra index 822ee112..38d49ada 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 822ee11240b969e98e20546663bc481a5e7089cc +Subproject commit 38d49adaabb08618ff9fb224004362de80fdcbcc From f947d44e736b576042c44093acdc3a7fee505986 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Wed, 5 May 2021 21:47:10 +0300 Subject: [PATCH 24/25] Update years in opencv license according to the original repo (#477) --- LICENSE-3RD-PARTY.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 60c34bc0..87c0514e 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -10,13 +10,13 @@ copy or use the software. For Open Source Computer Vision Library (3-clause BSD License) -Copyright (C) 2000-2020, Intel Corporation, all rights reserved. +Copyright (C) 2000-2021, 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-2021, OpenCV Foundation, all rights reserved. Copyright (C) 2015-2016, Itseez Inc., all rights reserved. -Copyright (C) 2019-2020, Xperience AI, all rights reserved. +Copyright (C) 2019-2021, 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, From 2e562e905af9cb1aabecc07d626a71772f9b7df0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Jun 2021 02:22:45 +0300 Subject: [PATCH 25/25] Added opencv_extra and defined 3.4 branch for submodules --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 655467e8..8ebdff3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 3.4 [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 3.4 [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 + branch = 3.4