From 5b6855241e00920d3d28c462da22067be69b5dbb Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 08:53:14 +0300 Subject: [PATCH 01/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bb7b548b..ecd64ad7 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,12 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.2 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.2 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* From 0ed693265a9cb4e427a118c6f0a0c38519bab8e9 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 08:58:18 +0300 Subject: [PATCH 02/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ecd64ad7..cdad84c6 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,12 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3.1.2 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* From 43df361f8f39f55d5cbdf59647f56175152ed0c1 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 09:20:13 +0300 Subject: [PATCH 03/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 36 ++++++++++------------ 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cdad84c6..dbcb2e54 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -71,16 +71,12 @@ jobs: python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - - name: Saving all wheels + + - name: Upload built wheel uses: actions/upload-artifact@v4 - with: - name: wheels - path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} - path: wheelhouse/opencv* + with: + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-${{ github.run_id }}-${{ github.job }} + path: wheelhouse/opencv*.whl Test: needs: [Build] @@ -117,11 +113,12 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Download a wheel accordingly to matrix + + - name: Download all artifacts uses: actions/download-artifact@v3 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} - path: wheelhouse/ + with: + path: wheelhouse/ + - name: Package installation run: | cd ${{ github.workspace }}/tests @@ -148,10 +145,11 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - name: Download all wheels + uses: actions/download-artifact@v3 with: - name: wheels path: wheelhouse/ + - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine @@ -178,9 +176,9 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - name: Download all wheels + uses: actions/download-artifact@v3 with: - name: wheels path: wheelhouse/ - name: Upload all wheels run: | @@ -196,9 +194,9 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - name: Download all wheels + uses: actions/download-artifact@v3 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python run: | From 800c408fb8c7312091a098cedc41bd5825f568ee Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 09:22:31 +0300 Subject: [PATCH 04/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 197 ++++++++++----------- 1 file changed, 92 insertions(+), 105 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index dbcb2e54..40eab4d6 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -16,7 +16,6 @@ on: - cron: '0 3 * * 6' workflow_dispatch: - jobs: Build: runs-on: windows-2019 @@ -35,45 +34,50 @@ jobs: ENABLE_CONTRIB: ${{ matrix.with_contrib }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata steps: - - name: Cleanup - shell: bash - run: | - rm -rf ./* || true - rm -rf ./.??* || true - working-directory: ${{ github.workspace }} - - name: Setup environment - shell: bash - run: | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV - fi - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - 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: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install cmake==3.24.2 - python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt - set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v - shell: cmd - - - name: Upload built wheel - uses: actions/upload-artifact@v4 + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} + + - name: Setup environment + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi + + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + 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 + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install cmake==3.24.2 + python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v + shell: cmd + + - name: Upload built wheel + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-${{ github.run_id }}-${{ github.job }} path: wheelhouse/opencv*.whl @@ -97,44 +101,49 @@ jobs: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py steps: - - name: Cleanup - shell: bash - run: | - rm -rf ./* || true - rm -rf ./.??* || true - working-directory: ${{ github.workspace }} - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - - name: Download all artifacts - uses: actions/download-artifact@v3 + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} + + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Download all artifacts + uses: actions/download-artifact@v3 with: path: wheelhouse/ - - name: Package installation - run: | - cd ${{ github.workspace }}/tests - &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - python get_build_info.py - shell: powershell - - name: Run tests - run: | - cd ${{ github.workspace }}/opencv - python modules\python\test\test.py -v --repo . - - name: Pylint test - run: | - python -m pip install pylint==2.15.9 - cd ${{ github.workspace }}\tests - python -m pylint $PYLINT_TEST_FILE + - name: Find and install matching wheel + shell: powershell + run: | + $pattern = "wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-*" + $file = Get-ChildItem -Recurse wheelhouse | Where-Object { $_.Name -like "$pattern*.whl" } | Select-Object -First 1 + if (-not $file) { throw "No matching wheel found" } + & python -m pip install --user --no-warn-script-location $file.FullName + python get_build_info.py + + - name: Run tests + run: | + cd ${{ github.workspace }}/opencv + python modules\python\test\test.py -v --repo . + + - name: Pylint test + run: | + python -m pip install pylint==2.15.9 + cd ${{ github.workspace }}\tests + python -m pylint $PYLINT_TEST_FILE Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} @@ -150,22 +159,10 @@ jobs: with: 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 + - name: Upload wheels 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-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/**/*.whl Pre-release: if: github.event_name == 'release' && github.event.release.prerelease @@ -180,10 +177,11 @@ jobs: uses: actions/download-artifact@v3 with: path: wheelhouse/ - - name: Upload all wheels + + - name: Upload all wheels to Test PyPI run: | python -m pip install twine - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/**/*.whl Release: if: github.event_name == 'release' && !github.event.release.prerelease @@ -198,19 +196,8 @@ jobs: uses: actions/download-artifact@v3 with: path: wheelhouse/ - - name: Upload wheels for opencv_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless + + - name: Upload all wheels to PyPI run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/**/*.whl From d5099508f0d34619daab8fde560671607af3b686 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 10:52:57 +0300 Subject: [PATCH 05/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 225 +++++++++++---------- 1 file changed, 120 insertions(+), 105 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 40eab4d6..bb7b548b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -16,6 +16,7 @@ on: - cron: '0 3 * * 6' workflow_dispatch: + jobs: Build: runs-on: windows-2019 @@ -34,53 +35,52 @@ jobs: ENABLE_CONTRIB: ${{ matrix.with_contrib }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata steps: - - name: Cleanup - shell: bash - run: | - rm -rf ./* || true - rm -rf ./.??* || true - working-directory: ${{ github.workspace }} - - - name: Setup environment - shell: bash - run: | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV - fi - - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - 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 - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install cmake==3.24.2 - python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt - set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v - shell: cmd - - - name: Upload built wheel - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-${{ github.run_id }}-${{ github.job }} - path: wheelhouse/opencv*.whl + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} + - name: Setup environment + shell: bash + run: | + if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then + echo "ENABLE_ROLLING=1" >> $GITHUB_ENV + fi + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: false + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + 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: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install cmake==3.24.2 + python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v + shell: cmd + - name: Saving all wheels + uses: actions/upload-artifact@v3 + with: + name: wheels + path: wheelhouse/opencv*.whl + - name: Saving a wheel accordingly to matrix + 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] @@ -101,49 +101,43 @@ jobs: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py steps: - - name: Cleanup - shell: bash - run: | - rm -rf ./* || true - rm -rf ./.??* || true - working-directory: ${{ github.workspace }} - - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - - name: Download all artifacts - uses: actions/download-artifact@v3 - with: - path: wheelhouse/ - - - name: Find and install matching wheel - shell: powershell - run: | - $pattern = "wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }}-*" - $file = Get-ChildItem -Recurse wheelhouse | Where-Object { $_.Name -like "$pattern*.whl" } | Select-Object -First 1 - if (-not $file) { throw "No matching wheel found" } - & python -m pip install --user --no-warn-script-location $file.FullName - python get_build_info.py - - - name: Run tests - run: | - cd ${{ github.workspace }}/opencv - python modules\python\test\test.py -v --repo . - - - name: Pylint test - run: | - python -m pip install pylint==2.15.9 - cd ${{ github.workspace }}\tests - python -m pylint $PYLINT_TEST_FILE + - name: Cleanup + shell: bash + run: | + rm -rf ./* || true + rm -rf ./.??* || true + working-directory: ${{ github.workspace }} + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + - name: Download a wheel accordingly to matrix + uses: actions/download-artifact@v3 + with: + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + path: wheelhouse/ + - name: Package installation + run: | + cd ${{ github.workspace }}/tests + &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") + if ($LastExitCode -ne 0) {throw $LastExitCode} + python get_build_info.py + shell: powershell + - name: Run tests + run: | + cd ${{ github.workspace }}/opencv + python modules\python\test\test.py -v --repo . + - name: Pylint test + run: | + python -m pip install pylint==2.15.9 + cd ${{ github.workspace }}\tests + python -m pylint $PYLINT_TEST_FILE Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} @@ -154,15 +148,26 @@ jobs: run: shell: bash steps: - - name: Download all wheels - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v3 with: + name: wheels path: wheelhouse/ - - - name: Upload wheels + - 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/**/*.whl + 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 @@ -173,15 +178,14 @@ jobs: run: shell: bash steps: - - name: Download all wheels - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v3 with: + name: wheels path: wheelhouse/ - - - name: Upload all wheels to Test PyPI + - 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/**/*.whl + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* Release: if: github.event_name == 'release' && !github.event.release.prerelease @@ -192,12 +196,23 @@ jobs: run: shell: bash steps: - - name: Download all wheels - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v3 with: + name: wheels path: wheelhouse/ - - - name: Upload all wheels to PyPI + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + - name: Upload wheels for opencv_contrib_python_headless run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/**/*.whl + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* From 81b57ade406779a52a48a29c255edf8b12721b85 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 11:00:54 +0300 Subject: [PATCH 06/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bb7b548b..636fbe88 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,12 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* @@ -118,7 +118,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -148,7 +148,7 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -178,7 +178,7 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -196,7 +196,7 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ From cf6f2a1052049cfd654c49f89072e0ecfb081087 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 11:19:59 +0300 Subject: [PATCH 07/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 636fbe88..1e8d65de 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -74,7 +74,7 @@ jobs: - name: Saving all wheels uses: actions/upload-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v4 @@ -150,7 +150,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - name: Upload wheels for opencv_python_rolling run: | @@ -180,7 +180,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - name: Upload all wheels run: | @@ -198,7 +198,7 @@ jobs: steps: - uses: actions/download-artifact@v4 with: - name: wheels + name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - name: Upload wheels for opencv_python run: | From ce9020fdb5ee7c7f3b337b6f147c058a78dd1a92 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 11:45:47 +0300 Subject: [PATCH 08/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 1e8d65de..035acec0 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -142,7 +142,7 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: @@ -172,7 +172,7 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: @@ -190,7 +190,7 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: From 5da97acb2c7e6998dae354b5e2c0287748b32f3c Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 20:36:47 +0300 Subject: [PATCH 09/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 035acec0..bb7b548b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,12 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: - name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* @@ -118,7 +118,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ @@ -142,15 +142,15 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 environment: opencv-python-rolling-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: - name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python_rolling run: | @@ -172,15 +172,15 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: - name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + name: wheels path: wheelhouse/ - name: Upload all wheels run: | @@ -190,15 +190,15 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 environment: opencv-python-release defaults: run: shell: bash steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: - name: wheels-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python run: | From 02ffc4a0b08dd1cc089cfd3a37b500d282c2e9f0 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 20:37:26 +0300 Subject: [PATCH 10/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bb7b548b..a194b172 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,12 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: wheels path: wheelhouse/opencv*.whl - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3.1.3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* From 62aa42cf8e5c44aba8e5cdfbf54841baead1f5c9 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 20:45:27 +0300 Subject: [PATCH 11/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index a194b172..eea53c81 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -72,12 +72,7 @@ jobs: set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels - uses: actions/upload-artifact@v3.1.3 - with: - name: wheels - path: wheelhouse/opencv*.whl - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v3.1.3 + uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/opencv* @@ -148,9 +143,8 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python_rolling run: | @@ -178,9 +172,8 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload all wheels run: | @@ -196,9 +189,8 @@ jobs: run: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: - name: wheels path: wheelhouse/ - name: Upload wheels for opencv_python run: | From 3f50ff6391e3f2dbbe7a8cef13c8a855c6c37d3c Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 21:03:44 +0300 Subject: [PATCH 12/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index eea53c81..4c95586d 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -113,7 +113,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ From 24e5192378b85d57ccd3bfc377fc3df205c43092 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 21:28:34 +0300 Subject: [PATCH 13/14] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4c95586d..a1a36ff8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -137,7 +137,7 @@ jobs: Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-rolling-release defaults: run: @@ -166,7 +166,7 @@ jobs: Pre-release: if: github.event_name == 'release' && github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: test-opencv-python-release defaults: run: @@ -183,7 +183,7 @@ jobs: Release: if: github.event_name == 'release' && !github.event.release.prerelease needs: [Build, Test] - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 environment: opencv-python-release defaults: run: From af76f7a3548ff143b87bf185d51c7065dce7123b Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 13 May 2025 20:32:55 +0300 Subject: [PATCH 14/14] Update setup.py --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 1dfab2fb..72ad485c 100644 --- a/setup.py +++ b/setup.py @@ -193,6 +193,7 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", + "-DWITH_MSMF=OFF", ] + ( # CMake flags for windows/arm64 build