Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_51672696
opencv-python
提交
040dc8d8
O
opencv-python
项目概览
weixin_51672696
/
opencv-python
与 Fork 源项目一致
Fork自
OpenCV / opencv-python
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
opencv-python
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
040dc8d8
编写于
12月 15, 2021
作者:
A
Andrey Senyaev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Added python limited API support
上级
d0ebd717
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
592 addition
and
92 deletion
+592
-92
.github/workflows/build_wheels_linux.yml
.github/workflows/build_wheels_linux.yml
+100
-23
.github/workflows/build_wheels_linux_arm.yml
.github/workflows/build_wheels_linux_arm.yml
+105
-16
.github/workflows/build_wheels_macos.yml
.github/workflows/build_wheels_macos.yml
+126
-18
.github/workflows/build_wheels_macos_m1.yml
.github/workflows/build_wheels_macos_m1.yml
+94
-15
.github/workflows/build_wheels_windows.yml
.github/workflows/build_wheels_windows.yml
+160
-14
setup.py
setup.py
+4
-3
travis_config.sh
travis_config.sh
+3
-3
未找到文件。
.github/workflows/build_wheels_linux.yml
浏览文件 @
040dc8d8
...
...
@@ -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
:
...
...
.github/workflows/build_wheels_linux_arm.yml
浏览文件 @
040dc8d8
...
...
@@ -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
:
...
...
.github/workflows/build_wheels_macos.yml
浏览文件 @
040dc8d8
...
...
@@ -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 artifact
s
-
name
:
Saving all wheel
s
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
:
...
...
.github/workflows/build_wheels_macos_m1.yml
浏览文件 @
040dc8d8
...
...
@@ -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
:
...
...
.github/workflows/build_wheels_windows.yml
浏览文件 @
040dc8d8
...
...
@@ -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
:
...
...
setup.py
浏览文件 @
040dc8d8
...
...
@@ -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
])
]
+
[
...
...
@@ -159,6 +159,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
...
...
@@ -370,7 +371,7 @@ class RearrangeCMakeOutput(object):
with
open
(
os
.
path
.
join
(
cmake_install_dir
,
"python"
,
"cv2"
,
"__init__.py"
),
'r'
)
as
opencv_init
:
opencv_init_lines
=
opencv_init
.
readlines
()
extra_imports
=
(
'
\n
from .cv2 import *
\n
from .cv2 import _registerMatType
\n
from . import mat_wrapper
\n
from . import gapi'
'
\n
from . import misc
\n
from . import utils
\n
from . import data
\n
'
)
'
\n
from . import misc
\n
from . import utils
\n
from . import data
\n
from . import version
\n
'
)
free_line_after_imports
=
6
opencv_init_lines
.
insert
(
free_line_after_imports
,
extra_imports
)
opencv_init_data
=
""
...
...
travis_config.sh
浏览文件 @
040dc8d8
...
...
@@ -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
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录