From 339bca572ecd866b56df1f61214cbf03c5f276f2 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov <2536374+asmorkalov@users.noreply.github.com> Date: Thu, 29 Dec 2022 21:59:32 +0300 Subject: [PATCH] OpenCV 4.7.0 release preparation - Python 3.7 as baseline - Python 3.11 support - Various updates --- .github/workflows/build_wheels_linux.yml | 8 ++++---- .github/workflows/build_wheels_linux_arm.yml | 8 ++++---- .github/workflows/build_wheels_macos.yml | 16 +++++++++++----- .github/workflows/build_wheels_macos_m1.yml | 4 ++-- .github/workflows/build_wheels_windows.yml | 8 ++++---- multibuild | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- patch_auditwheel_whitelist.py | 5 +++-- pyproject.toml | 2 +- setup.py | 2 +- travis_config.sh | 6 +++--- 13 files changed, 37 insertions(+), 30 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index ce656ac0..95e35898 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -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'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +93,7 @@ jobs: ACTIONS_ALLOW_UNSECURE_COMMANDS: true MB_PYTHON_VERSION: ${{ matrix.python-version }} NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 + NP_TEST_DEP_LATEST: numpy==1.24.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: @@ -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 }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 3f62a213..b025e285 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -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'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +94,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.4 + NP_TEST_DEP_LATEST: numpy==1.24.0 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 @@ -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 }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 6545902e..43f98c7f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -27,7 +27,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -58,6 +58,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: @@ -100,7 +106,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'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -109,7 +115,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==1.24.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -129,7 +135,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 }}" ]; 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: @@ -146,7 +152,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 diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 5e60c47d..8d383088 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -75,7 +75,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -109,7 +109,7 @@ jobs: arch -arm64 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 + arch -arm64 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 diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 07bb00cc..b1a98d26 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.6'] + python-version: ['3.7'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -67,7 +67,7 @@ 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" && 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 @@ -89,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'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -133,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 diff --git a/multibuild b/multibuild index bce1637e..15fd8770 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit bce1637e202cb52b0e7ea42baa1cccc894b82806 +Subproject commit 15fd8770abe6b12e94c2362ae8f21cd876bd998e diff --git a/opencv b/opencv index ab912329..725e440d 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit ab912329b67d3a142a1b399b4bc9fa9b68cd8df6 +Subproject commit 725e440d278aca07d35a5e8963ef990572b07316 diff --git a/opencv_contrib b/opencv_contrib index d6102ef6..e247b680 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit d6102ef65f9ccdb37bba0ea9b8254951eb89dc39 +Subproject commit e247b680a6bd396f110274b6c214406a93171350 diff --git a/opencv_extra b/opencv_extra index 531785fb..5abbd7e0 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 531785fb1a42b2665e0e06c8b191de58db6deb10 +Subproject commit 5abbd7e0546bbb34ae7487170383d3e571fb1dd1 diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index 150f97ca..d1345911 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -12,9 +12,10 @@ def add_zlib_versions(): for line in manylinux_policy_lines: if "ZLIB" in line: if len(line) > 22: - updated_line = line[:-2] + ', "1.2.9", "1.2.12"]' + updated_line = line[:-2] + ', "1.2.9", "1.2.12", "1.2.13"]' else: - updated_line = line[:-2] + '"1.2.9", "1.2.12"]' + updated_line = line[:-2] + '"1.2.9", "1.2.12", "1.2.13"]' + print("auditwheel patch: replace policy line \"%s\" with \"%s\"" % (line, updated_line)) manylinux_policy_replacement = line.replace(line, updated_line) else: manylinux_policy_replacement = line diff --git a/pyproject.toml b/pyproject.toml index 5993a2ac..e30a76fc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,7 @@ requires = [ "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", + "numpy==1.17.0; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.19.3; python_version<='3.9' and sys_platform == 'linux' and platform_machine == 'aarch64'", "numpy==1.21.0; python_version<='3.9' and sys_platform == 'darwin' and platform_machine == 'arm64'", diff --git a/setup.py b/setup.py index 39b8b9bd..a5f5fc0e 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ def main(): install_requires = [ 'numpy>=1.13.3; python_version<"3.7"', - 'numpy>=1.14.5; python_version>="3.7"', + 'numpy>=1.17.0; python_version>="3.7"', # https://github.com/numpy/numpy/pull/13725 'numpy>=1.17.3; python_version>="3.8"', 'numpy>=1.19.3; python_version>="3.9"', 'numpy>=1.21.2; python_version>="3.10"', diff --git a/travis_config.sh b/travis_config.sh index e0ba15e1..b91d63c4 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -16,7 +16,7 @@ function bdist_wheel_cmd { local abs_wheelhouse=$1 # install all required packages in pyproject.toml, because bdist_wheel does not do it python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin - CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp36 -v + CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp37 -v cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then # this path can be changed in the latest manylinux image @@ -143,7 +143,7 @@ function run_tests { echo "Running for linux" - if [ $PYTHON == "python3.6" ]; then + if [ $PYTHON == "python3.7" ]; then $PYTHON -m pip install -U numpy==1.19.4 fi cd /io/tests @@ -168,7 +168,7 @@ function pylint_test { echo "Starting Pylint tests..." - $PYTHON -m pip install pylint==2.12.2 + $PYTHON -m pip install pylint==2.15.9 cd /io/tests $PYTHON -m pylint /io/opencv/samples/python/squares.py }