From c440c711353556cc1818a886d9c8b490c85a9be9 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Sun, 16 Jun 2024 17:44:57 +0300 Subject: [PATCH 1/3] Use Numpy 2.0 for Python 3.9+ packages. --- .github/workflows/build_wheels_linux.yml | 6 ++---- .github/workflows/build_wheels_linux_arm.yml | 6 ++---- .github/workflows/build_wheels_macos.yml | 6 ++---- .github/workflows/build_wheels_macos_m1.yml | 4 +--- .github/workflows/build_wheels_windows.yml | 4 +--- pyproject.toml | 10 +++------- 6 files changed, 11 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 0e202f63..43137e11 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -3,8 +3,6 @@ name: Linux x86_64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: @@ -27,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.7', '3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -93,7 +91,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.26.0 + NP_TEST_DEP_LATEST: numpy==2.0.0 CONFIG_PATH: travis_config.sh PLAT: x86_64 steps: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 4c1fc48e..b6feb358 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -3,8 +3,6 @@ name: Linux ARM64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: @@ -27,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.7', '3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -94,7 +92,7 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.26.0 + NP_TEST_DEP_LATEST: numpy==2.0.0 CONFIG_PATH: travis_config.sh DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 UNICODE_WIDTH: 32 diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index dd3bc654..2a1e52cc 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -3,8 +3,6 @@ name: macOS x86_64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: @@ -27,7 +25,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.7', '3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -114,7 +112,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.26.0 + 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 diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index f0e41d3a..2b9c8eb6 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -3,8 +3,6 @@ name: macOS ARM64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: @@ -24,7 +22,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.7', '3.9'] 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 19470a5d..ff4bb5b2 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -3,8 +3,6 @@ name: Windows x86_64 on: pull_request: branches: - - master - - 3.4 - 4.x - 5.x paths-ignore: @@ -23,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.7', '3.9'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/pyproject.toml b/pyproject.toml index 7486f132..8c721443 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,13 +4,9 @@ requires = [ "numpy==1.13.3; python_version=='3.6' 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.5; 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'", - "numpy==1.19.3; python_version=='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'", - "numpy==1.21.2; python_version=='3.10' and platform_system!='Darwin'", - "numpy==1.21.4; python_version=='3.10' and platform_system=='Darwin'", - "numpy==1.23.5; python_version=='3.11'", - "numpy>=1.26.4; python_version>='3.12'", + "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'", + "numpy==2.0.0; python_version>='3.9'", "pip", "scikit-build>=0.14.0", "setuptools==59.2.0", From 214f2cd8aaf180c3d2a159ae94a536bb48cd8ac8 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 17 Jun 2024 11:10:22 +0300 Subject: [PATCH 2/3] Substitute python limited API version for current interpriter. --- travis_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/travis_config.sh b/travis_config.sh index 903ceafb..caa606eb 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=cp37 -v + CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api="cp${PYTHON_VERSION//./}" -v cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then # this path can be changed in the latest manylinux image From 6d30be8598858c1c2aeadfcd6ccaebcf15f39f97 Mon Sep 17 00:00:00 2001 From: Alexander Smorkalov Date: Mon, 17 Jun 2024 11:41:29 +0300 Subject: [PATCH 3/3] Substitute python limited API version for current interpriter on Windows and Mac M1. --- .github/workflows/build_wheels_macos_m1.yml | 6 ++++-- .github/workflows/build_wheels_windows.yml | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2b9c8eb6..48963e88 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -32,6 +32,8 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + PYTHON_VERSION: ${{ matrix.python-version }} + MACOSX_DEPLOYMENT_TARGET: 11.0 PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple steps: - name: Cleanup @@ -52,9 +54,9 @@ jobs: git submodule update --init multibuild echo $ENABLE_CONTRIB > contrib.enabled echo $ENABLE_HEADLESS > headless.enabled - export MACOSX_DEPLOYMENT_TARGET=11.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 + export PYTHON_VERSION=${{ matrix.python-version }} + python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api="cp${PYTHON_VERSION//./}" --dist-dir=wheelhouse -v delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - name: Saving all wheels uses: actions/upload-artifact@v3 diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ff4bb5b2..6780918e 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -31,6 +31,7 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} + PYTHON_VERSION: ${{ matrix.python-version }} OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata steps: - name: Cleanup @@ -65,7 +66,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=cp37 --dist-dir=%cd%\wheelhouse -v + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp%PYTHON_VERSION:.=% --dist-dir=%cd%\wheelhouse -v shell: cmd - name: Saving all wheels uses: actions/upload-artifact@v3 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy