diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml deleted file mode 100644 index d802204e..00000000 --- a/.github/workflows/build_wheels_linux_arm.yml +++ /dev/null @@ -1,191 +0,0 @@ -name: Linux ARM64 - -on: - pull_request: - branches: - - master - - 3.4 - - 4.x - - 5.x - paths-ignore: - - '.github/workflows/build_wheels_linux.yml' - - '.github/workflows/build_wheels_windows*' - - '.github/workflows/build_wheels_macos*' - release: - types: [published, edited] - schedule: - - cron: '0 3 * * 6' - workflow_dispatch: - - -jobs: - Build: - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - python-version: ['3.9'] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - PROJECT_SPEC: opencv-python - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - MB_ML_VER: 2014 - TRAVIS_BUILD_DIR: ${{ github.workspace }} - CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20250611 - USE_CCACHE: 0 - UNICODE_WIDTH: 32 - 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: Setup environment - run: | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV - fi - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 - - name: Build a package - run: source scripts/build.sh - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} - path: wheelhouse/opencv*.whl - - Test: - needs: [Build] - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MB_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.2.1 - CONFIG_PATH: travis_config.sh - DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 - UNICODE_WIDTH: 32 - steps: - - name: Cleanup - run: find . -mindepth 1 -delete - working-directory: ${{ github.workspace }} - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 - - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v4 - 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 - - Release_rolling: - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: opencv-python-rolling-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload wheels for opencv_python_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* - - name: Upload wheels for opencv_contrib_python_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* - - name: Upload wheels for opencv_python_headless_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* - - name: Upload wheels for opencv_contrib_python_headless_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* - - Pre-release: - if: github.event_name == 'release' && github.event.release.prerelease - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: test-opencv-python-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload all wheels - run: | - python -m pip install twine - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - - Release: - if: github.event_name == 'release' && !github.event.release.prerelease - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: opencv-python-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload wheels for opencv_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index a1cad49e..49398859 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -3,12 +3,10 @@ name: macOS x86_64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos_m1.yml' release: @@ -20,10 +18,7 @@ on: jobs: Build: - runs-on: macos-13 - defaults: - run: - shell: bash + runs-on: python-macos-intel strategy: fail-fast: false matrix: @@ -33,6 +28,7 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + CI_BUILD: 1 ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . PROJECT_SPEC: opencv-python @@ -48,6 +44,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -57,12 +54,6 @@ jobs: if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817 - rm /usr/local/bin/2to3* - rm /usr/local/bin/idle3* - rm /usr/local/bin/pydoc3* - rm /usr/local/bin/python3* - # end hack - name: Checkout uses: actions/checkout@v3 with: @@ -70,21 +61,13 @@ jobs: fetch-depth: 0 - name: Build a package run: | - set -e - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - set -x - build_wheel $REPO_DIR $PLAT + export MACOSX_DEPLOYMENT_TARGET=14.0 + python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin + python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v + delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v4 with: @@ -93,14 +76,11 @@ jobs: Test: needs: [Build] - runs-on: macos-13 - defaults: - run: - shell: bash + runs-on: python-macos-intel strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -109,11 +89,12 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.2.1 + NP_TEST_DEP_LATEST: numpy==2.2.6 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -123,32 +104,33 @@ jobs: with: submodules: true fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - name: Setup Environment variables - run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ + - name: Create Venv for test + run: | + test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test" + python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test - name: Package installation run: | - python -m pip install wheelhouse/opencv*.whl + source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install --upgrade pip + python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests - python get_build_info.py + python${{ matrix.python-version }} get_build_info.py - name: Run tests run: | + source ${{ github.workspace }}/opencv_test/bin/activate cd ${{ github.workspace }}/opencv - python modules/python/test/test.py -v --repo . + python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - name: Pylint test run: | - python -m pip install pylint==2.15.9 + source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests - python -m pylint $PYLINT_TEST_FILE + python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 1e62c858..85265a5a 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -3,12 +3,10 @@ name: macOS ARM64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos.yml' release: @@ -70,7 +68,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_manylinux.yml similarity index 74% rename from .github/workflows/build_wheels_linux.yml rename to .github/workflows/build_wheels_manylinux.yml index 7e2f836e..8abf61fb 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_manylinux.yml @@ -1,14 +1,11 @@ -name: Linux x86_64 +name: Manylinux on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos*' release: @@ -20,7 +17,7 @@ on: jobs: Build: - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.platform == 'aarch64' && 'opencv-cn-lin-arm64' || 'ubuntu-22.04' }} defaults: run: shell: bash @@ -28,26 +25,42 @@ jobs: fail-fast: false matrix: python-version: ['3.9'] - platform: [x64] + platform: [x86_64, aarch64] + manylinux: [2014, 2_28] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] + include: + - platform: aarch64 + manylinux: 2014 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20260102 + - platform: x86_64 + manylinux: 2014 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260102 + - platform: x86_64 + manylinux: 2_28 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64:20260102 + - platform: aarch64 + manylinux: 2_28 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64:20260102 + env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - MB_ML_VER: 2014 + MB_ML_VER: ${{ matrix.manylinux }} TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250611 + DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} USE_CCACHE: 0 UNICODE_WIDTH: 32 - PLAT: x86_64 + PLAT: ${{ matrix.platform }} SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -62,17 +75,18 @@ jobs: with: submodules: false fetch-depth: 0 + - name: Build a package run: source scripts/build.sh - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v4 with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + name: wheel-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl Test: needs: [Build] - runs-on: ubuntu-22.04 + runs-on: ${{ matrix.platform == 'aarch64' && 'opencv-cn-lin-arm64' || 'ubuntu-22.04' }} defaults: run: shell: bash @@ -80,17 +94,23 @@ jobs: fail-fast: false matrix: python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - platform: [x64] + platform: [x86_64, aarch64] + manylinux: [2014, 2_28] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] + env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.2.1 + NP_TEST_DEP_LATEST: numpy==2.2.6 CONFIG_PATH: travis_config.sh - PLAT: x86_64 + PLAT: ${{ matrix.platform }} + SDIST: ${{ matrix.build_sdist || 0 }} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + DOCKER_TEST_IMAGE: ${{ matrix.platform == 'aarch64' && 'quay.io/opencv-ci/multibuild-focal_arm64v8:2025-11-13' || '' }} steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -100,12 +120,13 @@ jobs: with: submodules: true fetch-depth: 0 + - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" -o "3.14" == "${{ 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@v4 with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + name: wheel-${{ matrix.platform }}-${{ matrix.manylinux }}-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh @@ -134,7 +155,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250611 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260102 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -188,24 +209,24 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_rolling-* - name: Upload wheels for opencv_contrib_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_rolling-* - name: Upload wheels for opencv_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless_rolling-* - name: Upload wheels for opencv_contrib_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-* Pre-release: if: github.event_name == 'release' && github.event.release.prerelease @@ -218,12 +239,12 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ + - name: Upload all wheels run: | python -m pip install twine - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-* + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_* wheelhouse/wheel-*/opencv-* Release: if: github.event_name == 'release' && !github.event.release.prerelease @@ -236,21 +257,20 @@ jobs: steps: - uses: actions/download-artifact@v4 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]* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python-* wheelhouse/wheel-*/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]* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python-* wheelhouse/wheel-*/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-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_python_headless-* wheelhouse/wheel-*/opencv-python-headless-* - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* wheelhouse/opencv-contrib-python-headless-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/wheel-*/opencv_contrib_python_headless-* wheelhouse/wheel-*/opencv-contrib-python-headless-* diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index a1a36ff8..580bdd57 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -3,12 +3,10 @@ name: Windows x86_64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_macos*' release: types: [published, edited] @@ -19,7 +17,7 @@ on: jobs: Build: - runs-on: windows-2019 + runs-on: windows-2025 strategy: fail-fast: false matrix: @@ -48,7 +46,7 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: false fetch-depth: 0 @@ -79,7 +77,7 @@ jobs: Test: needs: [Build] - runs-on: windows-2019 + runs-on: windows-2025 defaults: run: shell: cmd @@ -95,6 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py + PlatformToolset: v143 steps: - name: Cleanup shell: bash @@ -103,7 +102,7 @@ jobs: rm -rf ./.??* || true working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 diff --git a/README.md b/README.md index 3a4b46c2..6de64d64 100644 --- a/README.md +++ b/README.md @@ -242,6 +242,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.10 - 3.11 - 3.12 +- 3.13 ### Backward compatibility diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index e991029c..c995e00c 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,18 +1,18 @@ -# Version: 20250611 +# Version: 20260102 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.6 -ARG FREETYPE_VERSION=2.13.3 -ARG LIBPNG_VERSION=1.6.48 -ARG VPX_VERSION=v1.15.1 +ARG FFMPEG_VERSION=8.0.1 +ARG FREETYPE_VERSION=2.14.1 +ARG LIBPNG_VERSION=1.6.53 +ARG VPX_VERSION=v1.15.2 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.16 +ARG QT_VERSION=5.15.18 ARG YASM_VERSION=1.3.0 -ARG AOM_VERSION=v3.12.1 +ARG AOM_VERSION=v3.13.1 ARG AVIF_VERSION=v1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -21,7 +21,7 @@ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel dejavu-sans-fonts -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ - curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ + cp /usr/include/openblas/*.h /usr/include/ && \ # libpng will be built from source yum remove libpng -y diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 8adbc8a6..c48a2370 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,18 +1,18 @@ -# Version: 20250611 +# Version: 20260102 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.6 -ARG FREETYPE_VERSION=2.13.3 -ARG LIBPNG_VERSION=1.6.48 -ARG VPX_VERSION=v1.15.1 +ARG FFMPEG_VERSION=8.0.1 +ARG FREETYPE_VERSION=2.14.1 +ARG LIBPNG_VERSION=1.6.53 +ARG VPX_VERSION=v1.15.2 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.16 +ARG QT_VERSION=5.15.18 ARG YASM_VERSION=1.3.0 -ARG AOM_VERSION=v3.12.1 +ARG AOM_VERSION=v3.13.1 ARG AVIF_VERSION=v1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -20,8 +20,8 @@ ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel dejavu-sans-fonts -y && \ + cp /usr/include/openblas/*.h /usr/include/ && \ 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 diff --git a/docker/manylinux_2_28/Dockerfile_aarch64 b/docker/manylinux_2_28/Dockerfile_aarch64 new file mode 100644 index 00000000..5fe6d93a --- /dev/null +++ b/docker/manylinux_2_28/Dockerfile_aarch64 @@ -0,0 +1,114 @@ +# Version: 20260102 +# Image name: quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64 + +FROM quay.io/pypa/manylinux_2_28_aarch64:latest + +ARG FFMPEG_VERSION=8.0.1 +ARG FREETYPE_VERSION=2.14.1 +ARG LIBPNG_VERSION=1.6.53 +ARG VPX_VERSION=v1.15.2 +ARG QT_VERSION=5.15.18 +ARG AOM_VERSION=v3.13.1 +ARG AVIF_VERSION=v1.3.0 + +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel dejavu-sans-fonts ccache yasm nasm ninja-build openssl openssl-devel -y && \ + # 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/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + cd qt-everywhere-src-${QT_VERSION} && \ + export MAKEFLAGS=-j$(nproc) && \ + ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + make && \ + make install && \ + cd .. && \ + rm -rf qt-everywhere* + +ENV QTDIR /opt/Qt${QT_VERSION} +ENV PATH "$QTDIR/bin:$PATH" + +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources + +RUN mkdir ~/aom_sources && \ + cd ~/aom_sources && \ + git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \ + mkdir build && cd build && \ + cmake -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF ../aom/ && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd / && rm -rf ~/aom_sources + +RUN mkdir ~/avif_sources && \ + cd ~/avif_sources && \ + git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd / && rm -rf ~/avif_sources + +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + cd ffmpeg-${FFMPEG_VERSION} && \ + PATH=~/bin:$PATH && \ + PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + ldconfig && \ + rm -rf ~/ffmpeg_sources + +# 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:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" diff --git a/docker/manylinux_2_28/Dockerfile_x86_64 b/docker/manylinux_2_28/Dockerfile_x86_64 new file mode 100644 index 00000000..c8de6208 --- /dev/null +++ b/docker/manylinux_2_28/Dockerfile_x86_64 @@ -0,0 +1,114 @@ +# Version: 20260102 +# Image name: quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64 + +FROM quay.io/pypa/manylinux_2_28_x86_64:latest + +ARG FFMPEG_VERSION=8.0.1 +ARG FREETYPE_VERSION=2.14.1 +ARG LIBPNG_VERSION=1.6.53 +ARG VPX_VERSION=v1.15.2 +ARG QT_VERSION=5.15.18 +ARG AOM_VERSION=v3.13.1 +ARG AVIF_VERSION=v1.3.0 + +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install zlib-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel dejavu-sans-fonts ccache yasm nasm ninja-build openssl openssl-devel -y && \ + # 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/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + cd qt-everywhere-src-${QT_VERSION} && \ + export MAKEFLAGS=-j$(nproc) && \ + ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ + make && \ + make install && \ + cd .. && \ + rm -rf qt-everywhere* + +ENV QTDIR /opt/Qt${QT_VERSION} +ENV PATH "$QTDIR/bin:$PATH" + +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources + +RUN mkdir ~/aom_sources && \ + cd ~/aom_sources && \ + git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \ + mkdir build && cd build && \ + cmake -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=ON -DENABLE_TESTS=OFF ../aom/ && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd / && rm -rf ~/aom_sources + +RUN mkdir ~/avif_sources && \ + cd ~/avif_sources && \ + git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd / && rm -rf ~/avif_sources + +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + cd ffmpeg-${FFMPEG_VERSION} && \ + PATH=~/bin:$PATH && \ + PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ + ldconfig && \ + rm -rf ~/ffmpeg_sources + +# 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:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" diff --git a/docker/musllinux_1_2/Dockerfile_aarch64 b/docker/musllinux_1_2/Dockerfile_aarch64 new file mode 100644 index 00000000..ceb02adf --- /dev/null +++ b/docker/musllinux_1_2/Dockerfile_aarch64 @@ -0,0 +1,166 @@ +# version: 20251211 +# Image name: quay.io/opencv-ci/opencv-python-musllinux_1_2-aarch64 +FROM quay.io/pypa/musllinux_1_2_aarch64:latest + +ARG CCACHE_VERSION=3.7.9 +ARG FFMPEG_VERSION=6.1.1 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.48 +ARG VPX_VERSION=v1.15.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1w +ARG YASM_VERSION=1.3.0 +ARG AOM_VERSION=v3.12.1 +ARG AVIF_VERSION=v1.3.0 + +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + +RUN apk add --no-cache \ + build-base \ + diffutils \ + cmake \ + bash \ + git \ + curl \ + wget \ + tar \ + xz \ + zlib-dev \ + xz-dev \ + nasm \ + yasm \ + pkgconfig \ + openssl-dev \ + libjpeg-turbo-dev \ + fontconfig-dev \ + freetype-dev \ + expat-dev \ + libpng-dev \ + alsa-lib-dev \ + musl-dev \ + ttf-dejavu \ + linux-headers \ + perl + +RUN apk del libpng-dev + +### libpng +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 + +### freetype +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 + +### OpenSSL +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="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install_sw && \ + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources + +### libvpx +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources + + +### aom +RUN mkdir -p /tmp/aom_sources && \ + cd /tmp/aom_sources && \ + git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \ + mkdir build && cd build && \ + cmake \ + -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_TESTS=OFF \ + -DENABLE_EXAMPLES=OFF \ + ../aom && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install +### avif +RUN mkdir ~/avif_sources && \ + cd ~/avif_sources && \ + git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/avif_sources + +### ffmpeg +RUN mkdir -p /ffmpeg_sources && \ + cd /ffmpeg_sources && \ + curl -LO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + cd ffmpeg-${FFMPEG_VERSION} && \ + 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 \ + --disable-indev=v4l2 \ + --disable-outdev=v4l2 && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + rm -rf /ffmpeg_sources + +### ccache +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 + +# 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 + +RUN git config --global --add safe.directory /io +ENV PATH="/ffmpeg_build/bin:$PATH" +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" +ENV LD_LIBRARY_PATH="/ffmpeg_build/lib:$LD_LIBRARY_PATH" diff --git a/docker/musllinux_1_2/Dockerfile_x86_64 b/docker/musllinux_1_2/Dockerfile_x86_64 new file mode 100644 index 00000000..babdf95f --- /dev/null +++ b/docker/musllinux_1_2/Dockerfile_x86_64 @@ -0,0 +1,161 @@ +# version: 20251211 +# Image name: quay.io/opencv-ci/opencv-python-musllinux_1_2-x86-64 +FROM quay.io/pypa/musllinux_1_2_x86_64:latest + +ARG CCACHE_VERSION=3.7.9 +ARG FFMPEG_VERSION=6.1.1 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.48 +ARG VPX_VERSION=v1.15.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1w +ARG YASM_VERSION=1.3.0 +ARG AOM_VERSION=v3.12.1 +ARG AVIF_VERSION=v1.3.0 + +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + +RUN apk add --no-cache \ + build-base \ + diffutils \ + cmake \ + bash \ + git \ + curl \ + wget \ + tar \ + xz \ + zlib-dev \ + xz-dev \ + nasm \ + yasm \ + pkgconfig \ + openssl-dev \ + libjpeg-turbo-dev \ + fontconfig-dev \ + freetype-dev \ + expat-dev \ + libpng-dev \ + alsa-lib-dev \ + musl-dev \ + ttf-dejavu \ + linux-headers \ + perl + +RUN apk del libpng-dev + +### libpng +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 + +### freetype +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 + +### OpenSSL +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="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install_sw && \ + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources + +### libvpx +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources + + +### aom +RUN mkdir -p /tmp/aom_sources && \ + cd /tmp/aom_sources && \ + git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \ + mkdir build && cd build && \ + cmake \ + -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_TESTS=OFF \ + -DENABLE_EXAMPLES=OFF \ + ../aom && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install +### avif +RUN mkdir ~/avif_sources && \ + cd ~/avif_sources && \ + git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/avif_sources + +### ffmpeg +RUN mkdir -p /ffmpeg_sources && \ + cd /ffmpeg_sources && \ + curl -LO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + cd ffmpeg-${FFMPEG_VERSION} && \ + 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 \ + --disable-indev=v4l2 \ + --disable-outdev=v4l2 && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + rm -rf /ffmpeg_sources + +### ccache +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 + +# user`s UID is 1001 +RUN adduser -D -u 1001 ci && mkdir /io && chown ci:ci /io && \ + chown -R ci:ci /ffmpeg_build + +USER ci + +RUN git config --global --add safe.directory /io +ENV PATH="/ffmpeg_build/bin:$PATH" +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" +ENV LD_LIBRARY_PATH="/ffmpeg_build/lib:$LD_LIBRARY_PATH" diff --git a/opencv b/opencv index 31b0eeea..b4c5ec40 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 31b0eeea0b44b370fd0712312df4214d4ae1b158 +Subproject commit b4c5ec4042f097e2a5b386b9d413ec7333d0a184 diff --git a/opencv_contrib b/opencv_contrib index 0e5254eb..d99ad2a1 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 0e5254ebf54d2aed6e7eaf6660bf3b797cf50a02 +Subproject commit d99ad2a188210cc35067c2e60076eed7c2442bc3 diff --git a/opencv_extra b/opencv_extra index a74cf6ba..c322faf6 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit a74cf6bae7fd75d91282b877c559168b3a62148a +Subproject commit c322faf6f5d10649c4215a16203b923e36c4ba6f diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index b274aa08..ea11c7ae 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() + if(UNIX AND NOT APPLE) -+ install(DIRECTORY /opt/Qt5.15.16/plugins DESTINATION lib/qt) ++ install(DIRECTORY /opt/Qt5.15.18/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() if(HAVE_QT_OPENGL) diff --git a/pyproject.toml b/pyproject.toml index d70b49ef..ff65d776 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,9 @@ [build-system] requires = [ - "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", - "numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", - "numpy>=2.0.0; python_version>='3.9'", + "numpy<2.0; python_version<'3.9'", + "numpy==2.0.2; python_version>='3.9' and python_version<'3.13'", + "numpy==2.1.3; python_version=='3.13'", + "numpy==2.3.2; python_version=='3.14'", "packaging", "pip", "scikit-build>=0.14.0", diff --git a/setup.py b/setup.py index 9aff8d23..e25e51b2 100755 --- a/setup.py +++ b/setup.py @@ -23,16 +23,8 @@ def main(): build_rolling = get_build_env_var_by_name("rolling") install_requires = [ - 'numpy>=1.13.3; python_version<"3.7"', - 'numpy>=1.17.0; python_version>="3.7"', # https://github.com/numpy/numpy/pull/13725 - 'numpy>=1.17.3; python_version>="3.8"', - 'numpy>=1.19.3; python_version>="3.9"', - 'numpy>=1.21.2; python_version>="3.10"', - 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', - 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', - 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', - "numpy>=1.23.5; python_version>='3.11'", - "numpy>=1.26.0; python_version>='3.12'" + 'numpy<2.0; python_version<"3.9"', + 'numpy>=2; python_version>="3.9"', ] python_version = cmaker.CMaker.get_python_version() @@ -163,7 +155,7 @@ def main(): files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} ci_cmake_generator = ( - ["-G", "Visual Studio 14" + (" Win64" if is64 else "")] + ["-G", "Visual Studio 17 2022"] if os.name == "nt" else ["-G", "Unix Makefiles"] ) @@ -220,10 +212,10 @@ def main(): cmake_args.append("-DWITH_WIN32UI=OFF") cmake_args.append("-DWITH_QT=OFF") cmake_args.append("-DWITH_GTK=OFF") - if is_CI_build: - cmake_args.append( - "-DWITH_MSMF=OFF" - ) # see: https://github.com/skvark/opencv-python/issues/263 + # see: https://github.com/skvark/opencv-python/issues/263 + # see: https://github.com/opencv/opencv-python/issues/771 + cmake_args.append("-DWITH_MSMF=OFF") + cmake_args.append("-DWITH_OBSENSOR=OFF") # Orbbec cameras backend uses MSMF API if sys.platform.startswith("linux") and not is64 and "bdist_wheel" in sys.argv: subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True) @@ -306,6 +298,7 @@ def main(): "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", diff --git a/travis_config.sh b/travis_config.sh index 2e5e1a0e..8fbaf2e2 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -34,12 +34,12 @@ if [ -n "$IS_OSX" ]; then export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" else echo " > Linux environment " - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.16/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.18/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then # To avoid network issues with pypi.org on OpenCV CN machines - export PIP_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple + #export PIP_INDEX_URL=https://pypi.org/simple echo "Running for linux aarch64" fi fi