From 7b10157d8cc8bac6089e181a52f2dd50edffa979 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 29 Jul 2022 18:13:48 +0300 Subject: [PATCH 01/23] Updated submodules to the latest in 5.x (#696) --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index b0dc4741..638a0788 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b0dc474160e389b9c9045da5db49d03ae17c6a6b +Subproject commit 638a0788fe8ba58d735ac0eddbc8297bb3105da0 diff --git a/opencv_contrib b/opencv_contrib index db16caf6..b9ccfebf 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit db16caf6ceee76b43b94c846be276e92a43e9700 +Subproject commit b9ccfebf24d993ce5009c1b28c2bcbbdb3721a2c diff --git a/opencv_extra b/opencv_extra index 936854e2..a13afb81 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 936854e2b666853d6d0732a8eabc2d699f4fa3d8 +Subproject commit a13afb81a66b95c25d83bcc4d661ae516bdfedde From 3336f6717fa24a74d59e6116593d3acdcb247576 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 1 Aug 2022 09:21:27 +0300 Subject: [PATCH 02/23] Run pipelines on 4.x and 5.x branches (#697) --- .github/workflows/build_wheels_linux.yml | 2 ++ .github/workflows/build_wheels_linux_arm.yml | 2 ++ .github/workflows/build_wheels_macos.yml | 2 ++ .github/workflows/build_wheels_macos_m1.yml | 2 ++ .github/workflows/build_wheels_windows.yml | 2 ++ 5 files changed, 10 insertions(+) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 98ad3dc8..76a6d649 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 4d0c3daf..0a4dadbc 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index af892101..438373bb 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a1d7c924..134d5450 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 087efc04..f7d2c408 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -5,6 +5,8 @@ on: branches: - master - 3.4 + - 4.x + - 5.x paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_macos*' From 5aad8e1c6a131ae08e240973ed58fd49c48ee05c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Aug 2022 09:45:37 +0300 Subject: [PATCH 03/23] Fix path to opencv 5.x for haarcascades --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 11014d6b..3a1a7cfd 100644 --- a/setup.py +++ b/setup.py @@ -109,7 +109,7 @@ def main(): r"python/cv2/.*config.*.py" ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/opencv5") + r"/haarcascades/.*\.xml" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 3d0b585fc1b83761a2d2d3d83f1ad55c1266831c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Wed, 3 Aug 2022 15:12:49 +0300 Subject: [PATCH 04/23] Scheduled rolling workflows (#699) * Scheduled rolling workflows * Fixed a bug in commit/date for package version * Changed the name of Windows pipelines --- .github/workflows/build_wheels_linux.yml | 96 ++++++++++++++------ .github/workflows/build_wheels_linux_arm.yml | 80 ++++++++++++---- .github/workflows/build_wheels_macos.yml | 78 +++++++++++----- .github/workflows/build_wheels_macos_m1.yml | 81 +++++++++++++---- .github/workflows/build_wheels_windows.yml | 76 ++++++++++++---- find_version.py | 13 ++- scripts/build.sh | 1 + scripts/install.sh | 1 + setup.py | 39 +++++--- 9 files changed, 345 insertions(+), 120 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 76a6d649..a0933da5 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux x86_64 +name: Linux x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ubuntu-20.04 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -50,29 +53,33 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ubuntu-20.04 defaults: run: @@ -97,21 +104,21 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - build_sdist: + Build_sdist: runs-on: ubuntu-20.04 defaults: run: @@ -127,7 +134,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -142,20 +149,25 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} + ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -172,21 +184,51 @@ jobs: set -x echo "skipping tests because of sdist" - name: saving artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: dist/opencv*.tar.gz - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Build_sdist, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -195,16 +237,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build_sdist, test] + needs: [Build, Build_sdist, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 0a4dadbc..d2c5ea35 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Linux ARM +name: Linux ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build_arm: + Build: runs-on: opencv-cn-lin-arm64 defaults: run: @@ -32,7 +35,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -47,31 +50,36 @@ jobs: ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} steps: - - name: UID - run: id -u - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build_arm] + Test: + needs: [Build] runs-on: opencv-cn-lin-arm64 defaults: run: @@ -88,6 +96,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 + BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -97,31 +106,66 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests run: source scripts/install.sh - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -130,16 +174,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build_arm, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 438373bb..5b110fb7 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos +name: macOS x86_64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: ${{ matrix.os }} defaults: run: @@ -44,7 +47,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: master + BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -52,7 +55,6 @@ jobs: TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -64,14 +66,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | set -e @@ -90,18 +96,18 @@ jobs: set -x build_wheel $REPO_DIR $PLAT - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: ${{ matrix.os }} defaults: run: @@ -140,19 +146,19 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -171,16 +177,46 @@ jobs: cd ${{ github.workspace }}/tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -189,16 +225,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 134d5450..91d70ff3 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Macos M1 +name: macOS ARM64 on: pull_request: @@ -13,10 +13,13 @@ on: - '.github/workflows/build_wheels_macos.yml' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build: + Build: runs-on: opencv-cn-mac-arm64 strategy: fail-fast: false @@ -27,6 +30,7 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -35,14 +39,18 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + elif [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Build a package run: | git submodule update --init multibuild @@ -53,18 +61,18 @@ jobs: arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/opencv*.whl - test: - needs: [build] + Test: + needs: [Build] runs-on: opencv-cn-mac-arm64-tests strategy: fail-fast: false @@ -75,19 +83,25 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} + - name: Setup environment + run: | + if [[ "${{ github.event.pull_request }}" == "true" ]]; then + echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ @@ -106,35 +120,64 @@ jobs: cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ - - name: Upload all wheels run: | python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f7d2c408..f8970768 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels for opencv-python on Windows +name: Windows x86_64 on: pull_request: @@ -12,10 +12,13 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: jobs: - build-windows-x86_64: + Build: runs-on: windows-2019 strategy: fail-fast: false @@ -38,16 +41,19 @@ jobs: rm -rf ./* || true rm -rf ./.??* || true working-directory: ${{ github.workspace }} + - name: Setup environment + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: false fetch-depth: 0 - - name: Update submodules - if: github.event_name == 'pull_request' - run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} @@ -62,18 +68,18 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* - test: - needs: [build-windows-x86_64] + Test: + needs: [Build] runs-on: windows-2019 defaults: run: @@ -98,17 +104,17 @@ jobs: rm -rf ./.??* || true working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: submodules: true fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -129,16 +135,46 @@ jobs: cd ${{ github.workspace }}\tests python -m pylint $PYLINT_TEST_FILE - test_release_opencv_python: + Release_rolling: + if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} + needs: [Build, Test] + runs-on: ubuntu-20.04 + environment: opencv-python-rolling-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v3 + with: + name: wheels + path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + - name: Upload wheels for opencv_contrib_python_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + - name: Upload wheels for opencv_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + - name: Upload wheels for opencv_contrib_python_headless_rolling + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + + Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ @@ -147,16 +183,16 @@ jobs: python -m pip install twine python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - release_opencv_python: + Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build-windows-x86_64, test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v2 + - uses: actions/download-artifact@v3 with: name: wheels path: wheelhouse/ diff --git a/find_version.py b/find_version.py index 6c676b23..274c93e6 100644 --- a/find_version.py +++ b/find_version.py @@ -1,11 +1,12 @@ import sys -import os import subprocess +from datetime import date if __name__ == "__main__": contrib = sys.argv[1] headless = sys.argv[2] - ci_build = sys.argv[3] + rolling = sys.argv[3] + ci_build = sys.argv[4] opencv_version = "" # dig out the version from OpenCV sources @@ -56,13 +57,19 @@ # tag identifies the build and should be a sequential revision number version = tag[0] opencv_version += ".{}".format(version) + # rolling has converted into string using get_and_set_info() function in setup.py + elif rolling == "True": + # rolling version identifier, will be published in a dedicated rolling PyPI repository + version = date.today().strftime('%Y%m%d') + opencv_version += ".{}".format(version) else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += "+{}".format(version) + opencv_version += ".{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) f.write("contrib = {}\n".format(contrib)) f.write("headless = {}\n".format(headless)) + f.write("rolling = {}\n".format(rolling)) f.write("ci_build = {}".format(ci_build)) diff --git a/scripts/build.sh b/scripts/build.sh index f48ca066..e5c83d83 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -13,5 +13,6 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x build_wheel $REPO_DIR $PLAT diff --git a/scripts/install.sh b/scripts/install.sh index 6e019d1c..f20080ae 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -13,6 +13,7 @@ source multibuild/travis_steps.sh # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled +echo $ENABLE_ROLLING > rolling.enabled set -x install_run $PLAT set +x diff --git a/setup.py b/setup.py index 3a1a7cfd..9b937e59 100644 --- a/setup.py +++ b/setup.py @@ -21,6 +21,7 @@ def main(): build_contrib = get_build_env_var_by_name("contrib") build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" + build_rolling = get_build_env_var_by_name("rolling") install_requires = [ 'numpy>=1.13.3; python_version<"3.7"', @@ -46,17 +47,28 @@ def main(): g = git.Git() # NOTE: pip API's are internal, this has to be refactored g.run_command(["submodule", "sync"]) - g.run_command( - ["submodule", "update", "--init", "--recursive", cmake_source_dir] - ) - if build_contrib: + if build_rolling: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", cmake_source_dir] + ) + + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "--remote", "opencv_contrib"] + ) + else: g.run_command( - ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ["submodule", "update", "--init", "--recursive", cmake_source_dir] ) - package_version, build_contrib, build_headless = get_and_set_info( - build_contrib, build_headless, is_CI_build + if build_contrib: + g.run_command( + ["submodule", "update", "--init", "--recursive", "opencv_contrib"] + ) + + package_version, build_contrib, build_headless, build_rolling = get_and_set_info( + build_contrib, build_headless, build_rolling, is_CI_build ) # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode @@ -73,6 +85,9 @@ def main(): if build_headless and not build_contrib: package_name = "opencv-python-headless" + if build_rolling: + package_name += "-rolling" + long_description = io.open("README.md", encoding="utf-8").read() packages = ["cv2", "cv2.data"] @@ -245,14 +260,14 @@ def main(): skbuild.setup( name=package_name, version=package_version, - url="https://github.com/skvark/opencv-python", + url="https://github.com/opencv/opencv-python", license="MIT", description="Wrapper package for OpenCV python bindings.", long_description=long_description, long_description_content_type="text/markdown", packages=packages, package_data=package_data, - maintainer="Olli-Pekka Heinisuo", + maintainer="OpenCV Team", ext_modules=EmptyListWithLength(), install_requires=install_requires, python_requires=">=3.6", @@ -446,7 +461,7 @@ def _classify_installed_files_override( ) -def get_and_set_info(contrib, headless, ci_build): +def get_and_set_info(contrib, headless, rolling, ci_build): # cv2/version.py should be generated by running find_version.py version = {} here = os.path.abspath(os.path.dirname(__file__)) @@ -456,14 +471,14 @@ def get_and_set_info(contrib, headless, ci_build): # (in sdists the version.py file already exists) if os.path.exists(".git"): old_args = sys.argv.copy() - sys.argv = ["", str(contrib), str(headless), str(ci_build)] + sys.argv = ["", str(contrib), str(headless), str(rolling), str(ci_build)] runpy.run_path("find_version.py", run_name="__main__") sys.argv = old_args with open(version_file) as fp: exec(fp.read(), version) - return version["opencv_version"], version["contrib"], version["headless"] + return version["opencv_version"], version["contrib"], version["headless"], version["rolling"] def get_build_env_var_by_name(flag_name): From f9c40212eb060f5b56a7545b2dbaea2fa62a94b3 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Fri, 5 Aug 2022 18:43:33 +0300 Subject: [PATCH 05/23] macOS x86_64 runner change to macos-11 (#701) --- .github/workflows/build_wheels_macos.yml | 29 +++--------------------- 1 file changed, 3 insertions(+), 26 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 5b110fb7..adc3724d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,30 +20,18 @@ on: jobs: Build: - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . @@ -62,6 +50,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + MACOSX_DEPLOYMENT_TARGET: 10.15 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -108,30 +97,18 @@ jobs: Test: needs: [Build] - runs-on: ${{ matrix.os }} + runs-on: macos-11 defaults: run: shell: bash strategy: fail-fast: false matrix: - os: [macos-10.15, macos-11] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] build_sdist: [0] - exclude: - - os: macos-10.15 - python-version: '3.10' - - os: macos-11 - python-version: '3.6' - - os: macos-11 - python-version: '3.7' - - os: macos-11 - python-version: '3.8' - - os: macos-11 - python-version: '3.9' env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} From 710c89ec0263f0a1fa882dd66891a11e46ff4e46 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Sun, 21 Aug 2022 13:07:50 +0300 Subject: [PATCH 06/23] Adapted rolling releases to workflow_dispatch event (#709) --- .github/workflows/build_wheels_linux.yml | 7 ++++--- .github/workflows/build_wheels_linux_arm.yml | 3 ++- .github/workflows/build_wheels_macos.yml | 3 ++- .github/workflows/build_wheels_macos_m1.yml | 3 ++- .github/workflows/build_wheels_windows.yml | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a0933da5..5a09e933 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout @@ -149,7 +150,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} - ENABLE_ROLLING: 1 steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -158,7 +158,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index d2c5ea35..c6b9b4c5 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -57,7 +57,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index adc3724d..1ac459cd 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -59,7 +59,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 91d70ff3..3d8f9b62 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -43,7 +43,8 @@ jobs: run: | if [[ "${{ github.event.pull_request }}" == "true" ]]; then echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - elif [[ "${{ github.event_name }}" == "schedule" ]]; then + fi + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f8970768..e6874ffe 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -44,7 +44,7 @@ jobs: - name: Setup environment shell: bash run: | - if [[ "${{ github.event_name }}" == "schedule" ]]; then + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout From c9a96a60fc0bc25272f48ad27b48a985a547bd0f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Sun, 21 Aug 2022 17:51:26 +0300 Subject: [PATCH 07/23] Defined 5.x branch for submodules (#710) --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitmodules b/.gitmodules index 7193d3b9..99476363 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 5.x [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 5.x [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git + branch = 5.x From ebd7b5aa14ac79dfc650370ed200e31a2a8aa045 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 22 Aug 2022 13:37:19 +0300 Subject: [PATCH 08/23] Remove source packages for rolling packages (#712) --- .github/workflows/build_wheels_linux.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5a09e933..a8cdd34e 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -192,7 +192,7 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - needs: [Build, Build_sdist, Test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-rolling-release defaults: @@ -206,19 +206,19 @@ jobs: - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* wheelhouse/opencv-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* - name: Upload wheels for opencv_contrib_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* wheelhouse/opencv-contrib-python-rolling-[^h]* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* - name: Upload wheels for opencv_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* wheelhouse/opencv-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* - name: Upload wheels for opencv_contrib_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* wheelhouse/opencv-contrib-python-headless-rolling-* + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* Pre-release: if: github.event_name == 'release' && github.event.release.prerelease From ec5c8b55b61cbc18d2e38cf7ac260dc72f15b516 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 29 Aug 2022 09:34:59 +0300 Subject: [PATCH 09/23] Build zlib from the source on Linux with the latest version (#715) (#718) * Added zlib build from the source on Linux, handling auditwheel issues * Removed unused variable * Removed bzip2 from dependencies for OpenCV Python packages --- .github/workflows/build_wheels_linux.yml | 10 +---- .github/workflows/build_wheels_linux_arm.yml | 12 +----- .github/workflows/build_wheels_macos.yml | 4 -- .github/workflows/build_wheels_macos_m1.yml | 10 ----- docker/manylinux2014/Dockerfile_aarch64 | 29 +++++++++----- docker/manylinux2014/Dockerfile_x86_64 | 29 +++++++++----- patch_auditwheel_whitelist.py | 40 ++++++++++++++++---- 7 files changed, 75 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a8cdd34e..ab377325 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -35,14 +35,13 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -135,7 +131,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python PLAT: x86_64 MB_PYTHON_VERSION: ${{ matrix.python-version }} @@ -156,9 +151,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c6b9b4c5..079efbe1 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -43,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220824 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -55,9 +54,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -97,7 +93,6 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 - BUILD_COMMIT: ${{ github.ref }} NP_TEST_DEP: numpy==1.19.4 NP_TEST_DEP_LATEST: numpy==1.21.4 CONFIG_PATH: travis_config.sh @@ -107,11 +102,6 @@ jobs: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1ac459cd..1c2a1614 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -35,7 +35,6 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true REPO_DIR: . - BUILD_COMMIT: ${{ github.ref }} PROJECT_SPEC: opencv-python MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} @@ -57,9 +56,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3d8f9b62..b51801ab 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -30,7 +30,6 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} @@ -41,9 +40,6 @@ jobs: working-directory: ${{ github.workspace }} - name: Setup environment run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi @@ -84,18 +80,12 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - BUILD_COMMIT: ${{ github.ref }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Cleanup run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event.pull_request }}" == "true" ]]; then - echo "BUILD_COMMIT=${{ github.base_ref }}" >> $GITHUB_ENV - fi - name: Checkout uses: actions/checkout@v3 with: diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 2679cbbf..48ad3f98 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 8bb77341..85fc22fd 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20220628 +# Version: 20220824 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest @@ -11,16 +11,28 @@ ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 +ARG ZLIB_VERSION=1.2.12 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH # epel-release need for aarch64 to get openblas packages -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ +RUN yum install bzip2-devel curl-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ yum install openblas-devel -y && \ cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ # libpng will be built from source - yum remove libpng -y + yum remove libpng zlib-devel bzip2-devel -y + +RUN mkdir ~/zlib_sources && \ + cd ~/zlib_sources && \ + curl -O -L https://www.zlib.net/zlib-${ZLIB_VERSION}.tar.gz && \ + tar -xf zlib-${ZLIB_VERSION}.tar.gz && \ + cd zlib-${ZLIB_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/zlib_sources RUN mkdir ~/libpng_sources && \ cd ~/libpng_sources && \ @@ -71,8 +83,8 @@ RUN mkdir ~/openssl_sources && \ RUN mkdir ~/nasm_sources && \ cd ~/nasm_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ - tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.gz && \ + tar -xf nasm-${NASM_VERSION}.tar.gz && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install && \ @@ -102,8 +114,8 @@ RUN mkdir ~/libvpx_sources && \ RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ - tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure --prefix="/ffmpeg_build" --extra-cflags="-I/ffmpeg_build/include" --extra-ldflags="-L/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ @@ -111,8 +123,7 @@ RUN mkdir ~/ffmpeg_sources && \ make install && \ echo "/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources && \ - yum remove bzip2-devel -y + rm -rf ~/ffmpeg_sources RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index b32da17a..150f97ca 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -3,13 +3,39 @@ from auditwheel import policy -policies = None -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: - policies = json.load(f) +def add_zlib_versions(): + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'r') as manylinux_policy: + manylinux_policy_lines = manylinux_policy.readlines() -for p in policies: - p["lib_whitelist"].append("libxcb.so.1") + manylinux_policy_data = "" + for line in manylinux_policy_lines: + if "ZLIB" in line: + if len(line) > 22: + updated_line = line[:-2] + ', "1.2.9", "1.2.12"]' + else: + updated_line = line[:-2] + '"1.2.9", "1.2.12"]' + manylinux_policy_replacement = line.replace(line, updated_line) + else: + manylinux_policy_replacement = line + manylinux_policy_data = manylinux_policy_data + manylinux_policy_replacement -with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: - f.write(json.dumps(policies)) + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), 'w') as manylinux_final_policy: + manylinux_final_policy.write(manylinux_policy_data) + +def add_whitelisted_libs(): + policies = None + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: + policies = json.load(f) + + for p in policies: + p["lib_whitelist"].append("libxcb.so.1") + + with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: + f.write(json.dumps(policies)) + + +if __name__ == '__main__': + add_zlib_versions() + add_whitelisted_libs() From 66bbd9d95cb03cb36f9a3f5c1e7a78e4ef7c64c2 Mon Sep 17 00:00:00 2001 From: Joey Ballentine <34788790+joeyballentine@users.noreply.github.com> Date: Mon, 29 Aug 2022 02:36:17 -0400 Subject: [PATCH 10/23] Build x64 macOS wheels for 10.13 build target (#716) --- .github/workflows/build_wheels_macos.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1c2a1614..584520b2 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -49,7 +49,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - MACOSX_DEPLOYMENT_TARGET: 10.15 + MACOSX_DEPLOYMENT_TARGET: 10.13 steps: - name: Cleanup run: find . -mindepth 1 -delete From b0b7f9f7f29a9de17131be5b68a983a3f86e1d27 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev <76472231+asenyaev@users.noreply.github.com> Date: Mon, 29 Aug 2022 15:00:15 +0300 Subject: [PATCH 11/23] Bump numpy version to 1.21.4 for macOS builds (#720) --- pyproject.toml | 3 ++- setup.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ff535e86..5993a2ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,5 +8,6 @@ requires = [ "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version>='3.10'" + "numpy==1.21.2; python_version>='3.10'", + "numpy==1.21.4; python_version>='3.10' and platform_system=='Darwin'" ] diff --git a/setup.py b/setup.py index 9b937e59..11d2cb0f 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ def main(): 'numpy>=1.19.3; python_version>="3.9"', 'numpy>=1.21.2; python_version>="3.10"', 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', - 'numpy>=1.21.2; python_version>="3.6" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', + 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', ] python_version = cmaker.CMaker.get_python_version() From f9577797693ad3750d0fab0330b044b249068653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dr=2E=20Artificial=E6=9B=BE=E5=B0=8F=E5=81=A5?= <875100501@qq.com> Date: Sun, 11 Aug 2024 23:17:32 +0800 Subject: [PATCH 12/23] fix fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 03396b56..3a4b46c2 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,6 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. -Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 +Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support deprecated. See https://github.com/actions/runner-images/issues/5583 -Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support depricated by Brew and most of used packages. +Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support deprecated by Brew and most of used packages. From ec3604aae5cd0bee4b05dbf102dc3956728b4eff Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Tue, 3 Dec 2024 15:39:28 +0300 Subject: [PATCH 13/23] Revert "5.x merge 4.x and submodules update" --- .gitmodules | 3 --- find_version.py | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- pyproject.toml | 2 +- setup.py | 2 +- 7 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.gitmodules b/.gitmodules index 99476363..7193d3b9 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,15 +1,12 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git - branch = 5.x [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git - branch = 5.x [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git - branch = 5.x diff --git a/find_version.py b/find_version.py index 274c93e6..13e8003c 100644 --- a/find_version.py +++ b/find_version.py @@ -65,7 +65,7 @@ else: # local version identifier, not to be published on PyPI version = git_hash - opencv_version += ".{}".format(version) + opencv_version += "+{}".format(version) with open("cv2/version.py", "w") as f: f.write('opencv_version = "{}"\n'.format(opencv_version)) diff --git a/opencv b/opencv index b31bc1a2..71d3237a 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b31bc1a2954e22d87f8384212c5e3dfbe7024f16 +Subproject commit 71d3237a093b60a27601c20e9ee6c3e52154e8b1 diff --git a/opencv_contrib b/opencv_contrib index f7d6288a..1ed3dd2c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f7d6288aeb38ff1b8af70ecf50a98258e8cd1bef +Subproject commit 1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87 diff --git a/opencv_extra b/opencv_extra index 0e3b933a..dd1fbd07 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 0e3b933aa762b28b54a40034c58f8c734f1ed759 +Subproject commit dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f diff --git a/pyproject.toml b/pyproject.toml index 270a25d1..71de7f9b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "cmake>=3.13", + "cmake>=3.1", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index edf813b4..48d5a65f 100644 --- a/setup.py +++ b/setup.py @@ -140,7 +140,7 @@ def main(): [ r"python/cv2/py.typed" ] if sys.version_info >= (3, 6) else [] , "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv5") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 3f50d3281f82d1c6733bbb2872adacca29995e12 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:07:30 +0300 Subject: [PATCH 14/23] Linux dependencies update (#1052) * Base manylinux2014 image update. * Use command line git to checkout repo instead of actions step. * Qt and others update. * Updated submodules to current 4.x branch. --- .github/workflows/build_wheels_linux.yml | 28 ++++++++++---------- .github/workflows/build_wheels_linux_arm.yml | 18 ++++++------- docker/manylinux2014/Dockerfile_aarch64 | 12 ++++----- docker/manylinux2014/Dockerfile_x86_64 | 12 ++++----- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- patches/patchQtPlugins | 2 +- travis_config.sh | 2 +- 9 files changed, 40 insertions(+), 40 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 746395e4..9df69240 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -41,7 +41,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -101,10 +101,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix @@ -139,7 +139,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -155,10 +155,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 928ded7d..bd5c0040 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -42,7 +42,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20240524 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20241202 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -103,10 +103,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 + run: | + echo "Source branch name: ${{ github.head_ref }}" + echo "Target branch name: ${{ github.base_ref }}" + git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index e19492ff..9a8bfdde 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,16 +1,16 @@ -# Version: 20240524 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.4 -ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.43 -ARG VPX_VERSION=v1.14.0 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.13 +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index eceae25e..088d8df5 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,16 +1,16 @@ -# Version: 20240524 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.4 -ARG FREETYPE_VERSION=2.13.2 -ARG LIBPNG_VERSION=1.6.43 -ARG VPX_VERSION=v1.14.0 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 ARG OPENSSL_VERSION=1_1_1w -ARG QT_VERSION=5.15.13 +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH diff --git a/opencv b/opencv index 71d3237a..03cedee0 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 71d3237a093b60a27601c20e9ee6c3e52154e8b1 +Subproject commit 03cedee0b0258875eafd1576b59d686ba805da7a diff --git a/opencv_contrib b/opencv_contrib index 1ed3dd2c..67337620 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 1ed3dd2c53888e3289afdb22ec4e9ebbff3dba87 +Subproject commit 673376203b0a8371a31ec5e8f08910a9744c0f32 diff --git a/opencv_extra b/opencv_extra index dd1fbd07..08fe33c7 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit dd1fbd0717ef4d83f86899b4144fdd9bc0364a5f +Subproject commit 08fe33c733cabec70ffb6e5eac49708b073e5277 diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index 70c6975a..b274aa08 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() + if(UNIX AND NOT APPLE) -+ install(DIRECTORY /opt/Qt5.15.13/plugins DESTINATION lib/qt) ++ install(DIRECTORY /opt/Qt5.15.16/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() if(HAVE_QT_OPENGL) diff --git a/travis_config.sh b/travis_config.sh index 903ceafb..fcdd4f60 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -34,7 +34,7 @@ if [ -n "$IS_OSX" ]; then export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" else echo " > Linux environment " - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.13/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.16/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then From b12aea12d288351b542a83d98333a35c95eb1dea Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 4 Dec 2024 11:10:09 +0300 Subject: [PATCH 15/23] Try to update to macos-13 to fix home brew dependencies. --- .github/workflows/build_wheels_macos.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 97df456e..6940cc55 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: macos-12 + runs-on: macos-13 defaults: run: shell: bash @@ -98,7 +98,7 @@ jobs: Test: needs: [Build] - runs-on: macos-12 + runs-on: macos-13 defaults: run: shell: bash From d23e79634dc0f6014b6b879d80626dd993a87705 Mon Sep 17 00:00:00 2001 From: Bill Clark Date: Thu, 12 Dec 2024 11:26:20 -0500 Subject: [PATCH 16/23] Update pyproject.toml Attempting to get building on 3.12 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 71de7f9b..10201b8c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,5 +9,6 @@ requires = [ "numpy>=2.0.0; python_version>='3.9'", "pip", "scikit-build>=0.14.0", - "setuptools==59.2.0", + "setuptools==59.2.0; python_version<'3.12'", + "setuptools<70.0.0; python_version>='3.12'", ] From ae90ee753908ae55fd3045719408441c6b18af67 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 24 Dec 2024 09:00:35 +0300 Subject: [PATCH 17/23] Submodules update to 4.11.0-pre --- .github/workflows/build_wheels_macos_m1.yml | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- setup.py | 6 ------ 5 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a3bcac63..dd119fcb 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ on: jobs: Build: - runs-on: python-macos11-m1 + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: diff --git a/opencv b/opencv index 03cedee0..b42075f3 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 03cedee0b0258875eafd1576b59d686ba805da7a +Subproject commit b42075f3e2c7eca4a12e55b32cfc95fa90982a21 diff --git a/opencv_contrib b/opencv_contrib index 67337620..3e776c87 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 673376203b0a8371a31ec5e8f08910a9744c0f32 +Subproject commit 3e776c876ef8527ad639d2c792521b6cede291e5 diff --git a/opencv_extra b/opencv_extra index 08fe33c7..a74cf6ba 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 08fe33c733cabec70ffb6e5eac49708b073e5277 +Subproject commit a74cf6bae7fd75d91282b877c559168b3a62148a diff --git a/setup.py b/setup.py index 48d5a65f..fd4181d0 100644 --- a/setup.py +++ b/setup.py @@ -115,12 +115,6 @@ def main(): else [] ) + - ( - [r"lib/libOrbbecSDK.dylib", r"lib/libOrbbecSDK.\d.\d.dylib", r"lib/libOrbbecSDK.\d.\d.\d.dylib"] - if platform.system() == "Darwin" and platform.machine() == "arm64" - else [] - ) - + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From ef9443d618d0b297b75c6cfb276beadcebf3dedc Mon Sep 17 00:00:00 2001 From: mayeut Date: Sat, 21 Sep 2024 21:22:52 +0200 Subject: [PATCH 18/23] fix: add CMake as a build requirement only if required The PyPI distribution of CMake shall not be listed as an unconditional build requirement. It shall only be added as a build requirement if not installed or too low a version. This helps building from sources on platforms where no wheels are available for CMake but the system already provides a recent enough CMake version. In case of error checking the version, the backend falls back to using the PyPI distribution of CMake. --- MANIFEST.in | 1 + _build_backend/backend.py | 23 +++++++++++++++++++++++ pyproject.toml | 6 +++++- 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 _build_backend/backend.py diff --git a/MANIFEST.in b/MANIFEST.in index b429eae0..cb9a7e7b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include README.md include find_version.py include setup.py include pyproject.toml +include _build_backend/backend.py recursive-include cv2 * recursive-include docker * recursive-include opencv * diff --git a/_build_backend/backend.py b/_build_backend/backend.py new file mode 100644 index 00000000..7fc84138 --- /dev/null +++ b/_build_backend/backend.py @@ -0,0 +1,23 @@ +from setuptools import build_meta as _orig + +prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel +build_wheel = _orig.build_wheel +build_sdist = _orig.build_sdist +get_requires_for_build_sdist = _orig.get_requires_for_build_sdist + +def get_requires_for_build_wheel(config_settings=None): + from packaging import version + from skbuild.exceptions import SKBuildError + from skbuild.cmaker import get_cmake_version + packages = _orig.get_requires_for_build_wheel(config_settings) + # check if system cmake can be used if present + # if not, append cmake PyPI distribution to required packages + # scikit-build>=0.18 itself requires cmake 3.5+ + min_version = "3.5" + try: + if version.parse(get_cmake_version().split("-")[0]) < version.parse(min_version): + packages.append(f'cmake>={min_version}') + except SKBuildError: + packages.append(f'cmake>={min_version}') + + return packages diff --git a/pyproject.toml b/pyproject.toml index 71de7f9b..7a37ec46 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,13 +1,17 @@ [build-system] requires = [ - "cmake>=3.1", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.5; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version<'3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<'3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", "numpy>=2.0.0; python_version>='3.9'", + "packaging", "pip", "scikit-build>=0.14.0", "setuptools==59.2.0", ] +# use a custom backend to manage CMake check / installation +# see https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version +build-backend = "backend" +backend-path = ["_build_backend"] From 02648ce49748032a78937c8cdb8c015577b9ff2a Mon Sep 17 00:00:00 2001 From: Zhanwen Chen Date: Fri, 14 Jun 2024 16:55:51 -0700 Subject: [PATCH 19/23] Fix Python Source RelPath for PY_LIMITED_API=OFF --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fd4181d0..4f50b3e3 100644 --- a/setup.py +++ b/setup.py @@ -118,8 +118,11 @@ def main(): # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. + # If not specifying PY_LIMITED_API, the Python sources go under python/cv2/python-3.MINOR_VERSION/ instead of python/cv2/python-3/ [ - r"python/cv2/python-%s/cv2.*" + r"python/cv2/python-%s*/cv2.*" + % (sys.version_info[0]) if 'CMAKE_ARGS' in os.environ and "-DPYTHON3_LIMITED_API=ON" in os.environ['CMAKE_ARGS'] + else r"python/cv2/python-%s.*/cv2.*" % (sys.version_info[0]) ] + From 5da0b6e74467b3be2bd297dbb565b30661c77ebf Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 13 Jan 2025 18:06:49 +0300 Subject: [PATCH 20/23] Add NASM assembler to Windows build for jpeg-turbo. --- .github/workflows/build_wheels_windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index d69f17ec..4469f7b9 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -59,6 +59,8 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe uses: microsoft/setup-msbuild@v1.1 + - name: Setup NASM + uses: ilammy/setup-nasm@v1 - name: Build a package # CMake 3.25 regression fix. See https://stackoverflow.com/questions/74162633/problem-compiling-from-source-opencv-with-mvsc2019-in-64-bit-version run: | From 58257dc9079d94afd319bd8b863dd884582ea6e0 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 9 Jan 2025 15:23:43 +0300 Subject: [PATCH 21/23] Switched to tag 4.11.0 --- .github/workflows/build_wheels_macos_m1.yml | 4 ++-- opencv | 2 +- opencv_contrib | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index dd119fcb..effc27fe 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -54,7 +54,7 @@ jobs: git submodule update --init multibuild echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - export MACOSX_DEPLOYMENT_TARGET=11.0 + export MACOSX_DEPLOYMENT_TARGET=13.0 python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* @@ -71,7 +71,7 @@ jobs: Test: needs: [Build] - runs-on: opencv-cn-mac-arm64-tests + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: diff --git a/opencv b/opencv index b42075f3..31b0eeea 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b42075f3e2c7eca4a12e55b32cfc95fa90982a21 +Subproject commit 31b0eeea0b44b370fd0712312df4214d4ae1b158 diff --git a/opencv_contrib b/opencv_contrib index 3e776c87..0e5254eb 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 3e776c876ef8527ad639d2c792521b6cede291e5 +Subproject commit 0e5254ebf54d2aed6e7eaf6660bf3b797cf50a02 From ca68df575d75c916097c642f5f0c508e38b7c2e7 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Wed, 15 Jan 2025 12:50:06 +0300 Subject: [PATCH 22/23] Python 3.13 support. --- .github/workflows/build_wheels_linux.yml | 6 +++--- .github/workflows/build_wheels_linux_arm.yml | 6 +++--- .github/workflows/build_wheels_macos.yml | 6 +++--- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- setup.py | 1 + 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 9df69240..653d4975 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: @@ -106,7 +106,7 @@ jobs: echo "Target branch name: ${{ github.base_ref }}" git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index bd5c0040..385f696d 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 @@ -108,7 +108,7 @@ jobs: echo "Target branch name: ${{ github.base_ref }}" git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 6940cc55..eb797d46 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -105,7 +105,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,7 +114,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.0.0 + NP_TEST_DEP_LATEST: numpy==2.2.1 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -134,7 +134,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index effc27fe..ffbdc752 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4469f7b9..bb7b548b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -91,7 +91,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/setup.py b/setup.py index 4f50b3e3..1dfab2fb 100644 --- a/setup.py +++ b/setup.py @@ -303,6 +303,7 @@ def main(): "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", From 28172087e47d6575ecd6853b2915e1e679f5fb6f Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Thu, 16 Jan 2025 11:08:39 +0300 Subject: [PATCH 23/23] Reverted back to Github actions checkout as self-made command does not handle releases. --- .github/workflows/build_wheels_linux.yml | 24 ++++++++++---------- .github/workflows/build_wheels_linux_arm.yml | 16 ++++++------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 653d4975..7bfe8cec 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -101,10 +101,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix @@ -155,10 +155,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 385f696d..d643ba8e 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -58,10 +58,10 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 - name: Build a package run: source scripts/build.sh - name: Saving all wheels @@ -103,10 +103,10 @@ jobs: run: find . -mindepth 1 -delete working-directory: ${{ github.workspace }} - name: Checkout - run: | - echo "Source branch name: ${{ github.head_ref }}" - echo "Target branch name: ${{ github.base_ref }}" - git clone --depth 1 --recurse-submodules -b "${{ github.head_ref }}" "https://github.com/${{ github.event.pull_request.head.repo.full_name }}" "${{ github.workspace }}" + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix