From 0da732e80d492c61170ee43ea76c74bf265bce24 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Tue, 3 Oct 2023 13:41:12 +0300 Subject: [PATCH] Python 3.12 support. --- .github/workflows/build_wheels_linux.yml | 6 +++--- .github/workflows/build_wheels_linux_arm.yml | 8 ++++---- .github/workflows/build_wheels_macos.yml | 6 +++--- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- docker/manylinux2014/Dockerfile_x86_64 | 2 +- multibuild | 2 +- setup.py | 4 +++- 8 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 0bfb6ba3..b880c1f7 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] 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.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.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 }}" -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 + 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: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 0db992cc..7edb0c91 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -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:20231006 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20231109 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -84,7 +84,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] 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.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.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 }}" -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 + 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: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1defd1e5..d40c4697 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -105,7 +105,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,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.24.0 + NP_TEST_DEP_LATEST: numpy==1.26.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata @@ -134,7 +134,7 @@ jobs: 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 }}" ]; 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: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2aed7d4b..5d638fd8 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', '3.11'] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b1a98d26..19470a5d 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -89,7 +89,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + 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] diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 9fd6f0fb..9233bffa 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,4 +1,4 @@ -# Version: 20231006 +# Version: 20231109 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest diff --git a/multibuild b/multibuild index 15fd8770..0714f52e 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 15fd8770abe6b12e94c2362ae8f21cd876bd998e +Subproject commit 0714f52ea1ea57a0bc33c7f8b74bae457e1fa8e0 diff --git a/setup.py b/setup.py index f6056969..d8e3c920 100644 --- a/setup.py +++ b/setup.py @@ -32,7 +32,8 @@ def main(): 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', 'numpy>=1.21.0; python_version<="3.9" and platform_system=="Darwin" and platform_machine=="arm64"', 'numpy>=1.21.4; python_version>="3.10" and platform_system=="Darwin"', - "numpy>=1.23.5; python_version>='3.11'" + "numpy>=1.23.5; python_version>='3.11'", + "numpy>=1.26.0; python_version>='3.12'" ] python_version = cmaker.CMaker.get_python_version() @@ -299,6 +300,7 @@ def main(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering",