diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 3176df1a..7bfe8cec 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.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -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:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -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', '3.13'] 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==2.2.1 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 }}" -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 with: @@ -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:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20241202 USE_CCACHE: 1 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 5a9de23f..d643ba8e 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.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -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:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20241202 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', '3.13'] 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==2.2.1 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 }}" -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 with: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1defd1e5..eb797d46 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -20,14 +20,14 @@ on: jobs: Build: - runs-on: macos-11 + runs-on: macos-13 defaults: run: shell: bash strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -98,14 +98,14 @@ jobs: Test: needs: [Build] - runs-on: macos-11 + runs-on: macos-13 defaults: run: shell: bash 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', '3.13'] 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==2.2.1 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 }}" -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 with: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2aed7d4b..ffbdc752 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,11 +20,11 @@ on: jobs: Build: - runs-on: python-macos11-m1 + runs-on: python-macos12-m1 strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -54,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 - 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 + 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 @@ -71,11 +71,11 @@ jobs: Test: needs: [Build] - runs-on: opencv-cn-mac-arm64-tests + runs-on: python-macos12-m1 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', '3.13'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -98,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.15.9 + 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' }} diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b1a98d26..bb7b548b 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.7'] + python-version: ['3.9'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -59,6 +59,8 @@ jobs: 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: | @@ -89,7 +91,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', '3.13'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index e64ea511..0462eee3 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -2985,3 +2985,106 @@ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +------------------------------------------------------------------------------ +Intel(R) IPP ICV library statically linked within x86 and x86_64 opencv-python packages. + +Intel(R) Integrated Performance Primitives 2021 Update 10 + +Intel Simplified Software License (Version October 2022) + +Intel(R) Integrated Performance Primitives (Intel(R) IPP) : Copyright (C) 1997 Intel Corporation + +Use and Redistribution. You may use and redistribute the software, which is +provided in binary form only, (the "Software"), without modification, +provided the following conditions are met: + +* Redistributions must reproduce the above copyright notice and these + terms of use in the Software and in the documentation and/or other materials + provided with the distribution. +* Neither the name of Intel nor the names of its suppliers may be used to + endorse or promote products derived from this Software without specific + prior written permission. +* No reverse engineering, decompilation, or disassembly of the Software is + permitted, nor any modification or alteration of the Software or its operation + at any time, including during execution. + +No other licenses. Except as provided in the preceding section, Intel grants no +licenses or other rights by implication, estoppel or otherwise to, patent, +copyright, trademark, trade name, service mark or other intellectual property +licenses or rights of Intel. + +Third party software. "Third Party Software" means the files (if any) listed +in the "third-party-software.txt" or other similarly-named text file that may +be included with the Software. Third Party Software, even if included with the +distribution of the Software, may be governed by separate license terms, including +without limitation, third party license terms, open source software notices and +terms, and/or other Intel software license terms. These separate license terms +solely govern Your use of the Third Party Software. + +DISCLAIMER. THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE +DISCLAIMED. THIS SOFTWARE IS NOT INTENDED FOR USE IN SYSTEMS OR APPLICATIONS +WHERE FAILURE OF THE SOFTWARE MAY CAUSE PERSONAL INJURY OR DEATH AND YOU AGREE +THAT YOU ARE FULLY RESPONSIBLE FOR ANY CLAIMS, COSTS, DAMAGES, EXPENSES, AND +ATTORNEYS' FEES ARISING OUT OF ANY SUCH USE, EVEN IF ANY CLAIM ALLEGES THAT +INTEL WAS NEGLIGENT REGARDING THE DESIGN OR MANUFACTURE OF THE SOFTWARE. + +LIMITATION OF LIABILITY. IN NO EVENT WILL INTEL BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +No support. Intel may make changes to the Software, at any time without notice, +and is not obligated to support, update or provide training for the Software. + +Termination. Your right to use the Software is terminated in the event of your +breach of this license. + +Feedback. Should you provide Intel with comments, modifications, corrections, +enhancements or other input ("Feedback") related to the Software, Intel will be +free to use, disclose, reproduce, license or otherwise distribute or exploit the +Feedback in its sole discretion without any obligations or restrictions of any +kind, including without limitation, intellectual property rights or licensing +obligations. + +Compliance with laws. You agree to comply with all relevant laws and regulations +governing your use, transfer, import or export (or prohibition thereof) of the +Software. + +Governing law. All disputes will be governed by the laws of the United States of +America and the State of Delaware without reference to conflict of law +principles and subject to the exclusive jurisdiction of the state or federal +courts sitting in the State of Delaware, and each party agrees that it submits +to the personal jurisdiction and venue of those courts and waives any +objections. THE UNITED NATIONS CONVENTION ON CONTRACTS FOR THE INTERNATIONAL +SALE OF GOODS (1980) IS SPECIFICALLY EXCLUDED AND WILL NOT APPLY TO THE SOFTWARE. + +------------------------------------------------------------------------------ +Orbbec SDK distributed with arm64 MacOS packages. + +MIT License + +Copyright (c) 2023 OrbbecDeveloper + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/MANIFEST.in b/MANIFEST.in index b429eae0..cb9a7e7b 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,7 @@ include README.md include find_version.py include setup.py include pyproject.toml +include _build_backend/backend.py recursive-include cv2 * recursive-include docker * recursive-include opencv * diff --git a/README.md b/README.md index 771fa3dc..3a4b46c2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,8 @@ -[![Downloads](http://pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) +[![Downloads](https://static.pepy.tech/badge/opencv-python)](http://pepy.tech/project/opencv-python) + +### Keep OpenCV Free + +OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. [Donate to OpenCV on Github](https://github.com/sponsors/opencv) to show your support. - [OpenCV on Wheels](#opencv-on-wheels) - [Installation and Usage](#installation-and-usage) @@ -153,7 +157,7 @@ If some dependency is not enabled in the pre-built wheels, you can also run the 4. Select the package flavor which you wish to build with `ENABLE_CONTRIB` and `ENABLE_HEADLESS`: i.e. `export ENABLE_CONTRIB=1` if you wish to build `opencv-contrib-python` 5. Run ``pip wheel . --verbose``. NOTE: make sure you have the latest ``pip`` version, the ``pip wheel`` command replaces the old ``python setup.py bdist_wheel`` command which does not support ``pyproject.toml``. - this might take anything from 5 minutes to over 2 hours depending on your hardware -6. Pip will print fresh will location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish. +6. Pip will print fresh wheel location at the end of build procedure. If you use old approach with `setup.py` file wheel package will be placed in `dist` folder. Package is ready and you can do with that whatever you wish. - Optional: on Linux use some of the `manylinux` images as a build hosts if maximum portability is needed and run `auditwheel` for the wheel after build - Optional: on macOS use ``delocate`` (same as ``auditwheel`` but for macOS) for better portability @@ -237,6 +241,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.9 - 3.10 - 3.11 +- 3.12 ### Backward compatibility @@ -244,4 +249,6 @@ Starting from 4.2.0 and 3.4.9 builds the macOS Travis build environment was upda Starting from 4.3.0 and 3.4.10 builds the Linux build environment was updated from `manylinux1` to `manylinux2014`. This dropped support for old Linux distributions. -Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support depricated. See https://github.com/actions/runner-images/issues/5583 +Starting from version 4.7.0 the Mac OS GitHub Actions build environment was update to version 11. Mac OS 10.x support deprecated. See https://github.com/actions/runner-images/issues/5583 + +Starting from version 4.9.0 the Mac OS GitHub Actions build environment was update to version 12. Mac OS 10.x support deprecated by Brew and most of used packages. diff --git a/_build_backend/backend.py b/_build_backend/backend.py new file mode 100644 index 00000000..7fc84138 --- /dev/null +++ b/_build_backend/backend.py @@ -0,0 +1,23 @@ +from setuptools import build_meta as _orig + +prepare_metadata_for_build_wheel = _orig.prepare_metadata_for_build_wheel +build_wheel = _orig.build_wheel +build_sdist = _orig.build_sdist +get_requires_for_build_sdist = _orig.get_requires_for_build_sdist + +def get_requires_for_build_wheel(config_settings=None): + from packaging import version + from skbuild.exceptions import SKBuildError + from skbuild.cmaker import get_cmake_version + packages = _orig.get_requires_for_build_wheel(config_settings) + # check if system cmake can be used if present + # if not, append cmake PyPI distribution to required packages + # scikit-build>=0.18 itself requires cmake 3.5+ + min_version = "3.5" + try: + if version.parse(get_cmake_version().split("-")[0]) < version.parse(min_version): + packages.append(f'cmake>={min_version}') + except SKBuildError: + packages.append(f'cmake>={min_version}') + + return packages diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 26c45e80..9a8bfdde 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,15 +1,16 @@ -# Version: 20230628 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64 FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.3 -ARG FREETYPE_VERSION=2.13.1 -ARG LIBPNG_VERSION=1.6.40 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1u -ARG QT_VERSION=5.15.0 +ARG OPENSSL_VERSION=1_1_1w +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -33,9 +34,10 @@ RUN mkdir ~/libpng_sources && \ cd .. && \ rm -rf ~/libpng_sources +# looks like download.savannah.gnu.org suffers from https://savannah.gnu.org/bugs/?48150 in Manylinux 2014 env on aarch64 RUN mkdir ~/freetype_sources && \ cd ~/freetype_sources && \ - curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + curl -O -L https://download-mirror.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ cd freetype-${FREETYPE_VERSION} && \ ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \ @@ -44,8 +46,8 @@ RUN mkdir ~/freetype_sources && \ cd .. && \ rm -rf ~/freetype_sources -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ - tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ +RUN curl -C - -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ @@ -92,7 +94,7 @@ RUN mkdir ~/yasm_sources && \ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ - git clone --depth 1 https://github.com/webmproject/libvpx.git && \ + git clone --depth 1 -b ${VPX_VERSION} https://github.com/webmproject/libvpx.git && \ cd libvpx && \ ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index c11f6a4d..1c94b1fc 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -2,9 +2,9 @@ FROM quay.io/pypa/manylinux2014_i686:latest ARG CCACHE_VERSION=3.7.9 ARG CMAKE_VERSION=3.17.0 -ARG FFMPEG_VERSION=5.1.2 +ARG FFMPEG_VERSION=5.1.4 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1s +ARG OPENSSL_VERSION=1_1_1w ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index d34f19f5..088d8df5 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,15 +1,16 @@ -# Version: 20230628 +# Version: 20241202 # Image name: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64 FROM quay.io/pypa/manylinux2014_x86_64:latest ARG CCACHE_VERSION=3.7.9 -ARG FFMPEG_VERSION=5.1.3 -ARG FREETYPE_VERSION=2.13.1 -ARG LIBPNG_VERSION=1.6.40 +ARG FFMPEG_VERSION=5.1.6 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.44 +ARG VPX_VERSION=v1.15.0 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1u -ARG QT_VERSION=5.15.0 +ARG OPENSSL_VERSION=1_1_1w +ARG QT_VERSION=5.15.16 ARG YASM_VERSION=1.3.0 ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH @@ -44,8 +45,8 @@ RUN mkdir ~/freetype_sources && \ cd .. && \ rm -rf ~/freetype_sources -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/${QT_VERSION}/single/qt-everywhere-src-${QT_VERSION}.tar.xz && \ - tar -xf qt-everywhere-src-${QT_VERSION}.tar.xz && \ +RUN curl -O -L https://download.qt.io/archive/qt/5.15/${QT_VERSION}/single/qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ + tar -xf qt-everywhere-opensource-src-${QT_VERSION}.tar.xz && \ cd qt-everywhere-src-${QT_VERSION} && \ export MAKEFLAGS=-j$(nproc) && \ ./configure -prefix /opt/Qt${QT_VERSION} -release -opensource -confirm-license -qtnamespace QtOpenCVPython -xcb -xcb-xlib -bundled-xcb-xinput -no-openssl -no-dbus -skip qt3d -skip qtactiveqt -skip qtcanvas3d -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgamepad -skip qtgraphicaleffects -skip qtimageformats -skip qtlocation -skip qtmultimedia -skip qtpurchasing -skip qtqa -skip qtremoteobjects -skip qtrepotools -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttranslations -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebsockets -skip qtwebview -skip xmlpatterns -skip declarative -make libs && \ @@ -92,7 +93,7 @@ RUN mkdir ~/yasm_sources && \ RUN mkdir ~/libvpx_sources && \ cd ~/libvpx_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ 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/opencv b/opencv index f9a59f25..31b0eeea 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit f9a59f2592993d3dcc080e495f4f5e02dd8ec7ef +Subproject commit 31b0eeea0b44b370fd0712312df4214d4ae1b158 diff --git a/opencv_contrib b/opencv_contrib index f10c84d4..0e5254eb 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f10c84d48b0714f2b408c9e5cccfac1277c8e6cc +Subproject commit 0e5254ebf54d2aed6e7eaf6660bf3b797cf50a02 diff --git a/opencv_extra b/opencv_extra index fdd66bfc..a74cf6ba 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit fdd66bfcc3ced243d682fe03f0858bf43867656c +Subproject commit a74cf6bae7fd75d91282b877c559168b3a62148a diff --git a/patches/patchQtPlugins b/patches/patchQtPlugins index a05a5f83..b274aa08 100644 --- a/patches/patchQtPlugins +++ b/patches/patchQtPlugins @@ -9,7 +9,7 @@ index 4c0b3880fc..dffa0a4caa 100644 + install(DIRECTORY ${Qt5_DIR}/../../../plugins DESTINATION lib/qt) + endif() + if(UNIX AND NOT APPLE) -+ install(DIRECTORY /opt/Qt5.15.0/plugins DESTINATION lib/qt) ++ install(DIRECTORY /opt/Qt5.15.16/plugins DESTINATION lib/qt) + install(DIRECTORY /usr/share/fonts DESTINATION lib/qt) + endif() if(HAVE_QT_OPENGL) diff --git a/pyproject.toml b/pyproject.toml index 00176366..d70b49ef 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,16 +1,18 @@ [build-system] requires = [ - "cmake>=3.1", "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.22.2; python_version>='3.11'", + "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'", + "packaging", "pip", "scikit-build>=0.14.0", - "setuptools==59.2.0", + "setuptools==59.2.0; python_version<'3.12'", + "setuptools<70.0.0; python_version>='3.12'", ] +# use a custom backend to manage CMake check / installation +# see https://scikit-build.readthedocs.io/en/latest/usage.html#adding-cmake-as-building-requirement-only-if-not-installed-or-too-low-a-version +build-backend = "backend" +backend-path = ["_build_backend"] diff --git a/setup.py b/setup.py index f6056969..1dfab2fb 100644 --- a/setup.py +++ b/setup.py @@ -7,8 +7,7 @@ import re import sysconfig import platform -import skbuild -from skbuild import cmaker +from skbuild import cmaker, setup def main(): @@ -32,7 +31,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() @@ -110,7 +110,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_videoio_ffmpeg\d{3}%s\.dll" % ("_64" if is64 else "")] + [r"bin/opencv_videoio_ffmpeg\d{4}%s\.dll" % ("_64" if is64 else "")] if os.name == "nt" else [] ) @@ -118,8 +118,11 @@ def main(): # 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. + # If not specifying PY_LIMITED_API, the Python sources go under python/cv2/python-3.MINOR_VERSION/ instead of python/cv2/python-3/ [ - r"python/cv2/python-%s/cv2.*" + r"python/cv2/python-%s*/cv2.*" + % (sys.version_info[0]) if 'CMAKE_ARGS' in os.environ and "-DPYTHON3_LIMITED_API=ON" in os.environ['CMAKE_ARGS'] + else r"python/cv2/python-%s.*/cv2.*" % (sys.version_info[0]) ] + @@ -264,7 +267,7 @@ def main(): rearrange_cmake_output_data, files_outside_package_dir, package_data.keys() ) - skbuild.setup( + setup( name=package_name, version=package_version, url="https://github.com/opencv/opencv-python", @@ -299,6 +302,8 @@ def main(): "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: C++", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Scientific/Engineering", @@ -309,6 +314,7 @@ def main(): cmake_source_dir=cmake_source_dir, ) + print("OpenCV is raising funds to keep the library free for everyone, and we need the support of the entire community to do it. Donate to OpenCV on GitHub:\nhttps://github.com/sponsors/opencv\n") class RearrangeCMakeOutput: """ diff --git a/travis_config.sh b/travis_config.sh index b91d63c4..fcdd4f60 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -34,7 +34,7 @@ if [ -n "$IS_OSX" ]; then export MAKEFLAGS="-j$(sysctl -n hw.ncpu)" else echo " > Linux environment " - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.0/lib + export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/Qt5.15.16/lib export MAKEFLAGS="-j$(grep -E '^processor[[:space:]]*:' /proc/cpuinfo | wc -l)" CURRENT_ARCH=$(uname -m) if [[ $CURRENT_ARCH == 'aarch64' ]]; then diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 1a2a1c6c..42e71446 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -265,14 +265,14 @@ function _brew_parse_bottle_json { local JSON; JSON="${1:?}"; shift - local JSON_DATA; JSON_DATA=$(python2.7 -c 'if True: + local JSON_DATA; JSON_DATA=$(python3 -c 'if True: import sys,json; j=json.load(open(sys.argv[1],"rb")); [name]=j.keys(); [pdata]=j.values() - print name - print pdata["formula"]["pkg_version"] - print pdata["bottle"]["rebuild"] + print(name) + print(pdata["formula"]["pkg_version"]) + print(pdata["bottle"]["rebuild"]) [(tag_name, tag_dict)]=pdata["bottle"]["tags"].items() - print tag_name - print tag_dict["sha256"] + print(tag_name) + print(tag_dict["sha256"]) ' "$JSON") unset JSON @@ -292,15 +292,15 @@ function _brew_parse_package_info { PACKAGE="${1:?}"; shift OS_CODENAME="${1:?}"; shift - local JSON_DATA; JSON_DATA=$(python2.7 -c 'if True: + local JSON_DATA; JSON_DATA=$(python3 -c 'if True: import sys, json, subprocess; j=json.loads(subprocess.check_output(("brew","info","--json=v1",sys.argv[1]))) data=j[0] revision=data["revision"] # in bottle''s json, revision is included into version; here, they are separate - print data["versions"]["stable"]+("_"+str(revision) if revision else "") + print(data["versions"]["stable"]+("_"+str(revision) if revision else "")) bottle_data=data["bottle"].get("stable",{"rebuild":"","files":{}}) - print bottle_data["rebuild"] - print bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"] #prevent losing trailing blank line to command substitution + print(bottle_data["rebuild"]) + print(bottle_data["files"].get(sys.argv[2],{"sha256":"!?"})["sha256"]) #prevent losing trailing blank line to command substitution ' \ "$PACKAGE" "$OS_CODENAME"); JSON_DATA="${JSON_DATA%\!\?}" #!? can't occur in a hash