From 5b6855241e00920d3d28c462da22067be69b5dbb Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 12 May 2025 08:53:14 +0300 Subject: [PATCH 001/109] 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 002/109] 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 003/109] 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 004/109] 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 005/109] 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 006/109] 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 007/109] 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 008/109] 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 009/109] 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 010/109] 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 011/109] 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 012/109] 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 013/109] 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 014/109] 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 From 8e63c5b47cda57f7dfa074e61d61199e50898ee4 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 18 May 2025 15:45:18 +0300 Subject: [PATCH 015/109] Update setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 72ad485c..1dfab2fb 100644 --- a/setup.py +++ b/setup.py @@ -193,7 +193,6 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", - "-DWITH_MSMF=OFF", ] + ( # CMake flags for windows/arm64 build From 67bf0aa977d058f37fc0e5bff3511670f0ab22db Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Fri, 30 May 2025 09:56:48 +0300 Subject: [PATCH 016/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 27 ++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index a1a36ff8..735f3a9e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -41,36 +41,59 @@ jobs: 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: Setup OpenBLAS + run: | + mkdir openblas + cd openblas + curl -o OpenBLAS-0.3.24.zip https://altushost-swe.dl.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-${{ matrix.platform }}.zip + tar -xf OpenBLAS-0.3.24.zip || unzip OpenBLAS-0.3.24.zip + set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" + set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" + if exist %OpenBLAS_HOME%\\bin\\libopenblas.dll ( + copy /y %OpenBLAS_HOME%\\bin\\libopenblas.dll %OpenBLAS_HOME%\\bin\\libopenblas.exp.dll + ) + dir %OpenBLAS_HOME%\\bin + shell: cmd + - 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 + set "CI_BUILD=1" + set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" + set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" + 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 with: From 66d74ac48a26fee8b9209ea8eada41049c813bc1 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Fri, 30 May 2025 10:06:21 +0300 Subject: [PATCH 017/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 32 ++++++++++++++++------ 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 735f3a9e..06fbce5d 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -68,18 +68,34 @@ jobs: uses: ilammy/setup-nasm@v1 - name: Setup OpenBLAS + shell: cmd run: | + setlocal enableextensions enabledelayedexpansion + + rem Determine correct architecture + if "${{ matrix.platform }}"=="x64" ( + set ARCH=x64 + ) else ( + set ARCH=x86 + ) + + echo Using architecture: %ARCH% + mkdir openblas cd openblas - curl -o OpenBLAS-0.3.24.zip https://altushost-swe.dl.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-${{ matrix.platform }}.zip - tar -xf OpenBLAS-0.3.24.zip || unzip OpenBLAS-0.3.24.zip - set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" - set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - if exist %OpenBLAS_HOME%\\bin\\libopenblas.dll ( - copy /y %OpenBLAS_HOME%\\bin\\libopenblas.dll %OpenBLAS_HOME%\\bin\\libopenblas.exp.dll + curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip + powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." + + set "OpenBLAS_HOME=%CD%" + set "PATH=%OpenBLAS_HOME%\bin;%PATH%" + + if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( + copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll ) - dir %OpenBLAS_HOME%\\bin - shell: cmd + + echo Finished OpenBLAS setup + dir %OpenBLAS_HOME%\bin + - name: Build a package run: | From 355cef3d5601cf717362f05d113920faeef3815a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Fri, 30 May 2025 10:17:42 +0300 Subject: [PATCH 018/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 06fbce5d..bdf01fb6 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -107,6 +107,7 @@ jobs: set "CI_BUILD=1" set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" + set "CMAKE_ARGS=-DLAPACK=ON -DLAPACK_IMPL=OpenBLAS -DOpenBLAS_LIB=%OpenBLAS_HOME%\\lib\\libopenblas.lib -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include" python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From 5e3b12be32c51bc418302ddb06002be40230b856 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 13:41:26 +0300 Subject: [PATCH 019/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bdf01fb6..52d16ab9 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -104,10 +104,12 @@ jobs: 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" set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - set "CMAKE_ARGS=-DLAPACK=ON -DLAPACK_IMPL=OpenBLAS -DOpenBLAS_LIB=%OpenBLAS_HOME%\\lib\\libopenblas.lib -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" + python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From 42f1137a022276843fde00ac4e14e7ff0c7f4075 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 13:50:00 +0300 Subject: [PATCH 020/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 52d16ab9..52472d20 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -108,7 +108,14 @@ jobs: set "CI_BUILD=1" set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" + set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" + set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" + set "OpenBLAS_LIB=%OpenBLAS_HOME%\\lib\\libopenblas.lib" + set "OpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" + set "OpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include" + set "OpenBLAS_INCLUDE_DIRS=%OpenBLAS_HOME%\\include" + set "BLAS_LIBRARIES=%OpenBLAS_LIB%" + set "LAPACK_LIBRARIES=%OpenBLAS_LIB%" python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From 24eb05049f103551d4d04f66f4023bede30703d5 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:02:01 +0300 Subject: [PATCH 021/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 52472d20..50bfcbcd 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -95,6 +95,9 @@ jobs: echo Finished OpenBLAS setup dir %OpenBLAS_HOME%\bin + dir %OpenBLAS_HOME%\lib + dir %OpenBLAS_HOME% + dir %OpenBLAS_HOME%\include - name: Build a package From 757388dc9d04a79be6c9203d515c286859b0d549 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:07:24 +0300 Subject: [PATCH 022/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 50bfcbcd..c76de746 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -75,14 +75,16 @@ jobs: rem Determine correct architecture if "${{ matrix.platform }}"=="x64" ( set ARCH=x64 + set FOLDER=win64 ) else ( set ARCH=x86 + set FOLDER=win32 ) echo Using architecture: %ARCH% - mkdir openblas - cd openblas + mkdir %FOLDER% + cd %FOLDER% curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." From 670397e16cb7b9a17036247b6dbc55339ac8a47c Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:29:39 +0300 Subject: [PATCH 023/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index c76de746..42c5389b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -82,7 +82,8 @@ jobs: ) echo Using architecture: %ARCH% - + mkdir openblas + cd openblas mkdir %FOLDER% cd %FOLDER% curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip @@ -109,18 +110,6 @@ jobs: 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" - set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" - set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" - set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - set "OpenBLAS_LIB=%OpenBLAS_HOME%\\lib\\libopenblas.lib" - set "OpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" - set "OpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include" - set "OpenBLAS_INCLUDE_DIRS=%OpenBLAS_HOME%\\include" - set "BLAS_LIBRARIES=%OpenBLAS_LIB%" - set "LAPACK_LIBRARIES=%OpenBLAS_LIB%" python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From 4204e30f32e1619fe62e20aea2e71bf75c5ceab4 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:34:45 +0300 Subject: [PATCH 024/109] Update setup.py --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 1dfab2fb..dc5651eb 100644 --- a/setup.py +++ b/setup.py @@ -115,6 +115,12 @@ def main(): else [] ) + + ( + [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.exp.dll").replace("\\", "\\\\")] + if os.name == "nt" and "OpenBLAS_HOME" in os.environ + else [] + ) + + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From addeb8d41fe31df363dd22c9c5f5bf1fd8cdf947 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:39:40 +0300 Subject: [PATCH 025/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 42c5389b..7bb06890 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -84,8 +84,6 @@ jobs: echo Using architecture: %ARCH% mkdir openblas cd openblas - mkdir %FOLDER% - cd %FOLDER% curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." From ef3b72037c6f033e272011213d926aeabe09272a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:45:12 +0300 Subject: [PATCH 026/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 7bb06890..999cd0aa 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -84,6 +84,8 @@ jobs: echo Using architecture: %ARCH% mkdir openblas cd openblas + mkdir %FOLDER% + cd %FOLDER% curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." @@ -108,7 +110,10 @@ jobs: 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" + set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" + set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From b3190f6f567f406e2115801c000b7022253b06de Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 14:52:04 +0300 Subject: [PATCH 027/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 999cd0aa..01448554 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -84,8 +84,6 @@ jobs: echo Using architecture: %ARCH% mkdir openblas cd openblas - mkdir %FOLDER% - cd %FOLDER% curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." From ee04bc6c67d0cdd4e75a95f5d2d06898f2bf53e3 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:00:14 +0300 Subject: [PATCH 028/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 01448554..ed5a3795 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,6 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" + powershell -Command "(Get-Content cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content cmake/openblas/OpenBLASConfig.cmake" if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From 83443a55078992149a75fc45ca03f614d24eacd5 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:03:32 +0300 Subject: [PATCH 029/109] 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 ed5a3795..41c2cdaa 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content cmake/openblas/OpenBLASConfig.cmake" + powershell -Command "(Get-Content /lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content /lib/cmake/openblas/OpenBLASConfig.cmake" if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From bb837964c48e343d0c13a805db7077d87cb4749c Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:04:56 +0300 Subject: [PATCH 030/109] 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 41c2cdaa..1aca457b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content /lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content /lib/cmake/openblas/OpenBLASConfig.cmake" + powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From b3c51cf9f0ffdc97ae6c5103c880704d7bca2795 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:16:21 +0300 Subject: [PATCH 031/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 1aca457b..a300b4ec 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,12 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'include' -replace 'win64/include', 'include' -replace 'win32/bin', 'bin' -replace 'win64/bin', 'bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" + powershell -Command ^ + "$base = Resolve-Path .; " + ` + "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; " + ` + "$fullInclude = Join-Path $base 'include'; " + ` + "$fullLib = Join-Path $base 'bin/libopenblas.dll'; " + ` + "(Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From 4c7835498597907c1c12d5b8109e87d58bc013e0 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:18:18 +0300 Subject: [PATCH 032/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index a300b4ec..b94b4839 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,12 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command ^ - "$base = Resolve-Path .; " + ` - "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; " + ` - "$fullInclude = Join-Path $base 'include'; " + ` - "$fullLib = Join-Path $base 'bin/libopenblas.dll'; " + ` - "(Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" + powershell -Command "$base = Resolve-Path .; $cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude = Join-Path $base 'include'; $fullLib = Join-Path $base 'bin/libopenblas.dll'; (Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From 067d7f39cabc13041f59c1bcbb1b03b3db0922d6 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:21:11 +0300 Subject: [PATCH 033/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b94b4839..726ca684 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,9 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$base = Resolve-Path .; $cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude = Join-Path $base 'include'; $fullLib = Join-Path $base 'bin/libopenblas.dll'; (Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" + powershell -Command "$base = Resolve-Path .; $cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude = (Join-Path $base 'include').Replace('\','/'); $fullLib = (Join-Path $base 'bin/libopenblas.dll').Replace('\','/'); $content = Get-Content $cfg; $content = $content -replace 'SET\(OpenBLAS_INCLUDE_DIRS.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content = $content -replace 'SET\(OpenBLAS_LIBRARIES.*?\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" + type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake + if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll From 796142ae1ff318411e20e3758e60ad4cbd0d3896 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:24:53 +0300 Subject: [PATCH 034/109] 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 726ca684..4b99fb9b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$base = Resolve-Path .; $cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude = (Join-Path $base 'include').Replace('\','/'); $fullLib = (Join-Path $base 'bin/libopenblas.dll').Replace('\','/'); $content = Get-Content $cfg; $content = $content -replace 'SET\(OpenBLAS_INCLUDE_DIRS.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content = $content -replace 'SET\(OpenBLAS_LIBRARIES.*?\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" + powershell -Command "$base=Resolve-Path .; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude=(Join-Path $base 'include').Replace('\','\\'); $fullLib=(Join-Path $base 'bin\\libopenblas.dll').Replace('\','\\'); $content=Get-Content $cfg -Raw; $content=$content -replace 'SET\(OpenBLAS_INCLUDE_DIRS.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content=$content -replace 'SET\(OpenBLAS_LIBRARIES.*?\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From efd18067e8a31261e96d8a54bdadba9fe0a5e568 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:28:47 +0300 Subject: [PATCH 035/109] 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 4b99fb9b..985b5d2c 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$base=Resolve-Path .; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude=(Join-Path $base 'include').Replace('\','\\'); $fullLib=(Join-Path $base 'bin\\libopenblas.dll').Replace('\','\\'); $content=Get-Content $cfg -Raw; $content=$content -replace 'SET\(OpenBLAS_INCLUDE_DIRS.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content=$content -replace 'SET\(OpenBLAS_LIBRARIES.*?\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" + powershell -Command "$base=Resolve-Path .; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude=Join-Path $base 'include' -replace '\\','/'; $fullLib=Join-Path $base 'bin/libopenblas.dll' -replace '\\','/'; (Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From f911d5c8ea58dc631c6bd48ad30e815fe2ff96d1 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:31:48 +0300 Subject: [PATCH 036/109] 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 985b5d2c..329fcdb4 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$base=Resolve-Path .; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $fullInclude=Join-Path $base 'include' -replace '\\','/'; $fullLib=Join-Path $base 'bin/libopenblas.dll' -replace '\\','/'; (Get-Content $cfg) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")' | Set-Content $cfg" + powershell -Command "$base=Resolve-Path .; $fullInclude=($fullIncludePath=Join-Path $base 'include') -replace '\\','/'; $fullLib=($fullLibPath=Join-Path $base 'bin/libopenblas.dll') -replace '\\','/'; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $content=Get-Content $cfg -Raw; $content=$content -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content=$content -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From 1fe589cc7c21d1123ce297196a8d2775d02d5f62 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:33:49 +0300 Subject: [PATCH 037/109] 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 329fcdb4..f76ddaf1 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$base=Resolve-Path .; $fullInclude=($fullIncludePath=Join-Path $base 'include') -replace '\\','/'; $fullLib=($fullLibPath=Join-Path $base 'bin/libopenblas.dll') -replace '\\','/'; $cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $content=Get-Content $cfg -Raw; $content=$content -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $fullInclude + '\")'; $content=$content -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $fullLib + '\")'; Set-Content $cfg $content" + powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $includePath='D:/a/opencv-python/opencv-python/openblas/include'; $libPath='D:/a/opencv-python/opencv-python/openblas/bin/libopenblas.dll'; (Get-Content $cfg -Raw) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $includePath + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $libPath + '\")' | Set-Content $cfg" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From b7c288ec094efffe9c5a33de203a9be9a2c98ef4 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:37:05 +0300 Subject: [PATCH 038/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f76ddaf1..21f3d871 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,8 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $includePath='D:/a/opencv-python/opencv-python/openblas/include'; $libPath='D:/a/opencv-python/opencv-python/openblas/bin/libopenblas.dll'; (Get-Content $cfg -Raw) -replace 'SET\\(OpenBLAS_INCLUDE_DIRS.*?\\)', 'SET(OpenBLAS_INCLUDE_DIRS \"' + $includePath + '\")' -replace 'SET\\(OpenBLAS_LIBRARIES.*?\\)', 'SET(OpenBLAS_LIBRARIES \"' + $libPath + '\")' | Set-Content $cfg" + powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin', 'D:/a/opencv-python/opencv-python/openblas/bin' -replace 'win64/bin', 'D:/a/opencv-python/opencv-python/openblas/bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" + type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From a10962c423c983bcac4378f3065f48712a12fb87 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:42:39 +0300 Subject: [PATCH 039/109] 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 21f3d871..d4c608bf 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin', 'D:/a/opencv-python/opencv-python/openblas/bin' -replace 'win64/bin', 'D:/a/opencv-python/opencv-python/openblas/bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" + powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/bin' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From 1de8fbbe7e35aced3de0c57f30bdb434a73fcde2 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:43:44 +0300 Subject: [PATCH 040/109] 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 d4c608bf..205f9105 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/bin' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/bin' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" + powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From 60b788cef45cb7356433b72be2731b1174264800 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:48:22 +0300 Subject: [PATCH 041/109] 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 205f9105..56c1eef9 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" + powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib/libopenblas.lib' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib/libopenblas.lib' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From c80b56fc3e9575df1e1b4b83326ac913fccfb31f Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:55:07 +0300 Subject: [PATCH 042/109] 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 56c1eef9..06f91bf9 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,8 +89,8 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "(Get-Content lib/cmake/openblas/OpenBLASConfig.cmake) -replace 'win32/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win64/include', 'D:/a/opencv-python/opencv-python/openblas/include' -replace 'win32/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib/libopenblas.lib' -replace 'win64/bin/libopenblas.dll', 'D:/a/opencv-python/opencv-python/openblas/lib/libopenblas.lib' | Set-Content lib/cmake/openblas/OpenBLASConfig.cmake" - + powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $inc=$env:OpenBLAS_HOME + '/include'; $lib=$env:OpenBLAS_HOME + '/lib/libopenblas.lib'; (Get-Content $cfg -Raw) -replace 'SET\(OpenBLAS_INCLUDE_DIRS .*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')' -replace 'SET\(OpenBLAS_LIBRARIES .*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')' | Set-Content $cfg" + type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From 03b05e65e6e7b7bca84ccd3f5e4671e1d5d3ec84 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 15:57:33 +0300 Subject: [PATCH 043/109] 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 06f91bf9..0829e3b4 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,8 +89,8 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $inc=$env:OpenBLAS_HOME + '/include'; $lib=$env:OpenBLAS_HOME + '/lib/libopenblas.lib'; (Get-Content $cfg -Raw) -replace 'SET\(OpenBLAS_INCLUDE_DIRS .*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')' -replace 'SET\(OpenBLAS_LIBRARIES .*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')' | Set-Content $cfg" - + powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $inc=$env:OpenBLAS_HOME + '/include'; $lib=$env:OpenBLAS_HOME + '/lib/libopenblas.lib'; $content = Get-Content $cfg -Raw; $content = $content -replace 'SET\(OpenBLAS_INCLUDE_DIRS .*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')'; $content = $content -replace 'SET\(OpenBLAS_LIBRARIES .*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')'; Set-Content $cfg $content" + type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From 46d9f3609c9cdb354e79a8f1205679f9d543c65f Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:00:51 +0300 Subject: [PATCH 044/109] 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 0829e3b4..ba14ae9f 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$cfg='lib/cmake/openblas/OpenBLASConfig.cmake'; $inc=$env:OpenBLAS_HOME + '/include'; $lib=$env:OpenBLAS_HOME + '/lib/libopenblas.lib'; $content = Get-Content $cfg -Raw; $content = $content -replace 'SET\(OpenBLAS_INCLUDE_DIRS .*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')'; $content = $content -replace 'SET\(OpenBLAS_LIBRARIES .*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')'; Set-Content $cfg $content" + powershell -Command "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $inc = Join-Path $env:OpenBLAS_HOME 'include' -Resolve; $lib = Join-Path $env:OpenBLAS_HOME 'lib/libopenblas.lib' -Resolve; $inc = $inc -replace '\\','/'; $lib = $lib -replace '\\','/'; $txt = Get-Content $cfg -Raw; $txt = $txt -replace 'SET\(OpenBLAS_INCLUDE_DIRS\s+.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')'; $txt = $txt -replace 'SET\(OpenBLAS_LIBRARIES\s+.*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')'; Set-Content $cfg $txt" type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From ad20fe5cf47558eae1c7df39bf37f48ed26ecacd Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:02:42 +0300 Subject: [PATCH 045/109] 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 ba14ae9f..4c75f5eb 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,8 +89,8 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $inc = Join-Path $env:OpenBLAS_HOME 'include' -Resolve; $lib = Join-Path $env:OpenBLAS_HOME 'lib/libopenblas.lib' -Resolve; $inc = $inc -replace '\\','/'; $lib = $lib -replace '\\','/'; $txt = Get-Content $cfg -Raw; $txt = $txt -replace 'SET\(OpenBLAS_INCLUDE_DIRS\s+.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + $inc + ')'; $txt = $txt -replace 'SET\(OpenBLAS_LIBRARIES\s+.*?\)', 'SET(OpenBLAS_LIBRARIES ' + $lib + ')'; Set-Content $cfg $txt" - + powershell -Command "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $inc = (Join-Path $env:OpenBLAS_HOME 'include') -replace '\\','/'; $lib = (Join-Path $env:OpenBLAS_HOME 'lib/libopenblas.lib') -replace '\\','/'; $txt = Get-Content $cfg -Raw; $txt = $txt -replace 'SET\(OpenBLAS_INCLUDE_DIRS\s+.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + \"`\"$inc`\"\" + ')'; $txt = $txt -replace 'SET\(OpenBLAS_LIBRARIES\s+.*?\)', 'SET(OpenBLAS_LIBRARIES ' + \"`\"$lib`\"\" + ')'; Set-Content $cfg $txt" + type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake From ea199ff7a919f81d1f5561120e1cc60693e4b0ac Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:11:22 +0300 Subject: [PATCH 046/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4c75f5eb..0708ea0e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,11 +89,6 @@ jobs: set "OpenBLAS_HOME=%CD%" set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - powershell -Command "$cfg = 'lib/cmake/openblas/OpenBLASConfig.cmake'; $inc = (Join-Path $env:OpenBLAS_HOME 'include') -replace '\\','/'; $lib = (Join-Path $env:OpenBLAS_HOME 'lib/libopenblas.lib') -replace '\\','/'; $txt = Get-Content $cfg -Raw; $txt = $txt -replace 'SET\(OpenBLAS_INCLUDE_DIRS\s+.*?\)', 'SET(OpenBLAS_INCLUDE_DIRS ' + \"`\"$inc`\"\" + ')'; $txt = $txt -replace 'SET\(OpenBLAS_LIBRARIES\s+.*?\)', 'SET(OpenBLAS_LIBRARIES ' + \"`\"$lib`\"\" + ')'; Set-Content $cfg $txt" - - type D:\a\opencv-python\opencv-python\openblas\lib\cmake\openblas\OpenBLASConfig.cmake - - if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll ) @@ -112,10 +107,8 @@ jobs: 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" - set "OpenBLAS_HOME=${{ github.workspace }}\\openblas" - set "PATH=%OpenBLAS_HOME%\\bin;%PATH%" - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\\lib\\libopenblas.lib" + + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\lib\libopenblas.lib" python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From a44713869df760a477a3d5dec86c85fc54c31ff0 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:17:58 +0300 Subject: [PATCH 047/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0708ea0e..fca05821 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -108,7 +108,9 @@ jobs: 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 "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\lib\libopenblas.lib" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\bin\libopenblas.dll" + echo %OpenBLAS_HOME% + echo %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From c62730def422c472ff35380d82925f567134fb8a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:21:34 +0300 Subject: [PATCH 048/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 26 +++++++--------------- 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index fca05821..f27d7871 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -67,9 +67,14 @@ jobs: - name: Setup NASM uses: ilammy/setup-nasm@v1 - - name: Setup OpenBLAS - shell: cmd + - 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 + setlocal enableextensions enabledelayedexpansion rem Determine correct architecture @@ -92,22 +97,7 @@ jobs: if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll ) - - echo Finished OpenBLAS setup - dir %OpenBLAS_HOME%\bin - dir %OpenBLAS_HOME%\lib - dir %OpenBLAS_HOME% - dir %OpenBLAS_HOME%\include - - - - 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 "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\bin\libopenblas.dll" echo %OpenBLAS_HOME% echo %CMAKE_ARGS% From c0546f804f12a075709855c45e80538c157d1af7 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:28:45 +0300 Subject: [PATCH 049/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 45 +++++++++++++--------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index f27d7871..d239f583 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -67,40 +67,49 @@ jobs: - name: Setup NASM uses: ilammy/setup-nasm@v1 - - name: Build a package + - name: Setup OpenBLAS + shell: cmd 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 - setlocal enableextensions enabledelayedexpansion rem Determine correct architecture - if "${{ matrix.platform }}"=="x64" ( + if "%{matrix.platform}%"=="x64" ( set ARCH=x64 set FOLDER=win64 - ) else ( - set ARCH=x86 - set FOLDER=win32 - ) + ) else ( + set ARCH=x86 + set FOLDER=win32 + ) - echo Using architecture: %ARCH% mkdir openblas cd openblas curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." set "OpenBLAS_HOME=%CD%" + echo OpenBLAS_HOME=%OpenBLAS_HOME% set "PATH=%OpenBLAS_HOME%\bin;%PATH%" + if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( - copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll - ) - + copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll + ) + + echo Finished OpenBLAS setup + cd .. + echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd + + - name: Build a package + run: | + call set_openblas_env.cmd + 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 + + echo Using OpenBLAS_HOME=%OpenBLAS_HOME% set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\bin\libopenblas.dll" - echo %OpenBLAS_HOME% - echo %CMAKE_ARGS% + echo CMAKE_ARGS: %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From aeddb7252e5d15b7c2ab522fa12297fea53b2d0d Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:36:33 +0300 Subject: [PATCH 050/109] 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 d239f583..b9865777 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -108,7 +108,7 @@ 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 echo Using OpenBLAS_HOME=%OpenBLAS_HOME% - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME%\include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME%\bin\libopenblas.dll" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME:/=/%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME:/=/%/bin/libopenblas.dll" echo CMAKE_ARGS: %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From d649b220513d8a4ded86eefddcc56af56c02d845 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:39:06 +0300 Subject: [PATCH 051/109] 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 b9865777..c8ab2c5e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -108,7 +108,7 @@ 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 echo Using OpenBLAS_HOME=%OpenBLAS_HOME% - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME:/=/%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME:/=/%/bin/libopenblas.dll" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME:/=/%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME:/=/%/lib/libopenblas.lib" echo CMAKE_ARGS: %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From 19a231a44ef250f9269d936f52a8c9da0fb37567 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:41:02 +0300 Subject: [PATCH 052/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index c8ab2c5e..4ca5613a 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -107,9 +107,10 @@ jobs: 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 - echo Using OpenBLAS_HOME=%OpenBLAS_HOME% - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME:/=/%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME:/=/%/lib/libopenblas.lib" - echo CMAKE_ARGS: %CMAKE_ARGS% + set "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" + echo %CMAKE_ARGS% + python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd From bfdddeef7b229101a3f523a7ee9106abf1a7dfb1 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 16:55:00 +0300 Subject: [PATCH 053/109] Update setup.py --- setup.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.py b/setup.py index dc5651eb..1dfab2fb 100644 --- a/setup.py +++ b/setup.py @@ -115,12 +115,6 @@ def main(): else [] ) + - ( - [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.exp.dll").replace("\\", "\\\\")] - if os.name == "nt" and "OpenBLAS_HOME" in os.environ - else [] - ) - + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From 3f57a1274a75ebbd3a9f5aa8b4e09e36319928c8 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Sun, 1 Jun 2025 17:49:06 +0300 Subject: [PATCH 054/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4ca5613a..0927528e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,6 +162,7 @@ jobs: path: wheelhouse/ - name: Package installation run: | + set "PATH=%GITHUB_WORKSPACE%\openblas\bin;%PATH%" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 659fd785aadc16270350ac7ed6e38d744eaa6b45 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 12:52:53 +0300 Subject: [PATCH 055/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0927528e..cc0f691a 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -19,7 +19,7 @@ on: jobs: Build: - runs-on: windows-2019 + runs-on: windows-2022 strategy: fail-fast: false matrix: @@ -122,7 +122,7 @@ jobs: Test: needs: [Build] - runs-on: windows-2019 + runs-on: windows-2022 defaults: run: shell: cmd @@ -162,6 +162,7 @@ jobs: path: wheelhouse/ - name: Package installation run: | + dir %GITHUB_WORKSPACE%\openblas\bin set "PATH=%GITHUB_WORKSPACE%\openblas\bin;%PATH%" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") From 7c9bbea0585ef10932ee8d3157a4a390fc4c600a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 13:22:48 +0300 Subject: [PATCH 056/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cc0f691a..eb83d486 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,6 +162,7 @@ jobs: path: wheelhouse/ - name: Package installation run: | + set "GITHUB_WORKSPACE=%CD%" dir %GITHUB_WORKSPACE%\openblas\bin set "PATH=%GITHUB_WORKSPACE%\openblas\bin;%PATH%" cd ${{ github.workspace }}/tests From d5718fb06e5d10a0f19989a8cad37a574233f319 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 13:49:58 +0300 Subject: [PATCH 057/109] 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 eb83d486..a7644c2b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,9 +162,9 @@ jobs: path: wheelhouse/ - name: Package installation run: | - set "GITHUB_WORKSPACE=%CD%" - dir %GITHUB_WORKSPACE%\openblas\bin - set "PATH=%GITHUB_WORKSPACE%\openblas\bin;%PATH%" + set "OpenBLAS_HOME=%CD%" + echo OpenBLAS_HOME=%OpenBLAS_HOME% + set "PATH=%OpenBLAS_HOME%\openblas\bin;%PATH%" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 3e4312c79f37749abbaa94da8b77bb91f47ac40a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 14:53:56 +0300 Subject: [PATCH 058/109] 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 a7644c2b..e7b226b7 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,9 +162,9 @@ jobs: path: wheelhouse/ - name: Package installation run: | - set "OpenBLAS_HOME=%CD%" - echo OpenBLAS_HOME=%OpenBLAS_HOME% - set "PATH=%OpenBLAS_HOME%\openblas\bin;%PATH%" + $env:OpenBLAS_HOME = (Get-Location).Path + Write-Host "OpenBLAS_HOME=$env:OpenBLAS_HOME" + $env:PATH = "$env:OpenBLAS_HOME\openblas\bin;$env:PATH" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 88c3cf671a980a2a7a13c590c8b92e929bb8c876 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 15:20:14 +0300 Subject: [PATCH 059/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index e7b226b7..706dde99 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -138,6 +138,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py + PATH: ${{ github.workspace }}\openblas\bin;${{ env.PATH }} steps: - name: Cleanup shell: bash @@ -162,9 +163,6 @@ jobs: path: wheelhouse/ - name: Package installation run: | - $env:OpenBLAS_HOME = (Get-Location).Path - Write-Host "OpenBLAS_HOME=$env:OpenBLAS_HOME" - $env:PATH = "$env:OpenBLAS_HOME\openblas\bin;$env:PATH" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 55208e97fe1cc0dacd0948af984bc746cf528857 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 15:22:43 +0300 Subject: [PATCH 060/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 706dde99..d12a9c49 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -138,7 +138,6 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py - PATH: ${{ github.workspace }}\openblas\bin;${{ env.PATH }} steps: - name: Cleanup shell: bash From 57fef17077b23403b782887cb95785c087410f63 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 15:28:35 +0300 Subject: [PATCH 061/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index d12a9c49..2ef600ed 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,6 +162,9 @@ jobs: path: wheelhouse/ - name: Package installation run: | + $env:OpenBLAS_HOME = "$PWD" + $env:PATH = "$env:OpenBLAS_HOME\openblas\bin;$env:PATH" + Write-Host "OpenBLAS_HOME=$env:OpenBLAS_HOME" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 02edf9476b578cc8023d5d9ddf0774cedef8f70e Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 15:52:09 +0300 Subject: [PATCH 062/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 2ef600ed..17372a3b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -160,6 +160,10 @@ jobs: with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ + - name: check DLL + shell: powershell + run: | + dir "$PWD\openblas\bin\libopenblas*.dll" - name: Package installation run: | $env:OpenBLAS_HOME = "$PWD" From b492445ab62df3886adf9a2f5b120672b9c5f067 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 16:26:29 +0300 Subject: [PATCH 063/109] 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 17372a3b..20f24a82 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -118,7 +118,9 @@ jobs: uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} - path: wheelhouse/opencv* + path: | + wheelhouse/opencv* + openblas/** Test: needs: [Build] @@ -160,14 +162,12 @@ jobs: with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - - name: check DLL - shell: powershell - run: | - dir "$PWD\openblas\bin\libopenblas*.dll" + + - name: Package installation run: | $env:OpenBLAS_HOME = "$PWD" - $env:PATH = "$env:OpenBLAS_HOME\openblas\bin;$env:PATH" + $env:PATH = "$env:OpenBLAS_HOME\wheelhouse\openblas\bin;$env:PATH" Write-Host "OpenBLAS_HOME=$env:OpenBLAS_HOME" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") From c7354fa0b88f22325528685ce608d17df55caad2 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 17:00:59 +0300 Subject: [PATCH 064/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 20f24a82..c5fbb90e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -112,6 +112,13 @@ jobs: echo %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v + for /d %%D in (build\lib*) do set BUILDDIR=%%D + if exist %BUILDDIR%\cv2 ( + copy /Y openblas\bin\libopenblas.dll %BUILDDIR%\cv2\libopenblas.dll + ) else ( + echo [!] cv2 directory not found in %BUILDDIR% + exit /b 1 + ) shell: cmd - name: Saving all wheels @@ -120,7 +127,6 @@ jobs: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: | wheelhouse/opencv* - openblas/** Test: needs: [Build] @@ -166,9 +172,6 @@ jobs: - name: Package installation run: | - $env:OpenBLAS_HOME = "$PWD" - $env:PATH = "$env:OpenBLAS_HOME\wheelhouse\openblas\bin;$env:PATH" - Write-Host "OpenBLAS_HOME=$env:OpenBLAS_HOME" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} From 3c8454f32ce1bb13d39e805e31ca5f6faf6ff091 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 17:20:55 +0300 Subject: [PATCH 065/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index c5fbb90e..4ce00a90 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -112,13 +112,17 @@ jobs: echo %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v - for /d %%D in (build\lib*) do set BUILDDIR=%%D - if exist %BUILDDIR%\cv2 ( - copy /Y openblas\bin\libopenblas.dll %BUILDDIR%\cv2\libopenblas.dll - ) else ( - echo [!] cv2 directory not found in %BUILDDIR% - exit /b 1 + setlocal enabledelayedexpansion + for /d %%D in (build\lib*) do ( + set "BUILDDIR=%%D" + if exist "%%D\cv2" ( + copy /Y openblas\bin\libopenblas.dll "%%D\cv2\libopenblas.dll" + ) else ( + echo [!] cv2 directory not found in %%D + exit /b 1 + ) ) + endlocal shell: cmd - name: Saving all wheels From 668894371d39b66706d0d5c0f5481bb127b8441e Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 17:21:33 +0300 Subject: [PATCH 066/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 4ce00a90..7be84602 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -112,6 +112,7 @@ jobs: echo %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v + dir /s /b build setlocal enabledelayedexpansion for /d %%D in (build\lib*) do ( set "BUILDDIR=%%D" From 1b73de391476ddf8cbaa96405fa51fc4197e2c4a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 18:02:19 +0300 Subject: [PATCH 067/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 7be84602..55e8a36e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -112,18 +112,6 @@ jobs: echo %CMAKE_ARGS% python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v - dir /s /b build - setlocal enabledelayedexpansion - for /d %%D in (build\lib*) do ( - set "BUILDDIR=%%D" - if exist "%%D\cv2" ( - copy /Y openblas\bin\libopenblas.dll "%%D\cv2\libopenblas.dll" - ) else ( - echo [!] cv2 directory not found in %%D - exit /b 1 - ) - ) - endlocal shell: cmd - name: Saving all wheels From f9e4b60b2629ed19d3a2b93ffcfab5f72442c09d Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 18:06:19 +0300 Subject: [PATCH 068/109] Update setup.py --- setup.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/setup.py b/setup.py index 1dfab2fb..6926bbdb 100644 --- a/setup.py +++ b/setup.py @@ -193,6 +193,8 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", + "-DLAPACK=ON", + ] + ( # CMake flags for windows/arm64 build From f57c90ee197d075ebae721b18ca4ed624119d30d Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 18:15:23 +0300 Subject: [PATCH 069/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 55e8a36e..b04ca517 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -113,13 +113,19 @@ jobs: python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd - + + - name: Copy OpenBLAS DLL to wheelhouse + run: | + copy openblas\bin\libopenblas.dll wheelhouse\ + shell: cmd + - name: Saving all wheels uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: | wheelhouse/opencv* + wheelhouse/libopenblas.dll Test: needs: [Build] @@ -161,8 +167,18 @@ jobs: with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - + - name: Add OpenBLAS DLL to PATH + run: | + set "PATH=%CD%\wheelhouse;%PATH%" + echo %PATH% + shell: cmd + + - name: Check OpenBLAS DLL presence + run: | + where libopenblas.dll || echo "OpenBLAS DLL not found" + shell: cmd + - name: Package installation run: | cd ${{ github.workspace }}/tests From 968a007762c068daac8e4cb47aa9db36114627af Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 18:44:04 +0300 Subject: [PATCH 070/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b04ca517..6054202c 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -168,15 +168,21 @@ jobs: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ + - name: Show contents of wheelhouse + run: | + echo "== wheelhouse contents ==" + dir /b wheelhouse + shell: cmd + - name: Add OpenBLAS DLL to PATH run: | - set "PATH=%CD%\wheelhouse;%PATH%" + set "PATH=${{ github.workspace }}\wheelhouse;%PATH%" + echo "== PATH ==" echo %PATH% - shell: cmd - - - name: Check OpenBLAS DLL presence - run: | - where libopenblas.dll || echo "OpenBLAS DLL not found" + echo "== Checking for libopenblas.dll ==" + where libopenblas.dll || ( + echo "ERROR: libopenblas.dll not found!" & exit /b 1 + ) shell: cmd - name: Package installation From 598e4732b85f05c80505eb43fcf4b2d3e142db8a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 19:11:07 +0300 Subject: [PATCH 071/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 6054202c..6bad8703 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -192,10 +192,15 @@ jobs: if ($LastExitCode -ne 0) {throw $LastExitCode} python get_build_info.py shell: powershell + env: + PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . + env: + PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + - name: Pylint test run: | python -m pip install pylint==2.15.9 From 89455db46d1ffb2292e627727d9b3ca12df18804 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 19:55:16 +0300 Subject: [PATCH 072/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 6bad8703..ccac33de 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -194,12 +194,14 @@ jobs: shell: powershell env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Pylint test run: | From 6bc318a5879c174445c6309ef642fabb280a23a4 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Mon, 2 Jun 2025 19:57:50 +0300 Subject: [PATCH 073/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ccac33de..c7f5195e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -190,18 +190,25 @@ jobs: cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} + # Copy DLL next to cv2.pyd (Python 3.8+ needs this) + $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" + Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" python get_build_info.py shell: powershell env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Run tests run: | + # Find cv2 install path + $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" + + # Copy DLL next to cv2.pyd + Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" + cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Pylint test run: | From a242a4190a69e12cd47b827c696919a4b33306dc Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 15:26:49 +0300 Subject: [PATCH 074/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index c7f5195e..fece6e3f 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,6 +162,7 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v4 with: @@ -187,12 +188,12 @@ jobs: - 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} # Copy DLL next to cv2.pyd (Python 3.8+ needs this) $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" + 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 env: From a66914a3f16aa566486d75086e728d3d8b131879 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 16:00:53 +0300 Subject: [PATCH 075/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index fece6e3f..99c95444 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -188,9 +188,6 @@ jobs: - name: Package installation run: | - # Copy DLL next to cv2.pyd (Python 3.8+ needs this) - $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" - Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} @@ -198,18 +195,14 @@ jobs: shell: powershell env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Run tests run: | - # Find cv2 install path - $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" - - # Copy DLL next to cv2.pyd - Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" - cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Pylint test run: | From 6b45446d83208d6bf72f299ae8b0cdadfa2d0652 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 17:31:23 +0300 Subject: [PATCH 076/109] 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 99c95444..3dde5b30 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -191,18 +191,18 @@ jobs: cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} + $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" + Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" python get_build_info.py shell: powershell env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . env: PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - PYTHONPATH: ${{ github.workspace }}\wheelhouse;${{ env.PYTHONPATH }} - name: Pylint test run: | From 37eef63424c419e889e4e099683bd2d929a2f7c7 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 17:55:56 +0300 Subject: [PATCH 077/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 3dde5b30..7b266550 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -191,7 +191,8 @@ jobs: cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} - $cv2_path = python -c "import cv2; import os; print(os.path.dirname(cv2.__file__))" + $cv2_path = $(python -c "import cv2, os; print(os.path.dirname(cv2.__file__))") + echo $cv2_path Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" python get_build_info.py shell: powershell From cbdc64eb7df35d941419c5a80222045a067a4bce Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 18:37:25 +0300 Subject: [PATCH 078/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 7b266550..df62c086 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -118,7 +118,25 @@ jobs: run: | copy openblas\bin\libopenblas.dll wheelhouse\ shell: cmd - + - name: Inject libopenblas.dll into .whl + run: | + for %%F in (wheelhouse\opencv_python*.whl) do ( + echo Processing %%F + mkdir tmpwhl + cd tmpwhl + tar -xf ..\%%F + + echo Copying libopenblas.dll into cv2/ + copy ..\wheelhouse\libopenblas.dll cv2\ + + echo Repacking wheel + del ..\%%F + tar -cf ..\%%F * + + cd .. + rmdir /s /q tmpwhl + ) + shell: cmd - name: Saving all wheels uses: actions/upload-artifact@v4 with: @@ -193,7 +211,6 @@ jobs: if ($LastExitCode -ne 0) {throw $LastExitCode} $cv2_path = $(python -c "import cv2, os; print(os.path.dirname(cv2.__file__))") echo $cv2_path - Copy-Item "${{ github.workspace }}\wheelhouse\libopenblas.dll" "$cv2_path\libopenblas.dll" python get_build_info.py shell: powershell env: From 52b491c3c23669c9f88339ca5ab1f41f212f8f53 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 18:45:44 +0300 Subject: [PATCH 079/109] Update setup.py --- setup.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/setup.py b/setup.py index 6926bbdb..f5b70c72 100644 --- a/setup.py +++ b/setup.py @@ -115,6 +115,12 @@ def main(): else [] ) + + "openblas": ( + [r"openblas/bin/libopenblas\d*\.dll"] + if os.name == "nt" + else [] + ) + + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From 52f94f569e5b605439e5c0a57fb5c687bd0b0d69 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 18:47:19 +0300 Subject: [PATCH 080/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 46 +--------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index df62c086..cb446746 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -113,37 +113,13 @@ jobs: python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd - - - name: Copy OpenBLAS DLL to wheelhouse - run: | - copy openblas\bin\libopenblas.dll wheelhouse\ - shell: cmd - - name: Inject libopenblas.dll into .whl - run: | - for %%F in (wheelhouse\opencv_python*.whl) do ( - echo Processing %%F - mkdir tmpwhl - cd tmpwhl - tar -xf ..\%%F - - echo Copying libopenblas.dll into cv2/ - copy ..\wheelhouse\libopenblas.dll cv2\ - - echo Repacking wheel - del ..\%%F - tar -cf ..\%%F * - cd .. - rmdir /s /q tmpwhl - ) - shell: cmd - name: Saving all wheels uses: actions/upload-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: | wheelhouse/opencv* - wheelhouse/libopenblas.dll Test: needs: [Build] @@ -187,40 +163,20 @@ jobs: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - - name: Show contents of wheelhouse - run: | - echo "== wheelhouse contents ==" - dir /b wheelhouse - shell: cmd - - name: Add OpenBLAS DLL to PATH - run: | - set "PATH=${{ github.workspace }}\wheelhouse;%PATH%" - echo "== PATH ==" - echo %PATH% - echo "== Checking for libopenblas.dll ==" - where libopenblas.dll || ( - echo "ERROR: libopenblas.dll not found!" & exit /b 1 - ) - shell: cmd - 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} - $cv2_path = $(python -c "import cv2, os; print(os.path.dirname(cv2.__file__))") - echo $cv2_path python get_build_info.py shell: powershell - env: - PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} + - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . - env: - PATH: ${{ github.workspace }}\wheelhouse;${{ env.PATH }} - name: Pylint test run: | From f4e76800791a7d2a15f7d0fc26e3facaaaa6564e Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 19:12:47 +0300 Subject: [PATCH 081/109] Update setup.py --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index f5b70c72..47b7b901 100644 --- a/setup.py +++ b/setup.py @@ -115,10 +115,10 @@ def main(): else [] ) + - "openblas": ( - [r"openblas/bin/libopenblas\d*\.dll"] - if os.name == "nt" - else [] + ( + [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.exp.dll").replace("\\", "\\\\")] + if os.name == "nt" and "OpenBLAS_HOME" in os.environ + else [] ) + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. From 53a25bd121d8b9d3a994f3a333fc096ebd5e356a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 19:14:50 +0300 Subject: [PATCH 082/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cb446746..563f76ac 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -162,8 +162,6 @@ jobs: with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - - - name: Package installation run: | From f6bb4fc076d0f0c557e6a6dd4fdd1713f06dd79d Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 19:39:36 +0300 Subject: [PATCH 083/109] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 47b7b901..215e8f3e 100644 --- a/setup.py +++ b/setup.py @@ -116,7 +116,7 @@ def main(): ) + ( - [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.exp.dll").replace("\\", "\\\\")] + [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.dll").replace("\\", "\\\\")] if os.name == "nt" and "OpenBLAS_HOME" in os.environ else [] ) From 4509c204d00709cc7b39ed521c09e996afec074f Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 19:43:13 +0300 Subject: [PATCH 084/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 563f76ac..9b9e0b27 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -93,7 +93,8 @@ jobs: if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll ) - + echo Listing OpenBLAS directory: + dir %OpenBLAS_HOME%\bin echo Finished OpenBLAS setup cd .. echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd From c16e60b0935b676012ef150b1e60d8c39e9a66e4 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 19:48:38 +0300 Subject: [PATCH 085/109] Update setup.py --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 215e8f3e..64f1b5f6 100644 --- a/setup.py +++ b/setup.py @@ -116,8 +116,8 @@ def main(): ) + ( - [os.path.join(os.environ["OpenBLAS_HOME"], "bin", "libopenblas.dll").replace("\\", "\\\\")] - if os.name == "nt" and "OpenBLAS_HOME" in os.environ + [r"openblas[\\/]+bin[\\/]+libopenblas\.dll"] + if os.name == "nt" else [] ) + From b0c4bcee86bc736fe69210d2d4deb024301583e7 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 20:09:40 +0300 Subject: [PATCH 086/109] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 64f1b5f6..4c96c275 100644 --- a/setup.py +++ b/setup.py @@ -116,7 +116,7 @@ def main(): ) + ( - [r"openblas[\\/]+bin[\\/]+libopenblas\.dll"] + [r".*openblas.*[\\/]+libopenblas\.exp\.dll"] if os.name == "nt" else [] ) From 7aa637a428bb59c293a83c5204829f6a141568e2 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 3 Jun 2025 20:20:28 +0300 Subject: [PATCH 087/109] Update setup.py --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 4c96c275..64f1b5f6 100644 --- a/setup.py +++ b/setup.py @@ -116,7 +116,7 @@ def main(): ) + ( - [r".*openblas.*[\\/]+libopenblas\.exp\.dll"] + [r"openblas[\\/]+bin[\\/]+libopenblas\.dll"] if os.name == "nt" else [] ) From e8c6f34d8df4a52fa9ac35c628acc8517f3ade9d Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 4 Jun 2025 09:38:17 +0300 Subject: [PATCH 088/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 74 +++++++++------------- 1 file changed, 31 insertions(+), 43 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 9b9e0b27..8f27bc6b 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -67,52 +67,40 @@ jobs: - name: Setup NASM uses: ilammy/setup-nasm@v1 - - name: Setup OpenBLAS - shell: cmd - run: | - setlocal enableextensions enabledelayedexpansion - - rem Determine correct architecture - if "%{matrix.platform}%"=="x64" ( - set ARCH=x64 - set FOLDER=win64 - ) else ( - set ARCH=x86 - set FOLDER=win32 - ) - - mkdir openblas - cd openblas - curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip - powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." - - set "OpenBLAS_HOME=%CD%" - echo OpenBLAS_HOME=%OpenBLAS_HOME% - set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - - if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( - copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll - ) - echo Listing OpenBLAS directory: - dir %OpenBLAS_HOME%\bin - echo Finished OpenBLAS setup - cd .. - echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd - name: Build a package run: | - call set_openblas_env.cmd - 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 "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" - echo %CMAKE_ARGS% - - python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v + rem ==== Setup OpenBLAS ==== + if "%{matrix.platform}%"=="x64" ( + set ARCH=x64 + ) else ( + set ARCH=x86 + ) + mkdir openblas + cd openblas + curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip + powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." + set "OpenBLAS_HOME=%CD%" + set "PATH=%OpenBLAS_HOME%\bin;%PATH%" + if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( + copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll + ) + cd .. + + rem ==== Install build dependencies ==== + 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 + + rem ==== Build ==== + set "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" + echo %CMAKE_ARGS% + python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd - name: Saving all wheels From 2337f70838803cfe5cca24cf8a9926fb86493b24 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 4 Jun 2025 10:01:51 +0300 Subject: [PATCH 089/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 75 +++++++++++++--------- 1 file changed, 44 insertions(+), 31 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 8f27bc6b..12a05cd8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -68,39 +68,52 @@ jobs: uses: ilammy/setup-nasm@v1 + - name: Setup OpenBLAS + shell: cmd + run: | + setlocal enableextensions enabledelayedexpansion + + rem Determine correct architecture + if "%{matrix.platform}%"=="x64" ( + set ARCH=x64 + set FOLDER=win64 + ) else ( + set ARCH=x86 + set FOLDER=win32 + ) + + mkdir openblas + cd openblas + curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip + powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." + + set "OpenBLAS_HOME=%CD%" + echo OpenBLAS_HOME=%OpenBLAS_HOME% + set "PATH=%OpenBLAS_HOME%\bin;%PATH%" + + if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( + copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll + ) + echo Listing OpenBLAS directory: + dir %OpenBLAS_HOME%\bin + echo Finished OpenBLAS setup + cd .. + echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd + - name: Build a package run: | - rem ==== Setup OpenBLAS ==== - if "%{matrix.platform}%"=="x64" ( - set ARCH=x64 - ) else ( - set ARCH=x86 - ) - mkdir openblas - cd openblas - curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip - powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." - set "OpenBLAS_HOME=%CD%" - set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( - copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll - ) - cd .. - - rem ==== Install build dependencies ==== - 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 - - rem ==== Build ==== - set "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" - echo %CMAKE_ARGS% - python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v + call set_openblas_env.cmd + 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 "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" + set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" + echo %CMAKE_ARGS% + dir + python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v shell: cmd - name: Saving all wheels From 024199654ad0b8c6c60c50a95af4c899331cf565 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 4 Jun 2025 16:44:12 +0300 Subject: [PATCH 090/109] Update setup.py --- setup.py | 6 ------ 1 file changed, 6 deletions(-) diff --git a/setup.py b/setup.py index 64f1b5f6..6926bbdb 100644 --- a/setup.py +++ b/setup.py @@ -115,12 +115,6 @@ def main(): else [] ) + - ( - [r"openblas[\\/]+bin[\\/]+libopenblas\.dll"] - if os.name == "nt" - else [] - ) - + # In Windows, in python/X.Y//; in Linux, in just python/X.Y/. # Naming conventions vary so widely between versions and OSes # had to give up on checking them. From 9e5d8dbd342e535ca80846ada7923087bd568008 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 10 Jun 2025 21:14:17 +0300 Subject: [PATCH 091/109] Update setup.py --- setup.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/setup.py b/setup.py index 6926bbdb..39b5387e 100644 --- a/setup.py +++ b/setup.py @@ -160,12 +160,18 @@ def main(): # Raw paths relative to sourcetree root. files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} - ci_cmake_generator = ( - ["-G", "Visual Studio 14" + (" Win64" if is64 else "")] - if os.name == "nt" - else ["-G", "Unix Makefiles"] - ) - + if os.name == "nt": + vs_env = os.environ.get("VISUAL_STUDIO") + if vs_env == "17": + generator_name = "Visual Studio 17 2022" + arch = "x64" if is64 else "Win32" + ci_cmake_generator = ["-G", generator_name, "-A", arch] + else: + generator_name = "Visual Studio 14" + (" Win64" if is64 else "") + ci_cmake_generator = ["-G", generator_name] + else: + ci_cmake_generator = ["-G", "Unix Makefiles"] + cmake_args = ( (ci_cmake_generator if is_CI_build else []) + [ @@ -193,8 +199,8 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", - "-DLAPACK=ON", - + "-DWITH_OBSENSOR=OFF", + "-DWITH_MEDIAFOUNDATION=OFF", ] + ( # CMake flags for windows/arm64 build From 1f8dcad3e281c1b4b391e7f0a9a30b580cfbb28c Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Tue, 10 Jun 2025 21:14:41 +0300 Subject: [PATCH 092/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 55 ++-------------------- 1 file changed, 4 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 12a05cd8..773a7c75 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -41,87 +41,44 @@ jobs: 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: Setup OpenBLAS - shell: cmd - run: | - setlocal enableextensions enabledelayedexpansion - - rem Determine correct architecture - if "%{matrix.platform}%"=="x64" ( - set ARCH=x64 - set FOLDER=win64 - ) else ( - set ARCH=x86 - set FOLDER=win32 - ) - - mkdir openblas - cd openblas - curl -L -o OpenBLAS.zip https://downloads.sourceforge.net/project/openblas/v0.3.24/OpenBLAS-0.3.24-%ARCH%.zip - powershell -Command "Expand-Archive -Path OpenBLAS.zip -DestinationPath ." - - set "OpenBLAS_HOME=%CD%" - echo OpenBLAS_HOME=%OpenBLAS_HOME% - set "PATH=%OpenBLAS_HOME%\bin;%PATH%" - - if exist %OpenBLAS_HOME%\bin\libopenblas.dll ( - copy /y %OpenBLAS_HOME%\bin\libopenblas.dll %OpenBLAS_HOME%\bin\libopenblas.exp.dll - ) - echo Listing OpenBLAS directory: - dir %OpenBLAS_HOME%\bin - echo Finished OpenBLAS setup - cd .. - echo set "OpenBLAS_HOME=%OpenBLAS_HOME%" > set_openblas_env.cmd - - 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: | - call set_openblas_env.cmd + set "VISUAL_STUDIO=17" 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 "OpenBLAS_HOME_UNIX=%OpenBLAS_HOME:\=/%" - set "CMAKE_ARGS=-DLAPACK=ON -DOpenBLAS_INCLUDE_DIR=%OpenBLAS_HOME_UNIX%/include -DOpenBLAS_LIBRARIES=%OpenBLAS_HOME_UNIX%/lib/libopenblas.lib" - echo %CMAKE_ARGS% - dir - python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\\wheelhouse -v + 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 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} - path: | - wheelhouse/opencv* + path: wheelhouse/opencv* Test: needs: [Build] @@ -158,13 +115,11 @@ jobs: with: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - - name: Package installation run: | cd ${{ github.workspace }}/tests @@ -172,12 +127,10 @@ jobs: if ($LastExitCode -ne 0) {throw $LastExitCode} python get_build_info.py shell: powershell - - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . - - name: Pylint test run: | python -m pip install pylint==2.15.9 From 9791ccfe162497faa98ae890619a4f5109228e93 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 11:45:26 +0300 Subject: [PATCH 093/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 773a7c75..bb0860be 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -19,7 +19,7 @@ on: jobs: Build: - runs-on: windows-2022 + runs-on: windows-2025 strategy: fail-fast: false matrix: @@ -82,7 +82,7 @@ jobs: Test: needs: [Build] - runs-on: windows-2022 + runs-on: windows-2025 defaults: run: shell: cmd @@ -110,6 +110,15 @@ jobs: with: submodules: true fetch-depth: 0 + - name: Show current commit and branch + run: | + git rev-parse --abbrev-ref HEAD + git log -1 --oneline + + - name: Print location of np.fromstring + run: | + findstr /C:"np.fromstring" opencv\modules\python\test\tests_common.py || echo "No fromstring found" + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From b31fe9eaed0dc8e1641ca63d971b94af6805bc42 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 12:15:29 +0300 Subject: [PATCH 094/109] 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 bb0860be..16625fcd 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -48,7 +48,7 @@ jobs: echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: false fetch-depth: 0 @@ -106,7 +106,7 @@ jobs: rm -rf ./.??* || true working-directory: ${{ github.workspace }} - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true fetch-depth: 0 From bd77f99bf4ebd6ba4a4cf05d5bd30e5b9e45791a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 12:24:00 +0300 Subject: [PATCH 095/109] Update setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 39b5387e..bb54944d 100644 --- a/setup.py +++ b/setup.py @@ -200,7 +200,6 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", "-DWITH_OBSENSOR=OFF", - "-DWITH_MEDIAFOUNDATION=OFF", ] + ( # CMake flags for windows/arm64 build From 3dcfcf6cf10a8c7289639f196dc62567be6a58d3 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 14:50:53 +0300 Subject: [PATCH 096/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 16625fcd..19d58e13 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -52,6 +52,8 @@ jobs: with: submodules: false fetch-depth: 0 + submodule-update-depth: 1 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -110,6 +112,8 @@ jobs: with: submodules: true fetch-depth: 0 + submodule-update-depth: 1 + - name: Show current commit and branch run: | git rev-parse --abbrev-ref HEAD From 87ad343b6519286d0f07fef9468c255158fa7131 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 15:09:23 +0300 Subject: [PATCH 097/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 19d58e13..78bde964 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -51,8 +51,7 @@ jobs: uses: actions/checkout@v4 with: submodules: false - fetch-depth: 0 - submodule-update-depth: 1 + fetch-depth: 1 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -111,8 +110,7 @@ jobs: uses: actions/checkout@v4 with: submodules: true - fetch-depth: 0 - submodule-update-depth: 1 + fetch-depth: 1 - name: Show current commit and branch run: | From 249f4c92a191b7cbb67d09df8e9462af4bb65446 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 15:57:20 +0300 Subject: [PATCH 098/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 78bde964..b353a898 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v4 with: submodules: false - fetch-depth: 1 + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 @@ -110,7 +110,16 @@ jobs: uses: actions/checkout@v4 with: submodules: true - fetch-depth: 1 + fetch-depth: 0 + + - name: Update submodules to HEAD of 4.x + shell: bash + run: | + git submodule foreach ' + echo "$name" + git fetch origin + git checkout 4.x || true + git pull origin 4.x || true - name: Show current commit and branch run: | From dfbaa2609fae88e0a64021b04f8d5a5f08a3c56b Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 16:04:19 +0300 Subject: [PATCH 099/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b353a898..ec19e6c0 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -115,11 +115,12 @@ jobs: - name: Update submodules to HEAD of 4.x shell: bash run: | - git submodule foreach ' - echo "$name" - git fetch origin - git checkout 4.x || true - git pull origin 4.x || true + git submodule foreach ' + echo "$name" + git fetch origin + git checkout 4.x || true + git pull origin 4.x || true + ' - name: Show current commit and branch run: | From 0ce663dbfc07ce7f2bf1cbdfd7fc294d19c8fc64 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 16:08:38 +0300 Subject: [PATCH 100/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ec19e6c0..54a57c70 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -50,6 +50,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + ref: ${{ github.head_ref }} submodules: false fetch-depth: 0 @@ -109,6 +110,7 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + ref: ${{ github.head_ref }} submodules: true fetch-depth: 0 From 516ff9b1d20125c95cd84686d791943351b2437e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 11 Jun 2025 16:30:52 +0300 Subject: [PATCH 101/109] Update submodules to latest commits --- multibuild | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multibuild b/multibuild index 0714f52e..24f1446f 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 0714f52ea1ea57a0bc33c7f8b74bae457e1fa8e0 +Subproject commit 24f1446f6477893b2ef9d721aabcee7a494ca2b1 diff --git a/opencv b/opencv index 31b0eeea..b395a2e3 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 31b0eeea0b44b370fd0712312df4214d4ae1b158 +Subproject commit b395a2e307e9b44c394b6f0e46de319a93ef85d4 diff --git a/opencv_contrib b/opencv_contrib index 0e5254eb..1e4d4e0f 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 0e5254ebf54d2aed6e7eaf6660bf3b797cf50a02 +Subproject commit 1e4d4e0f3e4c7d6d7ab9d738026fe13d3cd85cf4 diff --git a/opencv_extra b/opencv_extra index a74cf6ba..8926a390 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit a74cf6bae7fd75d91282b877c559168b3a62148a +Subproject commit 8926a3906a44733d68485c703de1c8a765577246 From 92f178d263e7e9918518be551af1ea7afc601c5e Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 16:32:40 +0300 Subject: [PATCH 102/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 54a57c70..b85816b3 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -50,7 +50,6 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} submodules: false fetch-depth: 0 @@ -110,29 +109,9 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - ref: ${{ github.head_ref }} submodules: true fetch-depth: 0 - - - name: Update submodules to HEAD of 4.x - shell: bash - run: | - git submodule foreach ' - echo "$name" - git fetch origin - git checkout 4.x || true - git pull origin 4.x || true - ' - - name: Show current commit and branch - run: | - git rev-parse --abbrev-ref HEAD - git log -1 --oneline - - - name: Print location of np.fromstring - run: | - findstr /C:"np.fromstring" opencv\modules\python\test\tests_common.py || echo "No fromstring found" - - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From 0d69483003bf192d4ef89e0c50df09356da3262a Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 11 Jun 2025 17:52:30 +0300 Subject: [PATCH 103/109] Update setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index bb54944d..9ebafacc 100644 --- a/setup.py +++ b/setup.py @@ -199,7 +199,6 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", - "-DWITH_OBSENSOR=OFF", ] + ( # CMake flags for windows/arm64 build From d751cc8ff6645b9fd24800c9635ead123a2ef4ba Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Thu, 12 Jun 2025 17:59:50 +0300 Subject: [PATCH 104/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b85816b3..59810d46 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -51,8 +51,7 @@ jobs: uses: actions/checkout@v4 with: submodules: false - fetch-depth: 0 - + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: From ddcbeec8191e5627f0002f50ca54054f5e47d9fc Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Thu, 12 Jun 2025 18:04:57 +0300 Subject: [PATCH 105/109] Update build_wheels_macos_m1.yml --- .github/workflows/build_wheels_macos_m1.yml | 103 +++++++++++++------- 1 file changed, 66 insertions(+), 37 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index ffbdc752..a1cad49e 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -1,4 +1,4 @@ -name: macOS ARM64 +name: macOS x86_64 on: pull_request: @@ -10,7 +10,7 @@ on: paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' - - '.github/workflows/build_wheels_macos.yml' + - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] schedule: @@ -20,7 +20,10 @@ on: jobs: Build: - runs-on: python-macos12-m1 + runs-on: macos-13 + defaults: + run: + shell: bash strategy: fail-fast: false matrix: @@ -30,11 +33,21 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - CI_BUILD: 1 + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + TRAVIS_BUILD_DIR: ${{ github.workspace }} + TRAVIS_OS_NAME: osx + CONFIG_PATH: travis_config.sh + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -44,6 +57,12 @@ jobs: if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi + # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817 + rm /usr/local/bin/2to3* + rm /usr/local/bin/idle3* + rm /usr/local/bin/pydoc3* + rm /usr/local/bin/python3* + # end hack - name: Checkout uses: actions/checkout@v3 with: @@ -51,27 +70,33 @@ jobs: fetch-depth: 0 - name: Build a package run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - export MACOSX_DEPLOYMENT_TARGET=13.0 - python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin - python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v - delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - - name: Saving all wheels - uses: actions/upload-artifact@v3 - with: - name: wheels - path: wheelhouse/opencv*.whl + set -x + build_wheel $REPO_DIR $PLAT - 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 }} path: wheelhouse/opencv*.whl Test: needs: [Build] - runs-on: python-macos12-m1 + runs-on: macos-13 + defaults: + run: + shell: bash strategy: fail-fast: false matrix: @@ -81,9 +106,14 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==2.2.1 + CONFIG_PATH: travis_config.sh + PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py - PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -93,44 +123,43 @@ jobs: with: submodules: true fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + - name: Setup Environment variables + run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - - name: Create Venv for test - run: | - test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test" - python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test - name: Package installation run: | - source ${{ github.workspace }}/opencv_test/bin/activate - python${{ matrix.python-version }} -m pip install --upgrade pip - python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl + python -m pip install wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests - python${{ matrix.python-version }} get_build_info.py + python get_build_info.py - name: Run tests run: | - source ${{ github.workspace }}/opencv_test/bin/activate cd ${{ github.workspace }}/opencv - python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + python modules/python/test/test.py -v --repo . - name: Pylint test run: | - source ${{ github.workspace }}/opencv_test/bin/activate - python${{ matrix.python-version }} -m pip install pylint==2.15.9 + python -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests - python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE + python -m pylint $PYLINT_TEST_FILE 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: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -154,13 +183,13 @@ 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: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ @@ -172,13 +201,13 @@ 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: shell: bash steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: wheels path: wheelhouse/ From 6a5fe032b39272625afbfd2ca4f51fc2615091c9 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Thu, 12 Jun 2025 18:09:29 +0300 Subject: [PATCH 106/109] Update build_wheels_macos_m1.yml --- .github/workflows/build_wheels_macos_m1.yml | 82 ++++++--------------- 1 file changed, 24 insertions(+), 58 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index a1cad49e..1e62c858 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -1,4 +1,4 @@ -name: macOS x86_64 +name: macOS ARM64 on: pull_request: @@ -10,7 +10,7 @@ on: paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' - - '.github/workflows/build_wheels_macos_m1.yml' + - '.github/workflows/build_wheels_macos.yml' release: types: [published, edited] schedule: @@ -20,10 +20,7 @@ on: jobs: Build: - runs-on: macos-13 - defaults: - run: - shell: bash + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: @@ -33,21 +30,11 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - PROJECT_SPEC: opencv-python - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - MB_ML_VER: 2014 - TRAVIS_BUILD_DIR: ${{ github.workspace }} - TRAVIS_OS_NAME: osx - CONFIG_PATH: travis_config.sh - USE_CCACHE: 1 - UNICODE_WIDTH: 32 - PLAT: x86_64 + CI_BUILD: 1 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -57,12 +44,6 @@ jobs: if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then echo "ENABLE_ROLLING=1" >> $GITHUB_ENV fi - # hack for image issue on mac: https://github.com/actions/runner-images/issues/6817 - rm /usr/local/bin/2to3* - rm /usr/local/bin/idle3* - rm /usr/local/bin/pydoc3* - rm /usr/local/bin/python3* - # end hack - name: Checkout uses: actions/checkout@v3 with: @@ -70,21 +51,13 @@ jobs: fetch-depth: 0 - name: Build a package run: | - set -e - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - set -x - build_wheel $REPO_DIR $PLAT + export MACOSX_DEPLOYMENT_TARGET=13.0 + python${{ matrix.python-version }} -m pip install toml && python${{ matrix.python-version }} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${{ matrix.python-version }} -m pip install -r /dev/stdin + python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v + delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v4 with: @@ -93,10 +66,7 @@ jobs: Test: needs: [Build] - runs-on: macos-13 - defaults: - run: - shell: bash + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: @@ -106,14 +76,9 @@ jobs: without_gui: [0, 1] build_sdist: [0] env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MB_PYTHON_VERSION: ${{ matrix.python-version }} - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.2.1 - CONFIG_PATH: travis_config.sh - PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py + PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup run: find . -mindepth 1 -delete @@ -123,32 +88,33 @@ jobs: with: submodules: true fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - name: Setup Environment variables - run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v4 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ + - name: Create Venv for test + run: | + test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test" + python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test - name: Package installation run: | - python -m pip install wheelhouse/opencv*.whl + source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install --upgrade pip + python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests - python get_build_info.py + python${{ matrix.python-version }} get_build_info.py - name: Run tests run: | + source ${{ github.workspace }}/opencv_test/bin/activate cd ${{ github.workspace }}/opencv - python modules/python/test/test.py -v --repo . + python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - name: Pylint test run: | - python -m pip install pylint==2.15.9 + source ${{ github.workspace }}/opencv_test/bin/activate + python${{ matrix.python-version }} -m pip install pylint==2.15.9 cd ${{ github.workspace }}/tests - python -m pylint $PYLINT_TEST_FILE + python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} From 4457886b4fc1cc8c6e1a2b5cde992835bb1c0552 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Thu, 12 Jun 2025 18:14:18 +0300 Subject: [PATCH 107/109] 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 59810d46..a05a0d15 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -73,7 +73,7 @@ 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 uses: actions/upload-artifact@v4 with: From cd34ee4e8dceb557c15be905dfd1ada108bfa838 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 18 Jun 2025 19:00:24 +0300 Subject: [PATCH 108/109] Update setup.py --- setup.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/setup.py b/setup.py index c45a0937..084123b3 100755 --- a/setup.py +++ b/setup.py @@ -161,22 +161,9 @@ def main(): # Files in sourcetree outside package dir that should be copied to package. # Raw paths relative to sourcetree root. files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} - - if os.name == "nt": - vs_env = os.environ.get("VISUAL_STUDIO") - if vs_env == "17": - generator_name = "Visual Studio 17 2022" - arch = "x64" if is64 else "Win32" - ci_cmake_generator = ["-G", generator_name, "-A", arch] - else: - generator_name = "Visual Studio 14" + (" Win64" if is64 else "") - ci_cmake_generator = ["-G", generator_name] - else: - ci_cmake_generator = ["-G", "Unix Makefiles"] cmake_args = ( - (ci_cmake_generator if is_CI_build else []) - + [ + [ # skbuild inserts PYTHON_* vars. That doesn't satisfy opencv build scripts in case of Py3 "-DPYTHON3_EXECUTABLE=%s" % sys.executable, "-DPYTHON_DEFAULT_EXECUTABLE=%s" % sys.executable, From c6bb9ad71a6300f44868e2bd0f44d9cba15d7609 Mon Sep 17 00:00:00 2001 From: Ivan Avdeev Date: Wed, 18 Jun 2025 19:01:52 +0300 Subject: [PATCH 109/109] Update build_wheels_windows.yml --- .github/workflows/build_wheels_windows.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index a05a0d15..8bd9c5ef 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -51,7 +51,7 @@ jobs: uses: actions/checkout@v4 with: submodules: false - fetch-depth: 0 + fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v4 with: @@ -65,11 +65,10 @@ jobs: - 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: | - set "VISUAL_STUDIO=17" 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 cmake 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