diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a368661d..98ad3dc8 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*' @@ -14,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: . @@ -39,34 +37,32 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/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: @@ -75,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 }} @@ -97,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: . @@ -145,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/asenyaev/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 @@ -176,22 +164,21 @@ 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 echo "skipping tests because of sdist" - - name: saving artifacts 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 needs: [build, build_sdist, test] - runs-on: ubuntu-latest + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: @@ -201,7 +188,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -210,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: @@ -220,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 a97bbc29..4d0c3daf 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*' @@ -14,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: . @@ -40,33 +38,30 @@ 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-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: @@ -75,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 }} @@ -99,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: @@ -136,7 +123,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -145,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: @@ -155,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 bccec01f..af892101 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*' @@ -18,7 +19,6 @@ jobs: defaults: run: shell: bash - strategy: fail-fast: false matrix: @@ -39,7 +39,6 @@ jobs: python-version: '3.8' - os: macos-11 python-version: '3.9' - env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -59,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 @@ -88,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: @@ -107,7 +104,6 @@ jobs: defaults: run: shell: bash - strategy: fail-fast: false matrix: @@ -128,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 }} @@ -138,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 @@ -181,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: @@ -191,7 +182,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -200,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: @@ -210,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 9f7b0f37..a1d7c924 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*' @@ -14,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 @@ -52,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: @@ -67,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 @@ -116,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: @@ -135,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: @@ -145,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 337c77b2..087efc04 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*' @@ -13,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 @@ -63,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: @@ -78,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 @@ -124,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: @@ -151,7 +140,6 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine @@ -160,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: @@ -170,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/.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/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index b380d3ba..2679cbbf 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,80 +1,142 @@ +# 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 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="/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} && \ - ./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 && \ - 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" && \ + ./configure --prefix="/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" && \ + ./configure --prefix="/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 && \ + ./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 + 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} && \ 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 + 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} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + 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 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 fb367c0a..8bb77341 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,72 +1,142 @@ +# 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 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="/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} && \ - ./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 && \ - 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" && \ + ./configure --prefix="/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" && \ + ./configure --prefix="/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 && \ + ./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 + 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} && \ 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 + 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 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/multibuild b/multibuild index b89bb903..bce1637e 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit b89bb903e94308be79abefa4f436bf123ebb1313 +Subproject commit bce1637e202cb52b0e7ea42baa1cccc894b82806 diff --git a/opencv b/opencv index dad26339..b0dc4741 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit dad26339a975b49cfb6c7dbe4bd5276c9dcb36e2 +Subproject commit b0dc474160e389b9c9045da5db49d03ae17c6a6b diff --git a/opencv_contrib b/opencv_contrib index 49e8f123..db16caf6 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 49e8f123ca08e76891856a1ecce491b62d08ba20 +Subproject commit db16caf6ceee76b43b94c846be276e92a43e9700 diff --git a/opencv_extra b/opencv_extra index 37294e3c..936854e2 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 37294e3c876a72c992d4718b9bbfc8346b9e779a +Subproject commit 936854e2b666853d6d0732a8eabc2d699f4fa3d8 diff --git a/setup.py b/setup.py index e92e54ad..11014d6b 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", ] + ( # CMake flags for windows/arm64 build @@ -375,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() 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