Skip to content

Commit d490870

Browse files
authored
Merge pull request #512 from asenyaev/3.4
Update 3.4 with master changes
2 parents 0df0e01 + c57c411 commit d490870

7 files changed

+144
-12
lines changed

Diff for: .github/workflows/build_wheels_linux.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
branches:
66
- master
7+
paths-ignore:
8+
- '.github/workflows/build_wheels_linux_arm.yml'
9+
- '.github/workflows/build_wheels_windows*'
10+
- '.github/workflows/build_wheels_macos*'
711
release:
812
types: [published, edited]
913

@@ -170,7 +174,7 @@ jobs:
170174
- name: Upload all wheels
171175
run: |
172176
python -m pip install twine
173-
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
177+
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* wheelhouse/opencv-*
174178
175179
release_opencv_python:
176180
if: github.event_name == 'release' && !github.event.release.prerelease
@@ -189,19 +193,19 @@ jobs:
189193
- name: Upload wheels for opencv_python
190194
run: |
191195
python -m pip install twine
192-
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
196+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* wheelhouse/opencv-python-[^h]*
193197
194198
- name: Upload wheels for opencv_contrib_python
195199
run: |
196200
python -m pip install twine
197-
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
201+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* wheelhouse/opencv-contrib-python-[^h]*
198202
199203
- name: Upload wheels for opencv_python_headless
200204
run: |
201205
python -m pip install twine
202-
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
206+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* wheelhouse/opencv-python-headless-*
203207
204208
- name: Upload wheels for opencv_contrib_python_headless
205209
run: |
206210
python -m pip install twine
207-
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*
211+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* wheelhouse/opencv-contrib-python-headless-*

Diff for: .github/workflows/build_wheels_linux_arm.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
branches:
66
- master
7+
paths-ignore:
8+
- '.github/workflows/build_wheels_linux.yml'
9+
- '.github/workflows/build_wheels_windows*'
10+
- '.github/workflows/build_wheels_macos*'
711
release:
812
types: [published, edited]
913

Diff for: .github/workflows/build_wheels_macos.yml

+4
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ on:
44
pull_request:
55
branches:
66
- master
7+
paths-ignore:
8+
- '.github/workflows/build_wheels_linux*'
9+
- '.github/workflows/build_wheels_windows*'
10+
- '.github/workflows/build_wheels_macos_m1.yml'
711
release:
812
types: [published, edited]
913

Diff for: .github/workflows/build_wheels_macos_m1.yml

+117
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
name: Build PYPI wheels for opencv-python on Macos M1
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths-ignore:
8+
- '.github/workflows/build_wheels_linux*'
9+
- '.github/workflows/build_wheels_windows*'
10+
- '.github/workflows/build_wheels_macos.yml'
11+
release:
12+
types: [published, edited]
13+
14+
15+
jobs:
16+
build:
17+
runs-on: ${{ matrix.os }}
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [macOS-M1]
23+
python-version: [3.7, 3.8, 3.9]
24+
platform: [x64]
25+
with_contrib: [0, 1]
26+
without_gui: [0, 1]
27+
build_sdist: [0]
28+
29+
env:
30+
SDIST: ${{ matrix.build_sdist || 0 }}
31+
ENABLE_HEADLESS: ${{ matrix.without_gui }}
32+
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
33+
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v2
38+
with:
39+
submodules: false
40+
fetch-depth: 0
41+
42+
- name: Update submodules
43+
if: github.event_name == 'pull_request'
44+
run: git submodule update --remote
45+
46+
- name: build script
47+
run: |
48+
git submodule update --init multibuild
49+
echo $ENABLE_CONTRIB > contrib.enabled
50+
echo $ENABLE_HEADLESS > headless.enabled
51+
export MACOSX_DEPLOYMENT_TARGET=11.0
52+
arch -arm64 python${{ matrix.python-version }} -m pip wheel --wheel-dir=wheelhouse . --verbose
53+
- name: before test
54+
run: |
55+
git submodule update --init --recursive
56+
arch -arm64 python${{ matrix.python-version }} -m pip install --user --no-cache --force-reinstall wheelhouse/opencv*.whl
57+
cd ${{ github.workspace }}/tests
58+
arch -arm64 python${{ matrix.python-version }} get_build_info.py
59+
- name: run test
60+
run: |
61+
cd ${{ github.workspace }}/opencv
62+
arch -arm64 python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
63+
- name: saving artifacts
64+
uses: actions/upload-artifact@v2
65+
with:
66+
name: wheels
67+
path: wheelhouse/opencv*.whl
68+
69+
test_release_opencv_python:
70+
if: github.event_name == 'release' && github.event.release.prerelease
71+
needs: [build]
72+
runs-on: ubuntu-latest
73+
environment: test-opencv-python-release
74+
defaults:
75+
run:
76+
shell: bash
77+
steps:
78+
- uses: actions/download-artifact@v2
79+
with:
80+
name: wheels
81+
path: wheelhouse/
82+
83+
- name: Upload all wheels
84+
run: |
85+
python -m pip install twine
86+
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*
87+
88+
release_opencv_python:
89+
if: github.event_name == 'release' && !github.event.release.prerelease
90+
needs: [build]
91+
runs-on: ubuntu-latest
92+
environment: opencv-python-release
93+
defaults:
94+
run:
95+
shell: bash
96+
steps:
97+
- uses: actions/download-artifact@v2
98+
with:
99+
name: wheels
100+
path: wheelhouse/
101+
102+
- name: Upload wheels for opencv_python
103+
run: |
104+
python -m pip install twine
105+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-*
106+
- name: Upload wheels for opencv_contrib_python
107+
run: |
108+
python -m pip install twine
109+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-*
110+
- name: Upload wheels for opencv_python_headless
111+
run: |
112+
python -m pip install twine
113+
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*
114+
- name: Upload wheels for opencv_contrib_python_headless
115+
run: |
116+
python -m pip install twine
117+
python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-*

Diff for: .github/workflows/build_wheels_windows.yml

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ on:
44
pull_request:
55
branches:
66
- master
7+
paths-ignore:
8+
- '.github/workflows/build_wheels_linux*'
9+
- '.github/workflows/build_wheels_macos*'
710
release:
811
types: [published, edited]
912

Diff for: pyproject.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
22
requires = [
33
"setuptools", "wheel", "scikit-build", "cmake", "pip",
4-
"numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'",
4+
"numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
55
"numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'",
6-
"numpy==1.20.1; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'aarch64'",
7-
"numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'",
8-
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'",
9-
"numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'"
6+
"numpy==1.21.0; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'arm64'",
7+
"numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
8+
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64' and platform_machine != 'arm64'",
9+
"numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64' and platform_machine != 'arm64'"
1010
]

Diff for: setup.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ def main():
3636
minimum_supported_numpy = "1.19.3"
3737

3838
# macos arm64 is a special case
39-
if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64":
40-
minimum_supported_numpy = "1.20.1"
39+
if sys.platform == "darwin" and sys.version_info[:2] >= (3, 6) and platform.machine() == "arm64":
40+
minimum_supported_numpy = "1.21.0"
4141

4242
numpy_version = "numpy>=%s" % minimum_supported_numpy
4343

0 commit comments

Comments
 (0)