From 3e517ca0b39d1f2a379158f2f543e8140881f8a3 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:10:21 +0200 Subject: [PATCH 01/13] 3.4.x uses BSD --- LICENSE-3RD-PARTY.txt | 242 +++++++----------------------------------- 1 file changed, 41 insertions(+), 201 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 20f4fb37..60c34bc0 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -1,208 +1,48 @@ OpenCV library is redistributed within opencv-python package. This license applies to OpenCV binary in the directory cv2/. +By downloading, copying, installing or using the software you agree to this license. +If you do not agree to this license, do not download, install, +copy or use the software. - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. + + License Agreement + For Open Source Computer Vision Library + (3-clause BSD License) + +Copyright (C) 2000-2020, Intel Corporation, all rights reserved. +Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. +Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. +Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. +Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +Copyright (C) 2015-2016, Itseez Inc., all rights reserved. +Copyright (C) 2019-2020, Xperience AI, all rights reserved. +Third party copyrights are property of their respective owners. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + * Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + * Neither the names of the copyright holders nor the names of the contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + +This software is provided by the copyright holders and contributors "as is" and +any express or implied warranties, including, but not limited to, the implied +warranties of merchantability and fitness for a particular purpose are disclaimed. +In no event shall copyright holders or contributors 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. ------------------------------------------------------------------------------ libvpx is redistributed within all opencv-python Linux packages. From fe3c2a1691b5a77bd22de7b28359da79c664a0a7 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:13:15 +0200 Subject: [PATCH 02/13] update 3.4.x specific parts --- README.md | 4 ++-- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 232aa318..3b181532 100644 --- a/README.md +++ b/README.md @@ -171,13 +171,13 @@ On slow systems such as Raspberry Pi the full build may take several hours. On a Opencv-python package (scripts in this repository) is available under MIT license. -OpenCV itself is available under [Apache 2](https://github.com/opencv/opencv/blob/master/LICENSE) license. +OpenCV itself is available under [3-clause BSD License](https://github.com/opencv/opencv/blob/master/LICENSE). Third party package licenses are at [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). All wheels ship with [FFmpeg](http://ffmpeg.org) licensed under the [LGPLv2.1](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html). -Non-headless Linux and MacOS wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). +Non-headless Linux wheels ship with [Qt 5](http://doc.qt.io/qt-5/lgpl.html) licensed under the [LGPLv3](http://www.gnu.org/licenses/lgpl-3.0.html). The packages include also other binaries. Full list of licenses can be found from [LICENSE-3RD-PARTY.txt](https://github.com/skvark/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). diff --git a/setup.py b/setup.py index 67f22c60..cc3bb605 100644 --- a/setup.py +++ b/setup.py @@ -93,7 +93,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 x64 else "")] + [r"bin/opencv_ffmpeg\d{3,4}%s\.dll" % ("_64" if x64 else "")] if os.name == "nt" else [] ) @@ -106,7 +106,7 @@ def main(): % {"ext": re.escape(sysconfig.get_config_var("EXT_SUFFIX"))} ], "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH - ("etc" if os.name == "nt" else "share/opencv4") + r"/haarcascades/.*\.xml" + ("etc" if os.name == "nt" else "share/OpenCV") + r"/haarcascades/.*\.xml" ], } From 427f4994ec9a0c0e78f83c5cebb01b8d17d3196e Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:15:57 +0200 Subject: [PATCH 03/13] OpenCV 3.4.13 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 1363496c..8869dc77 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 1363496c1106606684d40447f5d1149b2c66a9f8 +Subproject commit 8869dc776287a1b43b252a91ceb36cc26a56eed4 diff --git a/opencv_contrib b/opencv_contrib index b91a781c..1186eaa3 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit b91a781cbc1285d441aa682926d93d8c23678b0b +Subproject commit 1186eaa3276c4bfe0bf81b3519e75855eab97ed2 From 6c9ce3833bbebe87af4656e2f18337087735cb68 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Sat, 1 May 2021 23:26:17 +0300 Subject: [PATCH 04/13] Update opencv 3.4.13 -> 3.4.14 --- opencv | 2 +- opencv_contrib | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/opencv b/opencv index 8869dc77..d0e3e638 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 8869dc776287a1b43b252a91ceb36cc26a56eed4 +Subproject commit d0e3e638c35d875c86fac3410d93f02f885e27ba diff --git a/opencv_contrib b/opencv_contrib index 1186eaa3..4de4edeb 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 1186eaa3276c4bfe0bf81b3519e75855eab97ed2 +Subproject commit 4de4edeba691d8ed0420f3581fb80133589f4cdf From ff8fe35e5ab8f20a0383977dbc7e6355f8d85571 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Wed, 5 May 2021 15:52:43 +0300 Subject: [PATCH 05/13] Apply review comment - unify spaces inside the double brackets for variable substitution --- .github/workflows/build_wheels.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index cbed8b6c..8f9497fe 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -27,7 +27,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -108,7 +108,7 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -197,9 +197,9 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} + SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} - ENABLE_CONTRIB: ${{ matrix.with_contrib || 0}} + ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} steps: - name: Checkout From 23b92ebd7736bbe03d6d96706df71a5fc49f8f47 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Wed, 5 May 2021 21:47:10 +0300 Subject: [PATCH 06/13] Update years in opencv license according to the original repo (#477) --- LICENSE-3RD-PARTY.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 60c34bc0..87c0514e 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -10,13 +10,13 @@ copy or use the software. For Open Source Computer Vision Library (3-clause BSD License) -Copyright (C) 2000-2020, Intel Corporation, all rights reserved. +Copyright (C) 2000-2021, Intel Corporation, all rights reserved. Copyright (C) 2009-2011, Willow Garage Inc., all rights reserved. Copyright (C) 2009-2016, NVIDIA Corporation, all rights reserved. Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved. -Copyright (C) 2015-2016, OpenCV Foundation, all rights reserved. +Copyright (C) 2015-2021, OpenCV Foundation, all rights reserved. Copyright (C) 2015-2016, Itseez Inc., all rights reserved. -Copyright (C) 2019-2020, Xperience AI, all rights reserved. +Copyright (C) 2019-2021, Xperience AI, all rights reserved. Third party copyrights are property of their respective owners. Redistribution and use in source and binary forms, with or without modification, From b1050af0069aab9803925f3b60986102dc31b2c4 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 12 May 2021 09:54:34 +0300 Subject: [PATCH 07/13] Added the arm build for 3.4 branch --- .github/workflows/build_wheels.yml | 106 ++++++++++++++++++++++++++++- .gitmodules | 3 + opencv_extra | 1 + travis_config.sh | 15 ++-- 4 files changed, 119 insertions(+), 6 deletions(-) create mode 160000 opencv_extra diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml index 75ce49d4..b5ee997c 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels.yml @@ -244,9 +244,111 @@ jobs: name: wheels path: dist/opencv*.tar.gz + build_arm: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ARM64] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + USE_CCACHE: 0 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Environment variables + run: | + if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + - name: before install + run: | + set -e + if [[ $SDIST == 0 ]]; then + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x + # Build and package + set -x + ls + if [[ $SDIST == 1 ]]; then + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + else + build_wheel $REPO_DIR $PLAT + fi + set +x + # Install and run tests + set -x + if [[ $SDIST == 1 ]]; then + echo "skipping tests because of sdist" + rc=0 + else + install_run $PLAT && rc=$? || rc=$? + fi + set +x + #otherwise, Travis logic terminates prematurely + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 + trap ERR + test "$rc" -eq 0 + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build-windows-x86_64, build_sdist, build_arm] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -265,7 +367,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist] + needs: [build, build-windows-x86_64, build_sdist, build_arm] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.gitmodules b/.gitmodules index f2e0d283..655467e8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "multibuild"] path = multibuild url = https://github.com/matthew-brett/multibuild.git +[submodule "opencv_extra"] + path = opencv_extra + url = https://github.com/opencv/opencv_extra.git diff --git a/opencv_extra b/opencv_extra new file mode 160000 index 00000000..3b033d09 --- /dev/null +++ b/opencv_extra @@ -0,0 +1 @@ +Subproject commit 3b033d09cab1894d6452707df723789fe98c8663 diff --git a/travis_config.sh b/travis_config.sh index aac66317..b1a991a4 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -146,24 +146,31 @@ function run_tests { echo "Run tests..." echo $PWD + PYTHON=python$PYTHON_VERSION + if [ -n "$IS_OSX" ]; then echo "Running for OS X" - cd ../tests/ + cd ../opencv/ + export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata else echo "Running for linux" - cd /io/tests/ + + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 + fi + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata fi test_wheels } function test_wheels { - PYTHON=python$PYTHON_VERSION echo "Starting tests..." #Test package - $PYTHON -m unittest test + $PYTHON modules/python/test/test.py -v --repo . } export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' From 1720df21dd156c097948ada7461e6e11197a96f2 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 18 May 2021 17:36:32 +0300 Subject: [PATCH 08/13] Split workflows according to platforms --- ...uild_wheels.yml => build_wheels_linux.yml} | 189 +----------------- .github/workflows/build_wheels_linux_arm.yml | 167 ++++++++++++++++ .github/workflows/build_wheels_macos.yml | 151 ++++++++++++++ .github/workflows/build_wheels_windows.yml | 132 ++++++++++++ 4 files changed, 460 insertions(+), 179 deletions(-) rename .github/workflows/{build_wheels.yml => build_wheels_linux.yml} (59%) create mode 100644 .github/workflows/build_wheels_linux_arm.yml create mode 100644 .github/workflows/build_wheels_macos.yml create mode 100644 .github/workflows/build_wheels_windows.yml diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels_linux.yml similarity index 59% rename from .github/workflows/build_wheels.yml rename to .github/workflows/build_wheels_linux.yml index b5ee997c..87df6861 100644 --- a/.github/workflows/build_wheels.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,83 +1,14 @@ -name: Build PYPI wheels for opencv-python +name: Build PYPI wheels for opencv-python on Linux x86_64 on: pull_request: branches: - - master + - 3.4 release: types: [published, edited] jobs: - build-windows-x86_64: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: powershell - - strategy: - fail-fast: false - matrix: - os: [windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9] - platform: [x86, x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - SDIST: ${{ matrix.build_sdist || 0 }} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - - steps: - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - - name: Update submodules - run: | - git submodule update --remote - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - - name: Setup MSBuild.exe - uses: warrenbuckley/Setup-MSBuild@v1 - - - name: build script - run: | - python --version - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose - shell: cmd - - - name: before test - run: | - cd ${{ github.workspace }}/tests - &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - shell: powershell - - - name: run test - run: | - cd ${{ github.workspace }}/tests - python -m unittest test - shell: cmd - - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: wheelhouse/opencv*.whl - build: runs-on: ${{ matrix.os }} defaults: @@ -87,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest] python-version: [3.6, 3.7, 3.8, 3.9] platform: [x64] with_contrib: [0, 1] @@ -108,7 +39,7 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0 }} + SDIST: ${{ matrix.build_sdist || 0}} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -159,6 +90,7 @@ jobs: build_wheel $REPO_DIR $PLAT install_run $PLAT set +x + - name: saving artifacts uses: actions/upload-artifact@v2 with: @@ -197,9 +129,9 @@ jobs: DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0 }} + SDIST: ${{ matrix.build_sdist || 0}} ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} - ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} + ENABLE_CONTRIB: ${{ matrix.with_contrib || 0}} steps: - name: Checkout @@ -238,117 +170,16 @@ jobs: # Install and run tests set -x echo "skipping tests because of sdist" - - name: saving artifacts - uses: actions/upload-artifact@v2 - with: - name: wheels - path: dist/opencv*.tar.gz - - build_arm: - runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - os: [ARM64] - python-version: [3.6, 3.7, 3.8, 3.9] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - BUILD_COMMIT: master - PROJECT_SPEC: opencv-python - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - MB_ML_VER: 2014 - NP_TEST_DEP: numpy - TRAVIS_BUILD_DIR: ${{ github.workspace }} - CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} - DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 - USE_CCACHE: 0 - UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0}} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - - steps: - - name: Cleanup - if: always() - uses: AutoModality/action-clean@v1 - - - name: Checkout - uses: actions/checkout@v2 - with: - submodules: true - fetch-depth: 0 - - - name: Setup Environment variables - run: | - if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; - echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - name: before install - run: | - set -e - if [[ $SDIST == 0 ]]; then - # Check out and prepare the source - # Multibuild doesn't have releases, so --depth would break eventually (see - # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) - git submodule update --init multibuild - source multibuild/common_utils.sh - # https://github.com/matthew-brett/multibuild/issues/116 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi - source multibuild/travis_steps.sh - # This sets -x - # source travis_multibuild_customize.sh - echo $ENABLE_CONTRIB > contrib.enabled - echo $ENABLE_HEADLESS > headless.enabled - echo "end" - # Not interested in travis internal scripts' output - fi - set +x - # Build and package - set -x - ls - if [[ $SDIST == 1 ]]; then - python -m pip install --upgrade pip - python -m pip install scikit-build - python setup.py sdist - else - build_wheel $REPO_DIR $PLAT - fi - set +x - # Install and run tests - set -x - if [[ $SDIST == 1 ]]; then - echo "skipping tests because of sdist" - rc=0 - else - install_run $PLAT && rc=$? || rc=$? - fi - set +x - #otherwise, Travis logic terminates prematurely - #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 - trap ERR - test "$rc" -eq 0 - name: saving artifacts uses: actions/upload-artifact@v2 with: name: wheels - path: wheelhouse/opencv*.whl + path: dist/opencv*.tar.gz test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist, build_arm] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -367,7 +198,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build-windows-x86_64, build_sdist, build_arm] + needs: [build, build_sdist] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml new file mode 100644 index 00000000..90f8e83a --- /dev/null +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -0,0 +1,167 @@ +name: Build PYPI wheels for opencv-python on Linux ARM + +on: + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build_arm: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ARM64] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + DOCKER_TEST_IMAGE: multibuild/xenial_arm64v8 + USE_CCACHE: 0 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Cleanup + if: always() + uses: AutoModality/action-clean@v1 + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Setup Environment variables + run: | + if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + if [[ $SDIST == 0 ]]; then + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + echo "end" + # Not interested in travis internal scripts' output + fi + set +x + # Build and package + set -x + ls + if [[ $SDIST == 1 ]]; then + python -m pip install --upgrade pip + python -m pip install scikit-build + python setup.py sdist + else + build_wheel $REPO_DIR $PLAT + fi + set +x + # Install and run tests + set -x + if [[ $SDIST == 1 ]]; then + echo "skipping tests because of sdist" + rc=0 + else + install_run $PLAT && rc=$? || rc=$? + fi + set +x + #otherwise, Travis logic terminates prematurely + #https://travis-ci.community/t/shell-session-update-command-not-found-in-build-log-causes-build-to-fail-if-trap-err-is-set/817 + trap ERR + test "$rc" -eq 0 + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build_arm] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml new file mode 100644 index 00000000..2eca3e84 --- /dev/null +++ b/.github/workflows/build_wheels_macos.yml @@ -0,0 +1,151 @@ +name: Build PYPI wheels for opencv-python on Macos + +on: + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [macos-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + REPO_DIR: . + BUILD_COMMIT: master + PROJECT_SPEC: opencv-python + MB_PYTHON_VERSION: ${{ matrix.python-version }} + TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} + MB_ML_VER: 2014 + NP_TEST_DEP: numpy + TRAVIS_BUILD_DIR: ${{ github.workspace }} + CONFIG_PATH: travis_config.sh + DOCKER_IMAGE: quay.io/skvark/manylinux2014_${PLAT} + USE_CCACHE: 1 + UNICODE_WIDTH: 32 + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + if: ${{ 'macos-latest' == matrix.os }} + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: | + if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi + if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi + if [ "x64" == "${{ matrix.platform }}" ]; then echo "PLAT=x86_64" >> $GITHUB_ENV; fi + if [ "x86" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; fi + echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; + echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; + + - name: before install + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x + build_wheel $REPO_DIR $PLAT + install_run $PLAT + set +x + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml new file mode 100644 index 00000000..51cc7767 --- /dev/null +++ b/.github/workflows/build_wheels_windows.yml @@ -0,0 +1,132 @@ +name: Build PYPI wheels for opencv-python on Windows + +on: + pull_request: + branches: + - 3.4 + release: + types: [published, edited] + + +jobs: + build-windows-x86_64: + runs-on: ${{ matrix.os }} + defaults: + run: + shell: powershell + + strategy: + fail-fast: false + matrix: + os: [windows-latest] + python-version: [3.6, 3.7, 3.8, 3.9] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + SDIST: ${{ matrix.build_sdist || 0}} + ENABLE_HEADLESS: ${{ matrix.without_gui }} + ENABLE_CONTRIB: ${{ matrix.with_contrib }} + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule update --remote + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup MSBuild.exe + uses: warrenbuckley/Setup-MSBuild@v1 + + - name: build script + run: | + python --version + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + set "CI_BUILD=1" && python -m pip wheel --wheel-dir=%cd%\wheelhouse . --verbose + shell: cmd + + - name: before test + run: | + cd ${{ github.workspace }}/tests + &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") + if ($LastExitCode -ne 0) {throw $LastExitCode} + shell: powershell + + - name: run test + run: | + cd ${{ github.workspace }}/tests + python -m unittest test + shell: cmd + + - name: saving artifacts + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + test_release_opencv_python: + if: github.event_name == 'release' && github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: test-opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload all wheels + run: | + python -m pip install twine + python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* + + release_opencv_python: + if: github.event_name == 'release' && !github.event.release.prerelease + needs: [build-windows-x86_64] + runs-on: ubuntu-latest + environment: opencv-python-release + defaults: + run: + shell: bash + steps: + - uses: actions/download-artifact@v2 + with: + name: wheels + path: wheelhouse/ + + - name: Upload wheels for opencv_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* + + - name: Upload wheels for opencv_contrib_python + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* + + - name: Upload wheels for opencv_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* + + - name: Upload wheels for opencv_contrib_python_headless + run: | + python -m pip install twine + python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* From ffc3f754a50237f7b75fe8311a4d72d15cb8ca94 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 21 May 2021 13:27:18 +0300 Subject: [PATCH 09/13] Defined 3.4 branch in .gitmodules and updated opencv_extra submodule --- .gitmodules | 3 +++ opencv_extra | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 655467e8..8ebdff3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,12 +1,15 @@ [submodule "opencv"] path = opencv url = https://github.com/opencv/opencv.git + branch = 3.4 [submodule "opencv_contrib"] path = opencv_contrib url = https://github.com/opencv/opencv_contrib.git + branch = 3.4 [submodule "multibuild"] path = multibuild url = https://github.com/matthew-brett/multibuild.git [submodule "opencv_extra"] path = opencv_extra url = https://github.com/opencv/opencv_extra.git + branch = 3.4 diff --git a/opencv_extra b/opencv_extra index 3b033d09..b6430dee 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 3b033d09cab1894d6452707df723789fe98c8663 +Subproject commit b6430deee16b91dce946a6e66feb8dc110c39834 From d58df653183f7145f74b42603ac3482479beb898 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 24 May 2021 12:15:29 +0300 Subject: [PATCH 10/13] Fixed submodules --- .github/workflows/build_wheels_linux.yml | 20 +++++++++++++++----- .github/workflows/build_wheels_linux_arm.yml | 12 +++++++++++- .github/workflows/build_wheels_macos.yml | 12 +++++++++--- .github/workflows/build_wheels_windows.yml | 12 +++++++++--- 4 files changed, 44 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 87df6861..59bb9356 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,6 +1,9 @@ -name: Build PYPI wheels for opencv-python on Linux x86_64 +name: Build PYPI wheels fgithub.event_name == 'release'or opencv-python on Linux x86_64 on: + push: + branches: + - asen/check_3.4_wo_submodules pull_request: branches: - 3.4 @@ -47,12 +50,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 @@ -137,10 +143,14 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules + if: github.event_name == 'pull_request' run: | git submodule update --remote diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 90f8e83a..01158eec 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -1,6 +1,9 @@ name: Build PYPI wheels for opencv-python on Linux ARM on: + push: + branches: + - asen/check_3.4_wo_submodules pull_request: branches: - 3.4 @@ -53,9 +56,16 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + + - name: Update submodules + if: github.event_name == 'pull_request' + run: git submodule update --remote + - name: Setup Environment variables run: | if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 2eca3e84..9af6d384 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -1,6 +1,9 @@ name: Build PYPI wheels for opencv-python on Macos on: + push: + branches: + - asen/check_3.4_wo_submodules pull_request: branches: - 3.4 @@ -47,12 +50,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 51cc7767..64f02cca 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -1,6 +1,9 @@ name: Build PYPI wheels for opencv-python on Windows on: + push: + branches: + - asen/check_3.4_wo_submodules pull_request: branches: - 3.4 @@ -35,12 +38,15 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: true + submodules: false fetch-depth: 0 + - name: Update multibuild submodule + run: git submodule update --init --recursive multibuild + - name: Update submodules - run: | - git submodule update --remote + if: github.event_name == 'pull_request' + run: git submodule update --remote - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 From 63c5ea603b880771b3c28b3f32fa8da4501046e2 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 24 May 2021 12:17:11 +0300 Subject: [PATCH 11/13] Fix typo in naming --- .github/workflows/build_wheels_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 59bb9356..d6bc8df6 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -1,4 +1,4 @@ -name: Build PYPI wheels fgithub.event_name == 'release'or opencv-python on Linux x86_64 +name: Build PYPI wheels for opencv-python on Linux x86_64 on: push: From 8f5a34fe4d6fece164f9375cc3437cb0fbc0077c Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Mon, 24 May 2021 18:07:14 +0300 Subject: [PATCH 12/13] Split package building and testing steps to checkout all submodules needed for testing between these two steps. --- .github/workflows/build_wheels_linux.yml | 25 +++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index d6bc8df6..d3b51057 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -77,7 +77,7 @@ jobs: echo "BUILD_DEPENDS=$(echo $NP_BUILD_DEP)" >> $GITHUB_ENV; echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; - - name: before install + - name: build run: | set -e # Check out and prepare the source @@ -94,6 +94,29 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT + + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: install and test + run: | + set -e + # Check out and prepare the source + # Multibuild doesn't have releases, so --depth would break eventually (see + # https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised) + git submodule update --init multibuild + source multibuild/common_utils.sh + # https://github.com/matthew-brett/multibuild/issues/116 + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi + source multibuild/travis_steps.sh + # This sets -x + # source travis_multibuild_customize.sh + echo $ENABLE_CONTRIB > contrib.enabled + echo $ENABLE_HEADLESS > headless.enabled + set -x install_run $PLAT set +x From 750a553ba28c4914d76936efa8c13b5078792447 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Mon, 24 May 2021 18:10:15 +0300 Subject: [PATCH 13/13] WIP: update target branch --- .github/workflows/build_wheels_linux.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index d3b51057..bbb7f7fe 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -3,7 +3,7 @@ name: Build PYPI wheels for opencv-python on Linux x86_64 on: push: branches: - - asen/check_3.4_wo_submodules + - gs/fix-submodules-checkout pull_request: branches: - 3.4