Skip to content

Commit

Permalink
Merge branch '4.x' into 5.x-merge-4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
asmorkalov committed Dec 4, 2024
2 parents 8a47bfa + 6a181ce commit dbaf1a2
Show file tree
Hide file tree
Showing 21 changed files with 900 additions and 215 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build_wheels_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.9']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -41,7 +41,7 @@ jobs:
MB_ML_VER: 2014
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220824
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524
USE_CCACHE: 0
UNICODE_WIDTH: 32
PLAT: x86_64
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -93,7 +93,7 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MB_PYTHON_VERSION: ${{ matrix.python-version }}
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.2
NP_TEST_DEP_LATEST: numpy==2.0.0
CONFIG_PATH: travis_config.sh
PLAT: x86_64
steps:
Expand All @@ -106,7 +106,7 @@ jobs:
submodules: true
fetch-depth: 0
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
NP_TEST_DEP: numpy==1.19.4
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20220628
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524
USE_CCACHE: 1
UNICODE_WIDTH: 32
SDIST: ${{ matrix.build_sdist || 0 }}
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/build_wheels_linux_arm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.9']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -42,7 +42,7 @@ jobs:
MB_ML_VER: 2014
TRAVIS_BUILD_DIR: ${{ github.workspace }}
CONFIG_PATH: travis_config.sh
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20220824
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20240524
USE_CCACHE: 0
UNICODE_WIDTH: 32
SDIST: ${{ matrix.build_sdist || 0 }}
Expand Down Expand Up @@ -84,7 +84,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -94,7 +94,7 @@ jobs:
MB_PYTHON_VERSION: ${{ matrix.python-version }}
PLAT: aarch64
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.4
NP_TEST_DEP_LATEST: numpy==2.0.0
CONFIG_PATH: travis_config.sh
DOCKER_TEST_IMAGE: multibuild/focal_arm64v8
UNICODE_WIDTH: 32
Expand All @@ -108,7 +108,7 @@ jobs:
submodules: true
fetch-depth: 0
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/build_wheels_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ on:

jobs:
Build:
runs-on: macos-11
runs-on: macos-12
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.9']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -45,11 +45,9 @@ jobs:
USE_CCACHE: 1
UNICODE_WIDTH: 32
PLAT: x86_64
FFMPEG_FORMULA_VERSION: '@4'
SDIST: ${{ matrix.build_sdist || 0 }}
ENABLE_HEADLESS: ${{ matrix.without_gui }}
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
MACOSX_DEPLOYMENT_TARGET: 10.13
steps:
- name: Cleanup
run: find . -mindepth 1 -delete
Expand All @@ -59,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:
Expand Down Expand Up @@ -94,14 +98,14 @@ jobs:

Test:
needs: [Build]
runs-on: macos-11
runs-on: macos-12
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -110,7 +114,7 @@ jobs:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
MB_PYTHON_VERSION: ${{ matrix.python-version }}
NP_TEST_DEP: numpy==1.19.4
NP_TEST_DEP_LATEST: numpy==1.21.4
NP_TEST_DEP_LATEST: numpy==2.0.0
CONFIG_PATH: travis_config.sh
PLAT: x86_64
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
Expand All @@ -130,7 +134,7 @@ jobs:
python-version: ${{ matrix.python-version }}
architecture: ${{ matrix.platform }}
- name: Setup Environment variables
run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
- name: Download a wheel accordingly to matrix
uses: actions/download-artifact@v3
with:
Expand All @@ -147,7 +151,7 @@ jobs:
python modules/python/test/test.py -v --repo .
- name: Pylint test
run: |
python -m pip install pylint==2.12.2
python -m pip install pylint==2.15.9
cd ${{ github.workspace }}/tests
python -m pylint $PYLINT_TEST_FILE
Expand Down
30 changes: 20 additions & 10 deletions .github/workflows/build_wheels_macos_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ on:

jobs:
Build:
runs-on: opencv-cn-mac-arm64
runs-on: python-macos11-m1
strategy:
fail-fast: false
matrix:
python-version: ['3.7']
python-version: ['3.9']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand All @@ -34,6 +34,7 @@ jobs:
SDIST: ${{ matrix.build_sdist || 0 }}
ENABLE_HEADLESS: ${{ matrix.without_gui }}
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
steps:
- name: Cleanup
run: find . -mindepth 1 -delete
Expand All @@ -54,8 +55,8 @@ jobs:
echo $ENABLE_CONTRIB > contrib.enabled
echo $ENABLE_HEADLESS > headless.enabled
export MACOSX_DEPLOYMENT_TARGET=11.0
arch -arm64 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
arch -arm64 python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
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
Expand All @@ -74,14 +75,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
platform: [x64]
with_contrib: [0, 1]
without_gui: [0, 1]
build_sdist: [0]
env:
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
Expand All @@ -96,20 +98,28 @@ jobs:
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: |
arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall 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
arch -arm64 python${{ matrix.python-version }} 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
arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
- name: Pylint test
run: |
arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2
source ${{ github.workspace }}/opencv_test/bin/activate
python${{ matrix.python-version }} -m pip install pylint==2.15.9
cd ${{ github.workspace }}/tests
arch -arm64 python${{ matrix.python-version }} -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' }}
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6']
python-version: ['3.9']
platform: [x86, x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -60,12 +60,14 @@ jobs:
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.1
- 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=cp36 --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@v3
Expand All @@ -87,7 +89,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
platform: [x86, x64]
with_contrib: [0, 1]
without_gui: [0, 1]
Expand Down Expand Up @@ -131,7 +133,7 @@ jobs:
python modules\python\test\test.py -v --repo .
- name: Pylint test
run: |
python -m pip install pylint==2.12.2
python -m pip install pylint==2.15.9
cd ${{ github.workspace }}\tests
python -m pylint $PYLINT_TEST_FILE
Expand Down
Loading

0 comments on commit dbaf1a2

Please sign in to comment.