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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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/11] 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()