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/51] 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/51] 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/51] 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/51] 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/51] 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/51] 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 9486a687ec72cd8f1db7633722320305befcb1df Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Jun 2021 02:22:45 +0300 Subject: [PATCH 07/51] Added opencv_extra and defined 3.4 branch for submodules --- .gitmodules | 6 ++++++ opencv_extra | 1 + 2 files changed, 7 insertions(+) create mode 160000 opencv_extra diff --git a/.gitmodules b/.gitmodules index f2e0d283..8ebdff3d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +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 new file mode 160000 index 00000000..b6430dee --- /dev/null +++ b/opencv_extra @@ -0,0 +1 @@ +Subproject commit b6430deee16b91dce946a6e66feb8dc110c39834 From f6f8cf08a65b9c9fab6259e2d90b62e68606c268 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 7 Jul 2021 14:45:53 +0300 Subject: [PATCH 08/51] Updated submodules to 3.4.15 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index d0e3e638..59170890 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit d0e3e638c35d875c86fac3410d93f02f885e27ba +Subproject commit 591708903b4393b5d33c3a2f4af5be4daeb94c4d diff --git a/opencv_contrib b/opencv_contrib index 4de4edeb..e9e50703 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 4de4edeba691d8ed0420f3581fb80133589f4cdf +Subproject commit e9e507039d41fed009b72f9e163a22d9ae9f0712 diff --git a/opencv_extra b/opencv_extra index b6430dee..e79fc182 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit b6430deee16b91dce946a6e66feb8dc110c39834 +Subproject commit e79fc1824042cc57ff95547a50d5084881cb6056 From 96fbc6043a17d52a5cb0d46eea7f1359f7cf6c5a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 20 Oct 2021 12:16:01 +0300 Subject: [PATCH 09/51] Updated submodules to 3.4.16 Release --- multibuild | 2 +- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/multibuild b/multibuild index 8882150d..b89bb903 160000 --- a/multibuild +++ b/multibuild @@ -1 +1 @@ -Subproject commit 8882150df6529658700b66bec124dfb77eefca26 +Subproject commit b89bb903e94308be79abefa4f436bf123ebb1313 diff --git a/opencv b/opencv index 59170890..62252d15 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 591708903b4393b5d33c3a2f4af5be4daeb94c4d +Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 diff --git a/opencv_contrib b/opencv_contrib index e9e50703..02c2b56c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit e9e507039d41fed009b72f9e163a22d9ae9f0712 +Subproject commit 02c2b56c44503e983c3eacd5b79744a24f433c36 diff --git a/opencv_extra b/opencv_extra index e79fc182..38d49ada 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit e79fc1824042cc57ff95547a50d5084881cb6056 +Subproject commit 38d49adaabb08618ff9fb224004362de80fdcbcc From 5094e4ea07e454cda623274bedcc85784558558a Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:10:21 +0200 Subject: [PATCH 10/51] 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 c19b05aefc717c2d90f0b96f423d06b7492a9ed2 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:13:15 +0200 Subject: [PATCH 11/51] update 3.4.x specific parts --- README.md | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d2831332..32eb8ecc 100644 --- a/README.md +++ b/README.md @@ -176,7 +176,7 @@ 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/opencv/opencv-python/blob/master/LICENSE-3RD-PARTY.txt). diff --git a/setup.py b/setup.py index 1b1f59c7..57544289 100644 --- a/setup.py +++ b/setup.py @@ -99,7 +99,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 [] ) @@ -120,7 +120,7 @@ def main(): r"python/cv2/.*config.*.py" ], "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" ], "cv2.gapi": [ "python/cv2" + r"/gapi/.*\.py" From 27c1aa45cf7780224401a9906e24409a4ced2eb5 Mon Sep 17 00:00:00 2001 From: Olli-Pekka Heinisuo Date: Sun, 3 Jan 2021 17:15:57 +0200 Subject: [PATCH 12/51] OpenCV 3.4.16 release preparations --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 39c33341..62252d15 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 39c3334147ec02761b117f180c9c4518be18d1fa +Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 diff --git a/opencv_contrib b/opencv_contrib index 2bc3e1a1..02c2b56c 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 2bc3e1a169afd2675ef68221176f32cc0ea5427a +Subproject commit 02c2b56c44503e983c3eacd5b79744a24f433c36 diff --git a/opencv_extra b/opencv_extra index 822ee112..38d49ada 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 822ee11240b969e98e20546663bc481a5e7089cc +Subproject commit 38d49adaabb08618ff9fb224004362de80fdcbcc From f947d44e736b576042c44093acdc3a7fee505986 Mon Sep 17 00:00:00 2001 From: Grigory Serebryakov Date: Wed, 5 May 2021 21:47:10 +0300 Subject: [PATCH 13/51] 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 2e562e905af9cb1aabecc07d626a71772f9b7df0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Jun 2021 02:22:45 +0300 Subject: [PATCH 14/51] Added opencv_extra and defined 3.4 branch for submodules --- .gitmodules | 3 +++ 1 file changed, 3 insertions(+) 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 From cb2c67ce126c23a6590a28c65ec5f665fa78f4c4 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 21 Oct 2021 00:11:32 +0300 Subject: [PATCH 15/51] Removed unused modules for 3.4 branch --- setup.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/setup.py b/setup.py index 57544289..b0490ca2 100644 --- a/setup.py +++ b/setup.py @@ -122,18 +122,6 @@ def main(): "cv2.data": [ # OPENCV_OTHER_INSTALL_PATH ("etc" if os.name == "nt" else "share/OpenCV") + r"/haarcascades/.*\.xml" ], - "cv2.gapi": [ - "python/cv2" + r"/gapi/.*\.py" - ], - "cv2.mat_wrapper": [ - "python/cv2" + r"/mat_wrapper/.*\.py" - ], - "cv2.misc": [ - "python/cv2" + r"/misc/.*\.py" - ], - "cv2.utils": [ - "python/cv2" + r"/utils/.*\.py" - ], } # Files in sourcetree outside package dir that should be copied to package. From 71bad8c44157907595dfe50ec36904d00a30466a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 17:56:25 +0300 Subject: [PATCH 16/51] Fixed a build from the source --- MANIFEST.in | 1 + setup.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 45cb6c40..b429eae0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -9,3 +9,4 @@ recursive-include docker * recursive-include opencv * recursive-include opencv_contrib * recursive-include patches * +recursive-include scripts *.py diff --git a/setup.py b/setup.py index b0490ca2..f2cd93e9 100644 --- a/setup.py +++ b/setup.py @@ -366,7 +366,8 @@ def _classify_installed_files_override( print("Copying files from CMake output") # add lines from the old __init__.py file to the config file - with open('scripts/__init__.py', 'r') as custom_init: + with open('%s/scripts/__init__.py' + % os.path.split(os.path.abspath(__file__))[0], 'r') as custom_init: custom_init_data = custom_init.read() with open('%spython/cv2/config-%s.%s.py' % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: From 4d0bc7d528058b2e0fbcd44538ba6e4c8a69b49f Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 1 Nov 2021 18:07:48 +0300 Subject: [PATCH 17/51] Added 3.10 python version in the description --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 32eb8ecc..da4e3605 100644 --- a/README.md +++ b/README.md @@ -220,6 +220,7 @@ Python 3.x compatible pre-built wheels are provided for the officially supported - 3.7 - 3.8 - 3.9 +- 3.10 ### Backward compatibility From b408641e253f2853f2d6310c2b3c5ad522b595a8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 02:36:06 +0300 Subject: [PATCH 18/51] Moving to auditwheel==5.0.0 (default in the latest manylinux image) --- patch_auditwheel_whitelist.py | 7 +++---- travis_config.sh | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/patch_auditwheel_whitelist.py b/patch_auditwheel_whitelist.py index d0cbf5b2..b32da17a 100644 --- a/patch_auditwheel_whitelist.py +++ b/patch_auditwheel_whitelist.py @@ -5,12 +5,11 @@ policies = None -with open(join(dirname(abspath(policy.__file__)), "policy.json")) as f: +with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json")) as f: policies = json.load(f) for p in policies: - if p["name"] == "manylinux2014": - p["lib_whitelist"].append("libxcb.so.1") + p["lib_whitelist"].append("libxcb.so.1") -with open(join(dirname(abspath(policy.__file__)), "policy.json"), "w") as f: +with open(join(dirname(abspath(policy.__file__)), "manylinux-policy.json"), "w") as f: f.write(json.dumps(policies)) diff --git a/travis_config.sh b/travis_config.sh index 937e5a2d..2eb81faa 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -17,11 +17,11 @@ function bdist_wheel_cmd { CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then - TOOLS_PATH=/opt/_internal/tools - /opt/python/cp37-cp37m/bin/python -m venv $TOOLS_PATH + # this path can be changed in the latest manylinux image + TOOLS_PATH=/opt/_internal/pipx/venvs/auditwheel + /opt/python/cp39-cp39/bin/python -m venv $TOOLS_PATH source $TOOLS_PATH/bin/activate - python$PYTHON_VERSION -m pip install auditwheel==3.2.0 - python$PYTHON_VERSION patch_auditwheel_whitelist.py + python patch_auditwheel_whitelist.py # to avoid issues with numpy wheels rm /io/wheelhouse/numpy* deactivate From 31dde8a15b162bd7ce0bab48c071629f461acc0e Mon Sep 17 00:00:00 2001 From: "Kian-Meng, Ang" Date: Mon, 8 Nov 2021 09:57:24 +0800 Subject: [PATCH 19/51] Fix typos --- LICENSE-3RD-PARTY.txt | 6 +++--- README.md | 2 +- travis_config.sh | 2 +- travis_osx_brew_cache.sh | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LICENSE-3RD-PARTY.txt b/LICENSE-3RD-PARTY.txt index 87c0514e..1db522f7 100644 --- a/LICENSE-3RD-PARTY.txt +++ b/LICENSE-3RD-PARTY.txt @@ -840,7 +840,7 @@ This license applies to above binaries in the directory cv2/. * The implementation was written so as to conform with Netscapes SSL. * * This library is free for commercial and non-commercial use as long as - * the following conditions are aheared to. The following conditions + * the following conditions are adhered to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms @@ -865,7 +865,7 @@ This license applies to above binaries in the directory cv2/. * must display the following acknowledgement: * "This product includes cryptographic software written by * Eric Young (eay@cryptsoft.com)" - * The word 'cryptographic' can be left out if the rouines from the library + * The word 'cryptographic' can be left out if the routines from the library * being used are not cryptographic related :-). * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: @@ -883,7 +883,7 @@ This license applies to above binaries in the directory cv2/. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * The licence and distribution terms for any publically available version or + * The licence and distribution terms for any publicly available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] diff --git a/README.md b/README.md index da4e3605..522cc005 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ A: It's easier for users to understand ``opencv-python`` than ``cv2`` and it mak ## Documentation for opencv-python -[![Windows Buld Status](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml) +[![Windows Build Status](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_windows.yml) [![(Linux Build status)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_linux.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_linux.yml) [![(Mac OS Build status)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_macos.yml/badge.svg)](https://github.com/opencv/opencv-python/actions/workflows/build_wheels_macos.yml) diff --git a/travis_config.sh b/travis_config.sh index 2eb81faa..6d6cc06b 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -12,7 +12,7 @@ function build_wheel { function bdist_wheel_cmd { # copied from multibuild's common_utils.sh - # add osx deployment target so it doesnt default to 10.6 + # add osx deployment target so it doesn't default to 10.6 local abs_wheelhouse=$1 CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS cp dist/*.whl $abs_wheelhouse diff --git a/travis_osx_brew_cache.sh b/travis_osx_brew_cache.sh index 401265f2..1a2a1c6c 100644 --- a/travis_osx_brew_cache.sh +++ b/travis_osx_brew_cache.sh @@ -249,7 +249,7 @@ function _brew_install_and_cache_within_time_limit { for dep in $DEPS; do #TIME_LIMIT only has to be met if we'll be actually building the main project this iteration, i.e. after the "root" module installation #While we don't know that yet, we can make better use of Travis-given time with a laxer limit - #We still can't overrun TIME_HARD_LIMIT as that would't leave time to save the cache + #We still can't overrun TIME_HARD_LIMIT as that wouldn't leave time to save the cache _brew_install_and_cache_within_time_limit "$dep" $(((TIME_LIMIT+TIME_HARD_LIMIT)/2)) "$TIME_HARD_LIMIT" "$TIME_START" || return $? done From 85992312c5383bc94d0b6d43db0ac3ba378c53b1 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 8 Nov 2021 15:38:20 +0300 Subject: [PATCH 20/51] Changed defining path to scripts/__init__.py file --- setup.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f2cd93e9..63179184 100644 --- a/setup.py +++ b/setup.py @@ -366,8 +366,7 @@ def _classify_installed_files_override( print("Copying files from CMake output") # add lines from the old __init__.py file to the config file - with open('%s/scripts/__init__.py' - % os.path.split(os.path.abspath(__file__))[0], 'r') as custom_init: + with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init: custom_init_data = custom_init.read() with open('%spython/cv2/config-%s.%s.py' % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: From c50150e3a34cab34f51e412830cd2d8f0270aecb Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 14:14:30 +0300 Subject: [PATCH 21/51] Defined 3.4.16 tag for opencv submodule --- opencv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opencv b/opencv index 62252d15..b1cf5501 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 62252d157ea53d9c51df9d7043bba49e053aa3c0 +Subproject commit b1cf5501233405de3ea5926d1d688e421b337458 From 19ed0019b1272fcf6edbc9abcb88b9d06fbab200 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 15:24:13 +0300 Subject: [PATCH 22/51] Added lines for a proper work using pylint and an autocomplete in IDE --- setup.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/setup.py b/setup.py index 63179184..87f6c214 100644 --- a/setup.py +++ b/setup.py @@ -365,6 +365,18 @@ def _classify_installed_files_override( print("Copying files from CMake output") + # lines for a proper work using pylint and an autocomplete in IDE + with open("%spython/cv2/__init__.py" + % cmake_install_dir, 'r') as opencv_init: + opencv_init_lines = opencv_init.readlines() + extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n') + free_line_after_imports = 5 + opencv_init_lines.insert(free_line_after_imports, extra_imports) + + with open("%spython/cv2/__init__.py" + % cmake_install_dir, 'w') as opencv_final_init: + opencv_final_init.writelines(opencv_init_lines) + # add lines from the old __init__.py file to the config file with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init: custom_init_data = custom_init.read() From 87e4f4d21cb267b222cbe69c082042d2a037836c Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 11 Nov 2021 18:41:19 +0300 Subject: [PATCH 23/51] Changed a string substitution to os.path.join --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 87f6c214..9dcc030e 100644 --- a/setup.py +++ b/setup.py @@ -366,15 +366,13 @@ def _classify_installed_files_override( print("Copying files from CMake output") # lines for a proper work using pylint and an autocomplete in IDE - with open("%spython/cv2/__init__.py" - % cmake_install_dir, 'r') as opencv_init: + with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init: opencv_init_lines = opencv_init.readlines() extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n') free_line_after_imports = 5 opencv_init_lines.insert(free_line_after_imports, extra_imports) - with open("%spython/cv2/__init__.py" - % cmake_install_dir, 'w') as opencv_final_init: + with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'w') as opencv_final_init: opencv_final_init.writelines(opencv_init_lines) # add lines from the old __init__.py file to the config file From bfa7e0243d0d7491d78da48acb0567b5a05f35c3 Mon Sep 17 00:00:00 2001 From: John Reese Date: Wed, 3 Nov 2021 14:47:59 -0700 Subject: [PATCH 24/51] Use PEP-508 compliant dependency specifiers This allows correctly resolving the numpy version requirement via PyPI metadata, using the same metadata regardless of what version of Python the package was built with or which wheel is uploaded to PyPI first. --- setup.py | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/setup.py b/setup.py index 9dcc030e..ac509fe0 100644 --- a/setup.py +++ b/setup.py @@ -22,26 +22,15 @@ def main(): build_headless = get_build_env_var_by_name("headless") build_java = "ON" if get_build_env_var_by_name("java") else "OFF" - if sys.version_info[:2] >= (3, 6): - minimum_supported_numpy = "1.13.3" - if sys.version_info[:2] >= (3, 7): - minimum_supported_numpy = "1.14.5" - if sys.version_info[:2] >= (3, 8): - minimum_supported_numpy = "1.17.3" - if sys.version_info[:2] >= (3, 9): - minimum_supported_numpy = "1.19.3" - if sys.version_info[:2] >= (3, 10): - minimum_supported_numpy = "1.21.2" - - # linux arm64 is a special case - if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64": - minimum_supported_numpy = "1.19.3" - - # macos arm64 is a special case - if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64": - minimum_supported_numpy = "1.21.0" - - numpy_version = "numpy>=%s" % minimum_supported_numpy + install_requires = [ + 'numpy>=1.13.3; python_version<"3.7"', + 'numpy>=1.14.5; python_version>="3.7"', + 'numpy>=1.17.3; python_version>="3.8"', + 'numpy>=1.19.3; python_version>="3.9"', + 'numpy>=1.21.2; python_version>="3.10"', + 'numpy>=1.19.3; python_version>="3.6" and platform_system=="Linux" and platform_machine=="aarch64"', + 'numpy>=1.21.2; python_version>="3.6" and platform_system=="Darwin" and platform_machine=="arm64"', + ] python_version = cmaker.CMaker.get_python_version() python_lib_path = cmaker.CMaker.get_python_library(python_version).replace( @@ -245,7 +234,7 @@ def main(): package_data=package_data, maintainer="Olli-Pekka Heinisuo", ext_modules=EmptyListWithLength(), - install_requires=numpy_version, + install_requires=install_requires, python_requires=">=3.6", classifiers=[ "Development Status :: 5 - Production/Stable", From 369d2d4c5f4b2db91e1d83b9fc6394edc9b1a9e2 Mon Sep 17 00:00:00 2001 From: Christian Clauss Date: Fri, 26 Nov 2021 11:45:37 +0100 Subject: [PATCH 25/51] Delete appveyor.yml The last run was a year ago. https://ci.appveyor.com/project/skvark/opencv-python/history --- appveyor.yml | 201 --------------------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 appveyor.yml diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index c79e7de4..00000000 --- a/appveyor.yml +++ /dev/null @@ -1,201 +0,0 @@ -environment: - USER: - secure: fXgF9uyy6sT0JoVOR7BoqA== - - PASS: - secure: 0bXSOVjf9x8L7nErTivu92TF1FwNosTjFJQPmxp8Dys= - - matrix: - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 0 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 0 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python36-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python37-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python38-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - - - PYTHON: "C:\\Python39-x64" - ENABLE_CONTRIB: 1 - ENABLE_HEADLESS: 1 - -matrix: - fast_finish: true - -install: - - ps: | - if (-not (Test-Path $env:PYTHON)) { - curl -o install_python.ps1 https://raw.githubusercontent.com/matthew-brett/multibuild/devel/install_python.ps1 - .\install_python.ps1 - } - - ps: if (-not (Test-Path $env:PYTHON)) { throw "No $env:PYTHON" } - - "set PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%" - - python --version - -build_script: -- cmd: | - "%PYTHON%\\python.exe" -m pip install --upgrade pip - "%PYTHON%\\python.exe" -m pip install --upgrade setuptools - set "CI_BUILD=1" && "%PYTHON%\\python.exe" -m pip wheel --wheel-dir=%cd%\dist . --verbose - -before_test: -- ps: | - - cd ${Env:APPVEYOR_BUILD_FOLDER}\tests - $env:PYTHONWARNINGS = "ignore:::pip._internal.cli.base_command" - &"${Env:PYTHON}\\python.exe" -m pip install --user --no-warn-script-location (ls "../dist/opencv_*.whl") - if ($LastExitCode -ne 0) {throw $LastExitCode} - -test_script: -- cmd: | - - cd %APPVEYOR_BUILD_FOLDER%\tests - "%PYTHON%\\python.exe" -m unittest test - -artifacts: -- path: dist\opencv*.whl - name: wheels - -deploy_script: -- ps: | - - if (${Env:APPVEYOR_REPO_TAG} -eq "true") { - cd ${Env:APPVEYOR_BUILD_FOLDER} - if (${Env:ENABLE_CONTRIB} -eq 0) { - if (${Env:ENABLE_HEADLESS} -eq 0) { - echo "This is a default build. Deployment will be done to PyPI entry opencv-python." - } - else { - echo "This is a headless build. Deployment will be done to PyPI entry opencv-python-headless." - } - } - else { - if (${Env:ENABLE_HEADLESS} -eq 0) { - echo "This is a contrib build. Deployment will be done to PyPI entry opencv-contrib-python." - } - else { - echo "This is a headless contrib build. Deployment will be done to PyPI entry opencv-contrib-python-headless." - } - } - - &"${Env:PYTHON}\\python.exe" -m pip install twine - &"${Env:PYTHON}\\python.exe" -m twine upload -u ${Env:USER} -p ${Env:PASS} --skip-existing dist/opencv* - } - else { - echo "Tag not set, deployment skipped." - } From 10686b6c99cd3fbbcc530eee595fc5cd99441df0 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 15 Dec 2021 15:58:12 +0300 Subject: [PATCH 26/51] Added python limited API support --- .github/workflows/build_wheels_linux.yml | 123 ++++++++++--- .github/workflows/build_wheels_linux_arm.yml | 121 +++++++++++-- .github/workflows/build_wheels_macos.yml | 144 +++++++++++++-- .github/workflows/build_wheels_macos_m1.yml | 109 ++++++++++-- .github/workflows/build_wheels_windows.yml | 174 +++++++++++++++++-- setup.py | 7 +- travis_config.sh | 6 +- 7 files changed, 592 insertions(+), 92 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 7ff34a18..338673dc 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -37,13 +37,12 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 + PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -59,25 +58,108 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Setup Environment variables - run: | - 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 [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: build + - name: Build a package run: source scripts/build.sh - - name: install and test - run: source scripts/install.sh - - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.2 + CONFIG_PATH: travis_config.sh + PLAT: x86_64 + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: false + fetch-depth: 0 + + - name: Setup Environment variables + run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation and run tests + run: source scripts/install.sh build_sdist: runs-on: ${{ matrix.os }} @@ -131,12 +213,7 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Setup Environment variables - run: | - 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 - - - name: before install + - name: Build a package run: | set -e # Build and package @@ -157,7 +234,7 @@ jobs: test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build, build_sdist] + needs: [build, build_sdist, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -176,7 +253,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build, build_sdist] + needs: [build, build_sdist, test] 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 index 89142a57..08badc5b 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [ARM64] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -38,12 +38,9 @@ jobs: TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} PLAT: aarch64 MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} - DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} @@ -61,26 +58,118 @@ jobs: submodules: false fetch-depth: 0 - - name: Setup Environment variables - run: | - if [ "ARM64" == "${{ matrix.os }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; fi - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: build + - name: Build a package run: source scripts/build.sh - - name: install and test - run: source scripts/install.sh - - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [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', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + PLAT: aarch64 + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.4 + CONFIG_PATH: travis_config.sh + DOCKER_TEST_IMAGE: multibuild/focal_arm64v8 + UNICODE_WIDTH: 32 + + 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 [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation and run tests + run: source scripts/install.sh + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build_arm] + needs: [build_arm, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -99,7 +188,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build_arm] + needs: [build_arm, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index d4f10be0..0ff69ede 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -23,7 +23,7 @@ jobs: fail-fast: false matrix: os: [macos-10.15, macos-11] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -48,14 +48,13 @@ jobs: MB_PYTHON_VERSION: ${{ matrix.python-version }} TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==1.21.2 TRAVIS_BUILD_DIR: ${{ github.workspace }} TRAVIS_OS_NAME: osx CONFIG_PATH: travis_config.sh DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 + PLAT: x86_64 SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} @@ -71,15 +70,7 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: Setup Environment variables - run: | - 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 - if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - - name: before install + - name: Build a package run: | set -e # Check out and prepare the source @@ -96,19 +87,136 @@ jobs: echo $ENABLE_HEADLESS > headless.enabled set -x build_wheel $REPO_DIR $PLAT - git submodule update --init --recursive - install_run $PLAT - set +x - - name: saving artifacts + - name: Saving all wheels uses: actions/upload-artifact@v2 with: name: wheels path: wheelhouse/opencv*.whl + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + + strategy: + fail-fast: false + matrix: + os: [macos-10.15, macos-11] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + exclude: + - os: macos-10.15 + python-version: '3.10' + - os: macos-11 + python-version: '3.6' + - os: macos-11 + python-version: '3.7' + - os: macos-11 + python-version: '3.8' + - os: macos-11 + python-version: '3.9' + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + MB_PYTHON_VERSION: ${{ matrix.python-version }} + NP_TEST_DEP: numpy==1.19.4 + NP_TEST_DEP_LATEST: numpy==1.21.4 + CONFIG_PATH: travis_config.sh + PLAT: x86_64 + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Setup Environment variables + run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation + run: | + python -m pip install wheelhouse/opencv*.whl + cd ${{ github.workspace }}/tests + python get_build_info.py + + - name: Run tests + run: | + cd ${{ github.workspace }}/opencv + python modules/python/test/test.py -v --repo . + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -127,7 +235,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 79164dcf..cd183389 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -20,7 +20,7 @@ jobs: fail-fast: false matrix: os: [macOS-M1] - python-version: ['3.7', '3.8', '3.9', '3.10'] + python-version: ['3.7'] platform: [x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -31,7 +31,6 @@ jobs: SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} - OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata steps: - name: Checkout @@ -44,36 +43,116 @@ jobs: if: github.event_name == 'pull_request' run: git submodule update --remote - - name: build script + - name: Build a package run: | 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 wheel --wheel-dir=wheelhouse . --verbose + 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 delocate-wheel ${{ github.workspace }}/wheelhouse/opencv* - - name: before test + - name: Saving all wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + - name: Saving opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [build] + runs-on: ${{ matrix.os }} + + strategy: + fail-fast: false + matrix: + os: [macOS-M1] + python-version: ['3.7', '3.8', '3.9', '3.10'] + platform: [x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Download opencv-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels + path: wheelhouse/ + + - name: Download opencv-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels + path: wheelhouse/ + + - name: Package installation run: | - git submodule update --init --recursive arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl cd ${{ github.workspace }}/tests arch -arm64 python${{ matrix.python-version }} get_build_info.py - - name: run test + - name: Run tests run: | cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . - - 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] + needs: [build, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -92,7 +171,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build] + needs: [build, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 3eb13086..ade90ead 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -22,7 +22,7 @@ jobs: fail-fast: false matrix: os: [windows-latest] - python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] + python-version: ['3.6'] platform: [x86, x64] with_contrib: [0, 1] without_gui: [0, 1] @@ -55,38 +55,184 @@ jobs: - name: Setup MSBuild.exe uses: warrenbuckley/Setup-MSBuild@v1 - - name: build script + - name: Build a package 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 + python -m pip install toml && python -c "import toml; c = toml.load('pyproject.toml'); print('\n'.join(c['build-system']['requires']))" >> requirements.txt | python -m pip install -r requirements.txt + set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp36 --dist-dir=%cd%\wheelhouse -v shell: cmd - - name: before test + - name: Saving all wheels + uses: actions/upload-artifact@v2 + with: + name: wheels + path: wheelhouse/opencv*.whl + + - name: Saving opencv-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels-x86 + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-wheels-x64 + path: wheelhouse/opencv_python-*.whl + + - name: Saving opencv-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels-x86 + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-python-headless-wheels-x64 + path: wheelhouse/opencv_python_headless-*.whl + + - name: Saving opencv-contrib-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels-x86 + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-wheels-x64 + path: wheelhouse/opencv_contrib_python-*.whl + + - name: Saving opencv-contrib-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x86 + path: wheelhouse/opencv_contrib_python_headless-*.whl + + - name: Saving opencv-contrib-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/upload-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x64 + path: wheelhouse/opencv_contrib_python_headless-*.whl + + test: + needs: [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', '3.10'] + platform: [x86, x64] + with_contrib: [0, 1] + without_gui: [0, 1] + build_sdist: [0] + + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: true + OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata + + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + fetch-depth: 0 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + architecture: ${{ matrix.platform }} + + - name: Download opencv-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-python-headless-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-contrib-python x86 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-contrib-python x64 wheels + if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-wheels-x64 + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless x86 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x86 + path: wheelhouse/ + + - name: Download opencv-contrib-python-headless x64 wheels + if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + uses: actions/download-artifact@v2 + with: + name: opencv-contrib-python-headless-wheels-x64 + path: wheelhouse/ + + - name: Package installation run: | - git submodule update --init --recursive cd ${{ github.workspace }}/tests &python -m pip install --user --no-warn-script-location (ls "../wheelhouse/opencv*.whl") if ($LastExitCode -ne 0) {throw $LastExitCode} python get_build_info.py shell: powershell - - name: run test + - name: Run tests run: | cd ${{ github.workspace }}/opencv python modules\python\test\test.py -v --repo . 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] + needs: [build-windows-x86_64, test] runs-on: ubuntu-latest environment: test-opencv-python-release defaults: @@ -105,7 +251,7 @@ jobs: release_opencv_python: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [build-windows-x86_64] + needs: [build-windows-x86_64, test] runs-on: ubuntu-latest environment: opencv-python-release defaults: diff --git a/setup.py b/setup.py index ac509fe0..2e268bff 100644 --- a/setup.py +++ b/setup.py @@ -97,8 +97,8 @@ def main(): # Naming conventions vary so widely between versions and OSes # had to give up on checking them. [ - "python/cv2/python-%s.%s/cv2[^/]*%s" - % (sys.version_info[0], sys.version_info[1], re.escape(sysconfig.get_config_var("EXT_SUFFIX"))) + r"python/cv2/python-%s/cv2.*" + % (sys.version_info[0]) ] + [ @@ -147,6 +147,7 @@ def main(): "-DBUILD_TESTS=OFF", "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", + "-DPYTHON3_LIMITED_API=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 @@ -357,7 +358,7 @@ def _classify_installed_files_override( # lines for a proper work using pylint and an autocomplete in IDE with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init: opencv_init_lines = opencv_init.readlines() - extra_imports = ('\nfrom .cv2 import *\nfrom . import data\n') + extra_imports = ('\nfrom .cv2 import *\nfrom . import data\nfrom . import version\n') free_line_after_imports = 5 opencv_init_lines.insert(free_line_after_imports, extra_imports) diff --git a/travis_config.sh b/travis_config.sh index 6d6cc06b..7bbfec68 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -14,7 +14,9 @@ function bdist_wheel_cmd { # copied from multibuild's common_utils.sh # add osx deployment target so it doesn't default to 10.6 local abs_wheelhouse=$1 - CI_BUILD=1 pip wheel --verbose --wheel-dir="$PWD/dist" . $BDIST_PARAMS + # install all required packages in pyproject.toml, because bdist_wheel does not do it + python${PYTHON_VERSION} -m pip install toml && python${PYTHON_VERSION} -c 'import toml; c = toml.load("pyproject.toml"); print("\n".join(c["build-system"]["requires"]))' | python${PYTHON_VERSION} -m pip install -r /dev/stdin + CI_BUILD=1 python${PYTHON_VERSION} setup.py bdist_wheel --py-limited-api=cp36 -v cp dist/*.whl $abs_wheelhouse if [ -z "$IS_OSX" ]; then # this path can be changed in the latest manylinux image @@ -22,8 +24,6 @@ function bdist_wheel_cmd { /opt/python/cp39-cp39/bin/python -m venv $TOOLS_PATH source $TOOLS_PATH/bin/activate python patch_auditwheel_whitelist.py - # to avoid issues with numpy wheels - rm /io/wheelhouse/numpy* deactivate fi if [ -n "$USE_CCACHE" -a -z "$BREW_BOOTSTRAP_MODE" ]; then ccache -s; fi From dfc63bf2909426a77b1ef82e64b782423e59b5e8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 15 Dec 2021 21:04:34 +0300 Subject: [PATCH 27/51] Changed a path to config-X.py file after python limited API support, optimized uploading and downloading artifacts --- .github/workflows/build_wheels_linux.yml | 54 +-------- .github/workflows/build_wheels_linux_arm.yml | 54 +-------- .github/workflows/build_wheels_macos.yml | 54 +-------- .github/workflows/build_wheels_macos_m1.yml | 54 +-------- .github/workflows/build_wheels_windows.yml | 110 +------------------ setup.py | 4 +- 6 files changed, 27 insertions(+), 303 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 338673dc..bd42944c 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -67,33 +67,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -130,32 +108,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 08badc5b..a97bbc29 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -67,33 +67,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build_arm] @@ -136,32 +114,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation and run tests diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 0ff69ede..87fe6f99 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -94,33 +94,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -175,32 +153,10 @@ jobs: - name: Setup Environment variables run: if [ "3.10" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index cd183389..3711e1b3 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -59,33 +59,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} + path: wheelhouse/opencv*.whl test: needs: [build] @@ -111,32 +89,10 @@ jobs: submodules: true fetch-depth: 0 - - name: Download opencv-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels - path: wheelhouse/ - - - name: Download opencv-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} path: wheelhouse/ - name: Package installation diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index ade90ead..0f697291 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -70,61 +70,11 @@ jobs: name: wheels path: wheelhouse/opencv*.whl - - name: Saving opencv-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} + - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v2 with: - name: opencv-python-wheels-x86 - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-wheels-x64 - path: wheelhouse/opencv_python-*.whl - - - name: Saving opencv-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels-x86 - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-python-headless-wheels-x64 - path: wheelhouse/opencv_python_headless-*.whl - - - name: Saving opencv-contrib-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels-x86 - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-wheels-x64 - path: wheelhouse/opencv_contrib_python-*.whl - - - name: Saving opencv-contrib-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x86 - path: wheelhouse/opencv_contrib_python_headless-*.whl - - - name: Saving opencv-contrib-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/upload-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x64 - path: wheelhouse/opencv_contrib_python_headless-*.whl + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} + path: wheelhouse/opencv* test: needs: [build-windows-x86_64] @@ -160,60 +110,10 @@ jobs: python-version: ${{ matrix.python-version }} architecture: ${{ matrix.platform }} - - name: Download opencv-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 0 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-python-headless-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-contrib-python x86 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-contrib-python x64 wheels - if: ${{ matrix.without_gui == 0 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-wheels-x64 - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless x86 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x86' }} - uses: actions/download-artifact@v2 - with: - name: opencv-contrib-python-headless-wheels-x86 - path: wheelhouse/ - - - name: Download opencv-contrib-python-headless x64 wheels - if: ${{ matrix.without_gui == 1 && matrix.with_contrib == 1 && matrix.platform == 'x64' }} + - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v2 with: - name: opencv-contrib-python-headless-wheels-x64 + name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}-${{ matrix.platform }} path: wheelhouse/ - name: Package installation diff --git a/setup.py b/setup.py index 2e268bff..ca6b2ff5 100644 --- a/setup.py +++ b/setup.py @@ -368,8 +368,8 @@ def _classify_installed_files_override( # add lines from the old __init__.py file to the config file with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init: custom_init_data = custom_init.read() - with open('%spython/cv2/config-%s.%s.py' - % (cmake_install_dir, sys.version_info[0], sys.version_info[1]), 'w') as opencv_init_config: + with open('%spython/cv2/config-%s.py' + % (cmake_install_dir, sys.version_info[0]), 'w') as opencv_init_config: opencv_init_config.write(custom_init_data) for package_name, relpaths_re in cls.package_paths_re.items(): From 4af87025c9642b721442c490ed8ff06f18653486 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sat, 25 Dec 2021 15:43:25 +0300 Subject: [PATCH 28/51] Updated commits to 3.4.17 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index b1cf5501..631126c7 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit b1cf5501233405de3ea5926d1d688e421b337458 +Subproject commit 631126c77ade2428cc82aced42bdc4166ac2e817 diff --git a/opencv_contrib b/opencv_contrib index 02c2b56c..e0db5fde 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit 02c2b56c44503e983c3eacd5b79744a24f433c36 +Subproject commit e0db5fde1d4f688f9cab3d33862cfcf561bd754e diff --git a/opencv_extra b/opencv_extra index 38d49ada..b2e7c8ac 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit 38d49adaabb08618ff9fb224004362de80fdcbcc +Subproject commit b2e7c8ac8fedbce149c4b98ca8c087f1a5dfd5e2 From e8811044c9866d1dbd0e9253e2bec13c7dc44b08 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Sun, 26 Dec 2021 22:02:16 +0300 Subject: [PATCH 29/51] Added openexr build flag --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index ca6b2ff5..38ae8078 100644 --- a/setup.py +++ b/setup.py @@ -148,6 +148,7 @@ def main(): "-DBUILD_PERF_TESTS=OFF", "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", + "-DBUILD_OPENEXR=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 3ed57ff8c912e1b1dffbe261f662f1e2969907b6 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 24 Jan 2022 23:18:32 +0300 Subject: [PATCH 30/51] Updated dependencies to the latest releases (openssl and ffmpeg) in a dockerfile, turned on building libpng --- docker/manylinux2014/Dockerfile_aarch64 | 12 ++++++------ docker/manylinux2014/Dockerfile_i686 | 12 ++++++------ docker/manylinux2014/Dockerfile_x86_64 | 12 ++++++------ setup.py | 1 + 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index c76ccec4..9a5b0a48 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index 6a60a073..b434f5c0 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ # in i686, ./config detects x64 in i686 container without linux32 # when run from "docker build" linux32 ./config --prefix="$HOME/ffmpeg_build" no-pinshared shared zlib && \ @@ -52,9 +52,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index 49622378..f07baf74 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -18,9 +18,9 @@ ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1g.tar.gz && \ - tar -xf OpenSSL_1_1_1g.tar.gz && \ - cd openssl-OpenSSL_1_1_1g && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ + tar -xf OpenSSL_1_1_1m.tar.gz && \ + cd openssl-OpenSSL_1_1_1m && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -50,9 +50,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.3.2.tar.bz2 && \ - tar -xf ffmpeg-4.3.2.tar.bz2 && \ - cd ffmpeg-4.3.2 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ + tar -xf ffmpeg-4.4.1.tar.bz2 && \ + cd ffmpeg-4.4.1 && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ diff --git a/setup.py b/setup.py index 38ae8078..7c8dc2c5 100644 --- a/setup.py +++ b/setup.py @@ -149,6 +149,7 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", + "-DBUILD_PNG=ON", ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From c2875aa410ab7cc2024f44482d807ac1026b182b Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 25 Jan 2022 11:32:45 +0300 Subject: [PATCH 31/51] Added versions of dependecies as arguments in dockerfiles --- docker/manylinux2014/Dockerfile_aarch64 | 47 ++++++++++++--------- docker/manylinux2014/Dockerfile_i686 | 56 ++++++++++++++----------- docker/manylinux2014/Dockerfile_x86_64 | 40 ++++++++++-------- 3 files changed, 82 insertions(+), 61 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index 9a5b0a48..b380d3ba 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -1,26 +1,33 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest +ARG CCACHE_VERSION=3.7.9 +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +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 && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -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 && \ + ./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 && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -28,16 +35,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +57,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ @@ -61,9 +68,9 @@ RUN cd ~/ffmpeg_sources && \ ldconfig && \ rm -rf ~/ffmpeg_sources -RUN curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.9/ccache-3.7.9.tar.gz && \ - tar -xf ccache-3.7.9.tar.gz && \ - cd ccache-3.7.9 && \ +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install diff --git a/docker/manylinux2014/Dockerfile_i686 b/docker/manylinux2014/Dockerfile_i686 index b434f5c0..3b866874 100644 --- a/docker/manylinux2014/Dockerfile_i686 +++ b/docker/manylinux2014/Dockerfile_i686 @@ -1,26 +1,34 @@ FROM quay.io/pypa/manylinux2014_i686:latest +ARG CCACHE_VERSION=3.7.9 +ARG CMAKE_VERSION=3.17.0 +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +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 && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -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 && \ + ./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 && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ # in i686, ./config detects x64 in i686 container without linux32 # when run from "docker build" linux32 ./config --prefix="$HOME/ffmpeg_build" no-pinshared shared zlib && \ @@ -30,16 +38,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -52,9 +60,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" linux32 ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ @@ -63,22 +71,22 @@ RUN cd ~/ffmpeg_sources && \ ldconfig && \ rm -rf ~/ffmpeg_sources -RUN curl -O -L https://github.com/ccache/ccache/releases/download/v3.7.9/ccache-3.7.9.tar.gz && \ - tar -xf ccache-3.7.9.tar.gz && \ - cd ccache-3.7.9 && \ +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install -RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v3.17.0/cmake-3.17.0.tar.gz && \ - tar -xf cmake-3.17.0.tar.gz && \ - cd cmake-3.17.0 && \ +RUN curl -O -L https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz && \ + tar -xf cmake-${CMAKE_VERSION}.tar.gz && \ + cd cmake-${CMAKE_VERSION} && \ export MAKEFLAGS=-j$(getconf _NPROCESSORS_ONLN) && \ ./configure --system-curl && \ make && \ make install && \ cd .. && \ - rm -rf cmake-3.17.0* + rm -rf cmake-${CMAKE_VERSION}* ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index f07baf74..fb367c0a 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,26 +1,32 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest +ARG FFMPEG_VERSION=4.4.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1m +ARG QT_VERSION=5.15.0 +ARG YASM_VERSION=1.3.0 + RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y -RUN curl -O -L https://download.qt.io/official_releases/qt/5.15/5.15.0/single/qt-everywhere-src-5.15.0.tar.xz && \ - tar -xf qt-everywhere-src-5.15.0.tar.xz && \ +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 && \ cd qt-everywhere* && \ export MAKEFLAGS=-j$(nproc) && \ - ./configure -prefix /opt/Qt5.15.0 -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 && \ + ./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 && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-5.15.0 && \ - rm qt-everywhere-src-5.15.0.tar.xz + rm -rf qt-everywhere-src-${QT_VERSION} && \ + rm qt-everywhere-src-${QT_VERSION}.tar.xz -ENV QTDIR /opt/Qt5.15.0 +ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ - curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_1_1_1m.tar.gz && \ - tar -xf OpenSSL_1_1_1m.tar.gz && \ - cd openssl-OpenSSL_1_1_1m && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ ./config --prefix="$HOME/ffmpeg_build" --openssldir="$HOME/ffmpeg_build" no-pinshared shared zlib && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation @@ -28,16 +34,16 @@ RUN mkdir ~/ffmpeg_sources && \ rm -rf ~/openssl_build RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/2.15.04/nasm-2.15.04.tar.bz2 && \ - tar -xf nasm-2.15.04.tar.bz2 && cd nasm-2.15.04 && ./autogen.sh && \ + curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ + tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-1.3.0.tar.gz && \ - tar -xf yasm-1.3.0.tar.gz && \ - cd yasm-1.3.0 && \ + curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ + tar -xf yasm-${YASM_VERSION}.tar.gz && \ + cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install @@ -50,9 +56,9 @@ RUN cd ~/ffmpeg_sources && \ make install RUN cd ~/ffmpeg_sources && \ - curl -O -L https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.bz2 && \ - tar -xf ffmpeg-4.4.1.tar.bz2 && \ - cd ffmpeg-4.4.1 && \ + curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ + cd ffmpeg-${FFMPEG_VERSION} && \ PATH=~/bin:$PATH && \ PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib" --enable-openssl --enable-libvpx --enable-shared --enable-pic --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ From 7519319e927b0a948242862d43b397ebd8c2c3ae Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 11:12:51 +0300 Subject: [PATCH 32/51] Defined static version of windows server --- .github/workflows/build_wheels_windows.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0f697291..cb2beb12 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -21,7 +21,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] + os: [windows-2019] python-version: ['3.6'] platform: [x86, x64] with_contrib: [0, 1] @@ -86,7 +86,7 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-latest] + os: [windows-2019] python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] platform: [x86, x64] with_contrib: [0, 1] From 89e0887b17ef222a7e7339e67931ef2b60b3cb45 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 11:30:02 +0300 Subject: [PATCH 33/51] Updated MSBuild action --- .github/workflows/build_wheels_windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cb2beb12..0262c7b8 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -53,7 +53,7 @@ jobs: architecture: ${{ matrix.platform }} - name: Setup MSBuild.exe - uses: warrenbuckley/Setup-MSBuild@v1 + uses: microsoft/setup-msbuild@v1.1 - name: Build a package run: | From 658b0b2187f6c4dd0ff6e09f89d7a6a2c65b332d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 3 Mar 2022 14:00:43 +0300 Subject: [PATCH 34/51] Defined ffmpeg version for macos (4.4.1) and fixed MacOS build --- .github/workflows/build_wheels_macos.yml | 1 + travis_config.sh | 37 ++++++------------------ 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 87fe6f99..c70f2b2d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -55,6 +55,7 @@ jobs: USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 + FFMPEG_FORMULA_VERSION: '@4' SDIST: ${{ matrix.build_sdist || 0 }} ENABLE_HEADLESS: ${{ matrix.without_gui }} ENABLE_CONTRIB: ${{ matrix.with_contrib }} diff --git a/travis_config.sh b/travis_config.sh index 7bbfec68..dfb656e8 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -50,7 +50,7 @@ if [ -n "$IS_OSX" ]; then function generate_ffmpeg_formula { local FF="ffmpeg" local LFF="ffmpeg_opencv" - local FF_FORMULA; FF_FORMULA=$(brew formula "$FF") + local FF_FORMULA; FF_FORMULA=$(brew formula "${FF}${FFMPEG_FORMULA_VERSION}") local LFF_FORMULA; LFF_FORMULA="$(dirname "$FF_FORMULA")/${LFF}.rb" local REGENERATE @@ -70,8 +70,9 @@ if [ -n "$IS_OSX" ]; then if [ -n "$REGENERATE" ]; then echo "Regenerating custom ffmpeg formula" # Bottle block syntax: https://docs.brew.sh/Bottles#bottle-dsl-domain-specific-language + # FfmpegAT4 is a class in ffmpeg@4 formula perl -wpe 'BEGIN {our ($found_blank, $bottle_block);} - if (/(^class )(Ffmpeg)(\s.*)/) {$_=$1.$2."Opencv".$3."\n"; next;} + if (/(^class )(FfmpegAT4)(\s.*)/) {$_=$1."FfmpegOpencv".$3."\n"; next;} if (!$found_blank && /^$/) {$_.="conflicts_with \"ffmpeg\"\n\n"; $found_blank=1; next;} if (!$bottle_block && /^\s*bottle do$/) { $bottle_block=1; next; } if ($bottle_block) { if (/^\s*end\s*$/) { $bottle_block=0} elsif (/^\s*sha256\s/) {$_=""} next; } @@ -111,34 +112,14 @@ function pre_build { CACHE_STAGE= export HOMEBREW_NO_AUTO_UPDATE=1 - #after the cache stage, all bottles and Homebrew metadata should be already cached locally - # if [ -n "$CACHE_STAGE" ]; then - # brew update - # generate_ffmpeg_formula - # brew_add_local_bottles - # fi - echo 'Installing FFmpeg' - # if [ -n "$CACHE_STAGE" ]; then - # brew_install_and_cache_within_time_limit ffmpeg_opencv || { [ $? -gt 1 ] && return 2 || return 0; } - # else - brew update - generate_ffmpeg_formula - brew_add_local_bottles - # brew unlink python@2 - brew install --build-bottle ffmpeg_opencv - # fi - - # echo 'Installing qt5' - - # if [ -n "$CACHE_STAGE" ]; then - # echo "Qt5 has bottle, no caching needed" - # else - # brew switch qt 5.13.2 - # brew pin qt - # export PATH="/usr/local/opt/qt/bin:$PATH" - # fi + brew update + generate_ffmpeg_formula + brew_add_local_bottles + brew install --build-bottle ffmpeg_opencv + # It needs when we use not the latest ffmpeg formula + brew link ffmpeg_opencv if [ -n "$CACHE_STAGE" ]; then brew_go_bootstrap_mode 0 From b4ff4f4b048609201c9026ce0dfdde881683a75b Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 22 Mar 2022 17:57:51 +0300 Subject: [PATCH 35/51] Added pylint test --- .github/workflows/build_wheels_macos.yml | 5 +++ .github/workflows/build_wheels_macos_m1.yml | 5 +++ .github/workflows/build_wheels_windows.yml | 6 ++++ tests/pylint.py | 3 ++ travis_config.sh | 37 ++++++++++----------- 5 files changed, 37 insertions(+), 19 deletions(-) create mode 100644 tests/pylint.py diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index c70f2b2d..2e434a5f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -171,6 +171,11 @@ jobs: cd ${{ github.workspace }}/opencv python modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 3711e1b3..46ecb631 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -106,6 +106,11 @@ jobs: cd ${{ github.workspace }}/opencv arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo . + - name: Pylint test + run: | + arch -arm64 python${{ matrix.python-version }} -m pip install pylint + arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build, test] diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 0262c7b8..cee1d848 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -130,6 +130,12 @@ jobs: python modules\python\test\test.py -v --repo . shell: cmd + - name: Pylint test + run: | + python -m pip install pylint + python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + shell: cmd + test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease needs: [build-windows-x86_64, test] diff --git a/tests/pylint.py b/tests/pylint.py new file mode 100644 index 00000000..d10ad684 --- /dev/null +++ b/tests/pylint.py @@ -0,0 +1,3 @@ +from cv2 import getStructuringElement, MORPH_ELLIPSE + +a = getStructuringElement(MORPH_ELLIPSE, (3, 3)) diff --git a/travis_config.sh b/travis_config.sh index dfb656e8..751a1772 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -141,37 +141,36 @@ function run_tests { PYTHON=python$PYTHON_VERSION - if [ -n "$IS_OSX" ]; then - echo "Running for OS X" - - cd ../tests - $PYTHON get_build_info.py - - cd ../opencv/ - export OPENCV_TEST_DATA_PATH=../opencv_extra/testdata - else - echo "Running for linux" - - if [ $PYTHON == "python3.6" ]; then - $PYTHON -m pip install -U numpy==1.19.4 - fi - cd /io/tests - $PYTHON get_build_info.py + echo "Running for linux" - cd /io/opencv - export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata + if [ $PYTHON == "python3.6" ]; then + $PYTHON -m pip install -U numpy==1.19.4 fi + cd /io/tests + $PYTHON get_build_info.py + + cd /io/opencv + export OPENCV_TEST_DATA_PATH=/io/opencv_extra/testdata test_wheels + pylint_test } function test_wheels { - echo "Starting tests..." + echo "Starting OpenCV tests..." #Test package $PYTHON modules/python/test/test.py -v --repo . } +function pylint_test { + + echo "Starting Pylint tests..." + + $PYTHON -m pip install pylint + $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring +} + export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' set -x From f15990c258125849ac59a2afa5875fff9c51dfe3 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 23 Mar 2022 10:38:47 +0300 Subject: [PATCH 36/51] Pinned pylint version --- .github/workflows/build_wheels_macos.yml | 2 +- .github/workflows/build_wheels_macos_m1.yml | 2 +- .github/workflows/build_wheels_windows.yml | 2 +- travis_config.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 2e434a5f..f22d56e1 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -173,7 +173,7 @@ jobs: - name: Pylint test run: | - python -m pip install pylint + python -m pip install pylint==2.12.2 python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring test_release_opencv_python: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 46ecb631..1f51a342 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -108,7 +108,7 @@ jobs: - name: Pylint test run: | - arch -arm64 python${{ matrix.python-version }} -m pip install pylint + arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring test_release_opencv_python: diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index cee1d848..bf9f9906 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -132,7 +132,7 @@ jobs: - name: Pylint test run: | - python -m pip install pylint + python -m pip install pylint==2.12.2 python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring shell: cmd diff --git a/travis_config.sh b/travis_config.sh index 751a1772..db3bf773 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -168,7 +168,7 @@ function pylint_test { echo "Starting Pylint tests..." - $PYTHON -m pip install pylint + $PYTHON -m pip install pylint==2.12.2 $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring } From b01f2cfe5d425533c3206846f282029f433826ee Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 23 Mar 2022 16:20:07 +0300 Subject: [PATCH 37/51] Changed using custom test for pylint to opencv sample --- .github/workflows/build_wheels_linux.yml | 2 +- .github/workflows/build_wheels_macos.yml | 4 +++- .github/workflows/build_wheels_macos_m1.yml | 4 +++- .github/workflows/build_wheels_windows.yml | 4 +++- tests/pylint.py | 3 --- tests/pylintrc | 12 ++++++++++++ travis_config.sh | 3 ++- 7 files changed, 24 insertions(+), 8 deletions(-) delete mode 100644 tests/pylint.py create mode 100644 tests/pylintrc diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index bd42944c..5ed44e21 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -102,7 +102,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 with: - submodules: false + submodules: true fetch-depth: 0 - name: Setup Environment variables diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index f22d56e1..bccec01f 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -137,6 +137,7 @@ jobs: CONFIG_PATH: travis_config.sh PLAT: x86_64 OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Checkout @@ -174,7 +175,8 @@ jobs: - name: Pylint test run: | python -m pip install pylint==2.12.2 - python -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}/tests + python -m pylint $PYLINT_TEST_FILE test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 1f51a342..9f7b0f37 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -81,6 +81,7 @@ jobs: env: OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata + PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py steps: - name: Checkout @@ -109,7 +110,8 @@ jobs: - name: Pylint test run: | arch -arm64 python${{ matrix.python-version }} -m pip install pylint==2.12.2 - arch -arm64 python${{ matrix.python-version }} -m pylint ${{ github.workspace }}/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}/tests + arch -arm64 python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index bf9f9906..337c77b2 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -96,6 +96,7 @@ jobs: env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata + PYLINT_TEST_FILE: ${{ github.workspace }}\opencv\samples\python\squares.py steps: - name: Checkout @@ -133,7 +134,8 @@ jobs: - name: Pylint test run: | python -m pip install pylint==2.12.2 - python -m pylint ${{ github.workspace }}\tests\pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd ${{ github.workspace }}\tests + python -m pylint $PYLINT_TEST_FILE shell: cmd test_release_opencv_python: diff --git a/tests/pylint.py b/tests/pylint.py deleted file mode 100644 index d10ad684..00000000 --- a/tests/pylint.py +++ /dev/null @@ -1,3 +0,0 @@ -from cv2 import getStructuringElement, MORPH_ELLIPSE - -a = getStructuringElement(MORPH_ELLIPSE, (3, 3)) diff --git a/tests/pylintrc b/tests/pylintrc new file mode 100644 index 00000000..a3892018 --- /dev/null +++ b/tests/pylintrc @@ -0,0 +1,12 @@ +# Source: opencv/platforms/scripts/pylintrc + +[MESSAGES CONTROL] + +# Disable all to choose the Tests one by one +disable=all + +# Tests +enable=bad-indentation, # Used when an unexpected number of indentation’s tabulations or spaces has been found. + mixed-indentation, # Used when there are some mixed tabs and spaces in a module. + unnecessary-semicolon, # Used when a statement is ended by a semi-colon (”;”), which isn’t necessary. + unused-variable # Used when a variable is defined but not used. (Use _var to ignore var). diff --git a/travis_config.sh b/travis_config.sh index db3bf773..4560f726 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -169,7 +169,8 @@ function pylint_test { echo "Starting Pylint tests..." $PYTHON -m pip install pylint==2.12.2 - $PYTHON -m pylint /io/tests/pylint.py --extension-pkg-whitelist=cv2 --disable=missing-docstring + cd /io/tests + $PYTHON -m pylint /io/opencv/samples/python/squares.py } export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' From 5946584fb720df7dd4d624734827609e24011c6d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 24 Mar 2022 18:17:16 +0300 Subject: [PATCH 38/51] Added pre-downloaded 3rdparty files to source packages --- .github/workflows/build_wheels_linux.yml | 6 ++++-- scripts/source-packages-preparation.sh | 20 ++++++++++++++++++++ setup.py | 2 ++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100755 scripts/source-packages-preparation.sh diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 5ed44e21..3e3e010b 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -171,12 +171,14 @@ jobs: - name: Build a package run: | + # Download all 3rdparty files + source scripts/source-packages-preparation.sh ${{ github.workspace }} set -e # Build and package set -x python -m pip install --upgrade pip python -m pip install scikit-build - python setup.py sdist + python setup.py sdist --formats=xztar set +x # Install and run tests set -x @@ -186,7 +188,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: wheels - path: dist/opencv*.tar.gz + path: dist/opencv*.tar.xz test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease diff --git a/scripts/source-packages-preparation.sh b/scripts/source-packages-preparation.sh new file mode 100755 index 00000000..be49b5b8 --- /dev/null +++ b/scripts/source-packages-preparation.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# ${1} variable is a path to repository opencv-python + +# Define flags +if [ "0" == $ENABLE_CONTRIB ]; then + git submodule update --init opencv + EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty" +else + git submodule update --init opencv opencv_contrib + EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules" +fi + +# Download 3rdparty files +cd opencv && \ +mkdir generate && \ +cd generate && \ +cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \ +cd ${1} && \ +rm -rf opencv/generate diff --git a/setup.py b/setup.py index 7c8dc2c5..4cfc58f6 100644 --- a/setup.py +++ b/setup.py @@ -150,6 +150,8 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", "-DBUILD_PNG=ON", + # To have all 3rdparty files in one place for source packages + "-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")), ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 7a76aeedba77cee9e3722cd6a200c8d0098443c8 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 25 Mar 2022 11:52:15 +0300 Subject: [PATCH 39/51] Revert changes for pre-downloaded files --- .github/workflows/build_wheels_linux.yml | 2 -- scripts/source-packages-preparation.sh | 20 -------------------- setup.py | 2 -- 3 files changed, 24 deletions(-) delete mode 100755 scripts/source-packages-preparation.sh diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 3e3e010b..a368661d 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -171,8 +171,6 @@ jobs: - name: Build a package run: | - # Download all 3rdparty files - source scripts/source-packages-preparation.sh ${{ github.workspace }} set -e # Build and package set -x diff --git a/scripts/source-packages-preparation.sh b/scripts/source-packages-preparation.sh deleted file mode 100755 index be49b5b8..00000000 --- a/scripts/source-packages-preparation.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash - -# ${1} variable is a path to repository opencv-python - -# Define flags -if [ "0" == $ENABLE_CONTRIB ]; then - git submodule update --init opencv - EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty" -else - git submodule update --init opencv opencv_contrib - EXTRA_CMAKE_OPTIONS="-DOPENCV_DOWNLOAD_PATH=${1}/opencv/3rdparty -DOPENCV_EXTRA_MODULES_PATH=${1}/opencv_contrib/modules" -fi - -# Download 3rdparty files -cd opencv && \ -mkdir generate && \ -cd generate && \ -cmake $EXTRA_CMAKE_OPTIONS ${1}/opencv && \ -cd ${1} && \ -rm -rf opencv/generate diff --git a/setup.py b/setup.py index 4cfc58f6..7c8dc2c5 100644 --- a/setup.py +++ b/setup.py @@ -150,8 +150,6 @@ def main(): "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", "-DBUILD_PNG=ON", - # To have all 3rdparty files in one place for source packages - "-DOPENCV_DOWNLOAD_PATH=%s" % (os.path.join(os.path.dirname(os.path.abspath(__file__)), "opencv", "3rdparty")), ] + ( # If it is not defined 'linker flags: /machine:X86' on Windows x64 From 83fdc768fa892045c3bee3446016deeff14a5cbb Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 25 Mar 2022 17:10:44 +0300 Subject: [PATCH 40/51] Skip only gapi if it was not found --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 7c8dc2c5..93aaa2bd 100644 --- a/setup.py +++ b/setup.py @@ -395,7 +395,8 @@ def _classify_installed_files_override( final_install_relpaths.append(new_install_relpath) del m, fslash_relpath, new_install_relpath else: - if not found: + # gapi can be missed if ADE was not downloaded (network issue) + if not found and "gapi" not in relpath_re: raise Exception("Not found: '%s'" % relpath_re) del r, found From 79819ba717781a3e76e5cd582e3c6a43b8bc359b Mon Sep 17 00:00:00 2001 From: Yclept Nemo Date: Mon, 21 Mar 2022 15:06:30 -0400 Subject: [PATCH 41/51] Synchronize with scikit-build scikit-build commit 94089992b353ea3e4b4c2f118ea1987ca54ecbb8: skbuild/setuptools_wrap.py:_classify_installed_files cmake_install_dir -> _cmake_install_dir This allows tracking scikit-build versions >= 0.13.2. The dependencies file has been updated. --- pyproject.toml | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6aaab1d3..a47525d5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,7 @@ [build-system] requires = [ - "setuptools", "wheel", "scikit-build", "cmake", "pip", + "setuptools", "wheel", "cmake", "pip", + "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'", diff --git a/setup.py b/setup.py index 93aaa2bd..82fe1ddf 100644 --- a/setup.py +++ b/setup.py @@ -435,7 +435,7 @@ def _classify_installed_files_override( data_files, # To get around a check that prepends source dir to paths and breaks package detection code. cmake_source_dir="", - cmake_install_dir=cmake_install_reldir, + _cmake_install_dir=cmake_install_reldir, ) From fabee7fb073e9f2e65c5facd8f8e6b85ef5704d4 Mon Sep 17 00:00:00 2001 From: Niyas Sait Date: Mon, 28 Mar 2022 10:13:56 +0100 Subject: [PATCH 42/51] add support for building windows/arm64 package --- setup.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/setup.py b/setup.py index 82fe1ddf..2b0474b8 100644 --- a/setup.py +++ b/setup.py @@ -60,7 +60,7 @@ def main(): ) # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode - x64 = sys.maxsize > 2 ** 32 + is64 = sys.maxsize > 2 ** 32 package_name = "opencv-python" @@ -88,7 +88,7 @@ def main(): # Path regexes with forward slashes relative to CMake install dir. rearrange_cmake_output_data = { "cv2": ( - [r"bin/opencv_ffmpeg\d{3,4}%s\.dll" % ("_64" if x64 else "")] + [r"bin/opencv_ffmpeg\d{3,4}%s\.dll" % ("_64" if is64 else "")] if os.name == "nt" else [] ) @@ -118,7 +118,7 @@ def main(): files_outside_package_dir = {"cv2": ["LICENSE.txt", "LICENSE-3RD-PARTY.txt"]} ci_cmake_generator = ( - ["-G", "Visual Studio 14" + (" Win64" if x64 else "")] + ["-G", "Visual Studio 14" + (" Win64" if is64 else "")] if os.name == "nt" else ["-G", "Unix Makefiles"] ) @@ -152,9 +152,15 @@ def main(): "-DBUILD_PNG=ON", ] + ( + # CMake flags for windows/arm64 build + ["-DCMAKE_GENERATOR_PLATFORM=ARM64", + # Emulated cmake requires following flags to correctly detect + # target architecture for windows/arm64 build + "-DOPENCV_WORKAROUND_CMAKE_20989=ON", + "-DCMAKE_SYSTEM_PROCESSOR=ARM64"] + if platform.machine() == "ARM64" and sys.platform == "win32" # If it is not defined 'linker flags: /machine:X86' on Windows x64 - ["-DCMAKE_GENERATOR_PLATFORM=x64"] - if x64 and sys.platform == "win32" + else ["-DCMAKE_GENERATOR_PLATFORM=x64"] if is64 and sys.platform == "win32" else [] ) + ( @@ -174,7 +180,7 @@ def main(): "-DWITH_MSMF=OFF" ) # see: https://github.com/skvark/opencv-python/issues/263 - if sys.platform.startswith("linux") and not x64 and "bdist_wheel" in sys.argv: + if sys.platform.startswith("linux") and not is64 and "bdist_wheel" in sys.argv: subprocess.check_call("patch -p0 < patches/patchOpenEXR", shell=True) # OS-specific components during CI builds From 24856521b87314ed6f83794e98ef383221d5c2fb Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Thu, 7 Apr 2022 13:34:12 +0300 Subject: [PATCH 43/51] Pinned versions for dependencies --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index a47525d5..f237ddbc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools", "wheel", "cmake", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake==3.22.3", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From d563f74aa93e5ad889098109bc7ff23ceff76e35 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Apr 2022 10:01:04 +0300 Subject: [PATCH 44/51] Downgraded cmake version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f237ddbc..ade9bc2d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools==59.2.0", "wheel==0.37.0", "cmake==3.22.3", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.6.3", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From 31701ffead403dca3a55537d43aa38caaf89418d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Fri, 8 Apr 2022 10:30:35 +0300 Subject: [PATCH 45/51] Downgraded cmake version to 3.1 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ade9bc2d..ff535e86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.6.3", "pip", + "setuptools==59.2.0", "wheel==0.37.0", "cmake>=3.1", "pip", "scikit-build>=0.13.2", "numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'", "numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'", From d87183fd9a9194dd348aeb53c90d46d709a41c54 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 01:23:49 +0300 Subject: [PATCH 46/51] Updated dependecies for the next release --- .github/workflows/build_wheels_linux.yml | 4 +- .github/workflows/build_wheels_linux_arm.yml | 2 +- docker/manylinux2014/Dockerfile_aarch64 | 77 +++++++++++++++---- docker/manylinux2014/Dockerfile_x86_64 | 79 ++++++++++++++++---- setup.py | 1 - travis_config.sh | 5 -- 6 files changed, 127 insertions(+), 41 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index a368661d..fac5ebad 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -39,7 +39,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} USE_CCACHE: 1 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -145,7 +145,7 @@ jobs: NP_TEST_DEP: numpy==1.19.4 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} 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 a97bbc29..c58e0631 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -40,7 +40,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/asenyaev/manylinux2014_${PLAT} + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014:${PLAT} USE_CCACHE: 0 UNICODE_WIDTH: 32 SDIST: ${{ matrix.build_sdist || 0 }} diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index b380d3ba..fedf1e98 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -2,29 +2,60 @@ FROM quay.io/pypa/manylinux2014_aarch64:latest ARG CCACHE_VERSION=3.7.9 ARG FFMPEG_VERSION=4.4.1 +ARG FREETYPE_VERSION=2.12.1 +ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1m +ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel -y && \ + cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ + # libpng will be built from source + yum remove libpng -y + +RUN mkdir ~/libpng_sources && \ + cd ~/libpng_sources && \ + curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \ + tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \ + cd libpng-${LIBPNG_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/libpng_sources + +RUN mkdir ~/freetype_sources && \ + cd ~/freetype_sources && \ + curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ + cd freetype-${FREETYPE_VERSION} && \ + ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + make && \ + make install && \ + 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 && \ - cd qt-everywhere* && \ + 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 && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-${QT_VERSION} && \ - rm qt-everywhere-src-${QT_VERSION}.tar.xz + rm -rf qt-everywhere* ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" -RUN mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +RUN mkdir ~/openssl_sources && \ + cd ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ @@ -32,31 +63,40 @@ RUN mkdir ~/ffmpeg_sources && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ - rm -rf ~/openssl_build + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/nasm_sources && \ + cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/nasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/yasm_sources && \ + cd ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/yasm_sources -RUN cd ~/ffmpeg_sources && \ - git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 https://github.com/webmproject/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ make install -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ @@ -66,7 +106,8 @@ RUN cd ~/ffmpeg_sources && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources + rm -rf ~/ffmpeg_sources && \ + yum remove bzip2-devel -y RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ @@ -75,6 +116,10 @@ RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERS make -j$(getconf _NPROCESSORS_ONLN) && \ make install +# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced +RUN mkdir /io && \ + git config --global --add safe.directory /io + ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib ENV PATH "$HOME/bin:$PATH" diff --git a/docker/manylinux2014/Dockerfile_x86_64 b/docker/manylinux2014/Dockerfile_x86_64 index fb367c0a..13325756 100644 --- a/docker/manylinux2014/Dockerfile_x86_64 +++ b/docker/manylinux2014/Dockerfile_x86_64 @@ -1,29 +1,60 @@ FROM quay.io/pypa/manylinux2014_x86_64:latest ARG FFMPEG_VERSION=4.4.1 +ARG FREETYPE_VERSION=2.12.1 +ARG LIBPNG_VERSION=1.6.37 ARG NASM_VERSION=2.15.04 -ARG OPENSSL_VERSION=1_1_1m +ARG OPENSSL_VERSION=1_1_1o ARG QT_VERSION=5.15.0 ARG YASM_VERSION=1.3.0 -RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel freetype-devel -y +ENV LD_LIBRARY_PATH /usr/local/lib:$LD_LIBRARY_PATH + +# epel-release need for aarch64 to get openblas packages +RUN yum install bzip2-devel curl-devel zlib-devel xcb-util-renderutil-devel xcb-util-devel xcb-util-image-devel xcb-util-keysyms-devel xcb-util-wm-devel mesa-libGL-devel libxkbcommon-devel libxkbcommon-x11-devel libXi-devel lapack-devel epel-release -y && \ + yum install openblas-devel -y && \ + cp /usr/include/lapacke/lapacke*.h /usr/include/ && \ + curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h && \ + # libpng will be built from source + yum remove libpng -y + +RUN mkdir ~/libpng_sources && \ + cd ~/libpng_sources && \ + curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \ + tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \ + cd libpng-${LIBPNG_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/libpng_sources + +RUN mkdir ~/freetype_sources && \ + cd ~/freetype_sources && \ + curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ + cd freetype-${FREETYPE_VERSION} && \ + ./configure --prefix="$HOME/ffmpeg_build" --enable-freetype-config && \ + make && \ + make install && \ + 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 && \ - cd qt-everywhere* && \ + 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 && \ make && \ make install && \ cd .. && \ - rm -rf qt-everywhere-src-${QT_VERSION} && \ - rm qt-everywhere-src-${QT_VERSION}.tar.xz + rm -rf qt-everywhere* ENV QTDIR /opt/Qt${QT_VERSION} ENV PATH "$QTDIR/bin:$PATH" -RUN mkdir ~/ffmpeg_sources && \ - cd ~/ffmpeg_sources && \ +RUN mkdir ~/openssl_sources && \ + cd ~/openssl_sources && \ curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ cd openssl-OpenSSL_${OPENSSL_VERSION} && \ @@ -31,31 +62,42 @@ RUN mkdir ~/ffmpeg_sources && \ make -j$(getconf _NPROCESSORS_ONLN) && \ # skip installing documentation make install_sw && \ - rm -rf ~/openssl_build + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/nasm_sources && \ + cd ~/nasm_sources && \ curl -O -L http://www.nasm.us/pub/nasm/releasebuilds/${NASM_VERSION}/nasm-${NASM_VERSION}.tar.bz2 && \ tar -xf nasm-${NASM_VERSION}.tar.bz2 && cd nasm-${NASM_VERSION} && ./autogen.sh && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/nasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/yasm_sources && \ + cd ~/yasm_sources && \ curl -O -L http://www.tortall.net/projects/yasm/releases/yasm-${YASM_VERSION}.tar.gz && \ tar -xf yasm-${YASM_VERSION}.tar.gz && \ cd yasm-${YASM_VERSION} && \ ./configure --prefix="$HOME/ffmpeg_build" --bindir="$HOME/bin" && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/yasm_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ git clone --depth 1 https://chromium.googlesource.com/webm/libvpx.git && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources -RUN cd ~/ffmpeg_sources && \ +RUN mkdir ~/ffmpeg_sources && \ + cd ~/ffmpeg_sources && \ curl -O -L https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ tar -xf ffmpeg-${FFMPEG_VERSION}.tar.bz2 && \ cd ffmpeg-${FFMPEG_VERSION} && \ @@ -65,7 +107,12 @@ RUN cd ~/ffmpeg_sources && \ make install && \ echo "/root/ffmpeg_build/lib/" >> /etc/ld.so.conf && \ ldconfig && \ - rm -rf ~/ffmpeg_sources + rm -rf ~/ffmpeg_sources && \ + yum remove bzip2-devel -y + +# Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced +RUN mkdir /io && \ + git config --global --add safe.directory /io ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/root/ffmpeg_build/lib/pkgconfig ENV LDFLAGS -L/root/ffmpeg_build/lib diff --git a/setup.py b/setup.py index 2b0474b8..613938ff 100644 --- a/setup.py +++ b/setup.py @@ -149,7 +149,6 @@ def main(): "-DBUILD_DOCS=OFF", "-DPYTHON3_LIMITED_API=ON", "-DBUILD_OPENEXR=ON", - "-DBUILD_PNG=ON", ] + ( # CMake flags for windows/arm64 build diff --git a/travis_config.sh b/travis_config.sh index 4560f726..366d35ad 100644 --- a/travis_config.sh +++ b/travis_config.sh @@ -98,11 +98,6 @@ function pre_build { if [ -n "$IS_OSX" ]; then brew install lapack - else - # epel-release need for aarch64 to get openblas packages - yum install -y lapack-devel epel-release && yum install -y openblas-devel - cp /usr/include/lapacke/lapacke*.h /usr/include/ - curl https://raw.githubusercontent.com/xianyi/OpenBLAS/v0.3.3/cblas.h -o /usr/include/cblas.h fi if [ -n "$IS_OSX" ]; then From ac615ea07e2ff05853cc4513759aae6b9f8e4214 Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 10:48:58 +0300 Subject: [PATCH 47/51] Updated dependecies for the next release --- docker/manylinux2014/Dockerfile_aarch64 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docker/manylinux2014/Dockerfile_aarch64 b/docker/manylinux2014/Dockerfile_aarch64 index fedf1e98..03889a51 100644 --- a/docker/manylinux2014/Dockerfile_aarch64 +++ b/docker/manylinux2014/Dockerfile_aarch64 @@ -93,7 +93,9 @@ RUN mkdir ~/libvpx_sources && \ cd libvpx && \ ./configure --prefix="$HOME/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources RUN mkdir ~/ffmpeg_sources && \ cd ~/ffmpeg_sources && \ @@ -114,7 +116,9 @@ RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERS cd ccache-${CCACHE_VERSION} && \ linux32 ./configure && \ make -j$(getconf _NPROCESSORS_ONLN) && \ - make install + make install && \ + cd .. && \ + rm -rf ccache-${CCACHE_VERSION}.tar.gz # Git security vulnerability: https://github.blog/2022-04-12-git-security-vulnerability-announced RUN mkdir /io && \ From 964ad086219429146d9a6ed455bf3e831652558a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Tue, 31 May 2022 13:33:43 +0300 Subject: [PATCH 48/51] Check changes on 3.4 branch in PRs --- .github/workflows/build_wheels_linux.yml | 1 + .github/workflows/build_wheels_linux_arm.yml | 1 + .github/workflows/build_wheels_macos.yml | 1 + .github/workflows/build_wheels_macos_m1.yml | 1 + .github/workflows/build_wheels_windows.yml | 1 + 5 files changed, 5 insertions(+) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index fac5ebad..362001fb 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index c58e0631..a892040b 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux.yml' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index bccec01f..c453ab85 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 9f7b0f37..1ac065f1 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_windows*' diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 337c77b2..0dad17b5 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -4,6 +4,7 @@ on: pull_request: branches: - master + - 3.4 paths-ignore: - '.github/workflows/build_wheels_linux*' - '.github/workflows/build_wheels_macos*' From f9657207ba5b645fa35f204d5713ca31f19cd78d Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 6 Jun 2022 01:37:10 +0300 Subject: [PATCH 49/51] Removed unused lines --- setup.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/setup.py b/setup.py index 613938ff..5f74ff2a 100644 --- a/setup.py +++ b/setup.py @@ -362,16 +362,6 @@ def _classify_installed_files_override( print("Copying files from CMake output") - # lines for a proper work using pylint and an autocomplete in IDE - with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'r') as opencv_init: - opencv_init_lines = opencv_init.readlines() - extra_imports = ('\nfrom .cv2 import *\nfrom . import data\nfrom . import version\n') - free_line_after_imports = 5 - opencv_init_lines.insert(free_line_after_imports, extra_imports) - - with open(os.path.join(cmake_install_dir, "python", "cv2", "__init__.py"), 'w') as opencv_final_init: - opencv_final_init.writelines(opencv_init_lines) - # add lines from the old __init__.py file to the config file with open(os.path.join(os.path.dirname(os.path.abspath(__file__)), 'scripts', '__init__.py'), 'r') as custom_init: custom_init_data = custom_init.read() From 6521b4b1d5a487a6faec051340ef29f6342e4eae Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Mon, 6 Jun 2022 01:40:41 +0300 Subject: [PATCH 50/51] Updated submodules to 3.4.18 release --- opencv | 2 +- opencv_contrib | 2 +- opencv_extra | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/opencv b/opencv index 631126c7..a3d08823 160000 --- a/opencv +++ b/opencv @@ -1 +1 @@ -Subproject commit 631126c77ade2428cc82aced42bdc4166ac2e817 +Subproject commit a3d088231745d147681d90579ef6e5380d7e5cb5 diff --git a/opencv_contrib b/opencv_contrib index e0db5fde..0eda296f 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit e0db5fde1d4f688f9cab3d33862cfcf561bd754e +Subproject commit 0eda296f4038ae058d76e2d828da8d0e7991cf85 diff --git a/opencv_extra b/opencv_extra index b2e7c8ac..5bad5827 160000 --- a/opencv_extra +++ b/opencv_extra @@ -1 +1 @@ -Subproject commit b2e7c8ac8fedbce149c4b98ca8c087f1a5dfd5e2 +Subproject commit 5bad58277b230294a76a5204d5a476db2c9b2132 From a5a9b6e220cd06e69d131a5c66082d79163e6a2a Mon Sep 17 00:00:00 2001 From: Andrey Senyaev Date: Wed, 8 Jun 2022 13:36:57 +0300 Subject: [PATCH 51/51] Changed format of an archive for source packages --- .github/workflows/build_wheels_linux.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 362001fb..5315e161 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -177,7 +177,7 @@ jobs: set -x python -m pip install --upgrade pip python -m pip install scikit-build - python setup.py sdist --formats=xztar + python setup.py sdist --formats=gztar set +x # Install and run tests set -x @@ -187,7 +187,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: wheels - path: dist/opencv*.tar.xz + path: dist/opencv*.tar.gz test_release_opencv_python: if: github.event_name == 'release' && github.event.release.prerelease