Skip to content

Commit 1d48816

Browse files
committed
Merge remote-tracking branch 'origin/4.x' into official-publish-action
2 parents 0fd2a7a + 4ddfc01 commit 1d48816

16 files changed

+172
-121
lines changed

.github/workflows/build_wheels_macos.yml

Lines changed: 33 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@ on:
1818

1919
jobs:
2020
Build:
21-
runs-on: macos-13
22-
defaults:
23-
run:
24-
shell: bash
21+
runs-on: python-macos-intel
2522
strategy:
2623
fail-fast: false
2724
matrix:
@@ -31,6 +28,7 @@ jobs:
3128
without_gui: [0, 1]
3229
build_sdist: [0]
3330
env:
31+
CI_BUILD: 1
3432
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
3533
REPO_DIR: .
3634
PROJECT_SPEC: opencv-python
@@ -46,6 +44,7 @@ jobs:
4644
SDIST: ${{ matrix.build_sdist || 0 }}
4745
ENABLE_HEADLESS: ${{ matrix.without_gui }}
4846
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
47+
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
4948
steps:
5049
- name: Cleanup
5150
run: find . -mindepth 1 -delete
@@ -55,34 +54,20 @@ jobs:
5554
if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then
5655
echo "ENABLE_ROLLING=1" >> $GITHUB_ENV
5756
fi
58-
# hack for image issue on mac: https://github.com/actions/runner-images/issues/6817
59-
rm /usr/local/bin/2to3*
60-
rm /usr/local/bin/idle3*
61-
rm /usr/local/bin/pydoc3*
62-
rm /usr/local/bin/python3*
63-
# end hack
6457
- name: Checkout
6558
uses: actions/checkout@v3
6659
with:
6760
submodules: false
6861
fetch-depth: 0
6962
- name: Build a package
7063
run: |
71-
set -e
72-
# Check out and prepare the source
73-
# Multibuild doesn't have releases, so --depth would break eventually (see
74-
# https://superuser.com/questions/1240216/server-does-not-allow-request-for-unadvertised)
7564
git submodule update --init multibuild
76-
source multibuild/common_utils.sh
77-
# https://github.com/matthew-brett/multibuild/issues/116
78-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export ARCH_FLAGS=" "; fi
79-
source multibuild/travis_steps.sh
80-
# This sets -x
81-
# source travis_multibuild_customize.sh
8265
echo $ENABLE_CONTRIB > contrib.enabled
8366
echo $ENABLE_HEADLESS > headless.enabled
84-
set -x
85-
build_wheel $REPO_DIR $PLAT
67+
export MACOSX_DEPLOYMENT_TARGET=14.0
68+
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
69+
python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
70+
delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
8671
- name: Saving a wheel accordingly to matrix
8772
uses: actions/upload-artifact@v4
8873
with:
@@ -91,14 +76,11 @@ jobs:
9176

9277
Test:
9378
needs: [Build]
94-
runs-on: macos-13
95-
defaults:
96-
run:
97-
shell: bash
79+
runs-on: python-macos-intel
9880
strategy:
9981
fail-fast: false
10082
matrix:
101-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
83+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
10284
platform: [x64]
10385
with_contrib: [0, 1]
10486
without_gui: [0, 1]
@@ -112,6 +94,7 @@ jobs:
11294
PLAT: x86_64
11395
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}/opencv_extra/testdata
11496
PYLINT_TEST_FILE: ${{ github.workspace }}/opencv/samples/python/squares.py
97+
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
11598
steps:
11699
- name: Cleanup
117100
run: find . -mindepth 1 -delete
@@ -121,32 +104,33 @@ jobs:
121104
with:
122105
submodules: true
123106
fetch-depth: 0
124-
- name: Set up Python ${{ matrix.python-version }}
125-
uses: actions/setup-python@v4
126-
with:
127-
python-version: ${{ matrix.python-version }}
128-
architecture: ${{ matrix.platform }}
129-
- name: Setup Environment variables
130-
run: if ["3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
131107
- name: Download a wheel accordingly to matrix
132108
uses: actions/download-artifact@v4
133109
with:
134110
name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }}
135111
path: wheelhouse/
112+
- name: Create Venv for test
113+
run: |
114+
test -d "${{ github.workspace }}/opencv_test" && rm -rf "${{ github.workspace }}/opencv_test"
115+
python${{ matrix.python-version }} -m venv ${{ github.workspace }}/opencv_test
136116
- name: Package installation
137117
run: |
138-
python -m pip install wheelhouse/opencv*.whl
118+
source ${{ github.workspace }}/opencv_test/bin/activate
119+
python${{ matrix.python-version }} -m pip install --upgrade pip
120+
python${{ matrix.python-version }} -m pip install --no-cache --force-reinstall wheelhouse/opencv*.whl
139121
cd ${{ github.workspace }}/tests
140-
python get_build_info.py
122+
python${{ matrix.python-version }} get_build_info.py
141123
- name: Run tests
142124
run: |
125+
source ${{ github.workspace }}/opencv_test/bin/activate
143126
cd ${{ github.workspace }}/opencv
144-
python modules/python/test/test.py -v --repo .
127+
python${{ matrix.python-version }} modules/python/test/test.py -v --repo .
145128
- name: Pylint test
146129
run: |
147-
python -m pip install pylint==2.15.9
130+
source ${{ github.workspace }}/opencv_test/bin/activate
131+
python${{ matrix.python-version }} -m pip install pylint==2.15.9
148132
cd ${{ github.workspace }}/tests
149-
python -m pylint $PYLINT_TEST_FILE
133+
python${{ matrix.python-version }} -m pylint $PYLINT_TEST_FILE
150134
151135
Release_rolling:
152136
if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
@@ -167,10 +151,10 @@ jobs:
167151
- name: Select only OpenCV wheels
168152
run: |
169153
mkdir dist dist-contrib dist-headless dist-contrib-headless
170-
cp wheelhouse/opencv_python_rolling-* dist/
171-
cp wheelhouse/opencv_contrib_python_rolling-* dist-contrib/
172-
cp wheelhouse/opencv_python_headless_rolling-* dist-headless/
173-
cp wheelhouse/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
154+
cp wheelhouse/wheel-*/opencv_python_rolling-* dist/
155+
cp wheelhouse/wheel-*/opencv_contrib_python_rolling-* dist-contrib/
156+
cp wheelhouse/wheel-*/opencv_python_headless_rolling-* dist-headless/
157+
cp wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
174158
- name: Upload wheels for opencv_python_rolling
175159
uses: pypa/gh-action-pypi-publish@release/v1
176160
with:
@@ -210,12 +194,12 @@ jobs:
210194
steps:
211195
- uses: actions/download-artifact@v4
212196
with:
213-
name: wheels
214197
path: wheelhouse/
215198
- name: Select only OpenCV wheels
216199
run: |
200+
tree
217201
mkdir dist
218-
cp wheelhouse/opencv_* dist/
202+
cp wheelhouse/wheel-*/opencv_* dist/
219203
- name: Upload all wheels
220204
uses: pypa/gh-action-pypi-publish@release/v1
221205
with:
@@ -239,15 +223,14 @@ jobs:
239223
steps:
240224
- uses: actions/download-artifact@v4
241225
with:
242-
name: wheels
243226
path: wheelhouse/
244227
- name: Select only OpenCV wheels
245228
run: |
246229
mkdir dist dist-contrib dist-headless dist-contrib-headless
247-
cp wheelhouse/opencv_python-* dist/
248-
cp wheelhouse/opencv_contrib_python-* dist-contrib/
249-
cp wheelhouse/opencv_python_headless-* dist-headless/
250-
cp wheelhouse/opencv_contrib_python_headless-* dist-contrib-headless/
230+
cp wheelhouse/wheel-*/opencv_python-* dist/
231+
cp wheelhouse/wheel-*/opencv_contrib_python-* dist-contrib/
232+
cp wheelhouse/wheel-*/opencv_python_headless-* dist-headless/
233+
cp wheelhouse/wheel-*/opencv_contrib_python_headless-* dist-contrib-headless/
251234
- name: Upload wheels for opencv_python
252235
uses: pypa/gh-action-pypi-publish@release/v1
253236
with:

.github/workflows/build_wheels_macos_m1.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
strategy:
6969
fail-fast: false
7070
matrix:
71-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
71+
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13', '3.14']
7272
platform: [x64]
7373
with_contrib: [0, 1]
7474
without_gui: [0, 1]
@@ -133,10 +133,10 @@ jobs:
133133
- name: Select only OpenCV wheels
134134
run: |
135135
mkdir dist dist-contrib dist-headless dist-contrib-headless
136-
cp wheelhouse/opencv_python_rolling-* dist/
137-
cp wheelhouse/opencv_contrib_python_rolling-* dist-contrib/
138-
cp wheelhouse/opencv_python_headless_rolling-* dist-headless/
139-
cp wheelhouse/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
136+
cp wheelhouse/wheel-*/opencv_python_rolling-* dist/
137+
cp wheelhouse/wheel-*/opencv_contrib_python_rolling-* dist-contrib/
138+
cp wheelhouse/wheel-*/opencv_python_headless_rolling-* dist-headless/
139+
cp wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
140140
- name: Upload wheels for opencv_python_rolling
141141
uses: pypa/gh-action-pypi-publish@release/v1
142142
with:
@@ -176,12 +176,12 @@ jobs:
176176
steps:
177177
- uses: actions/download-artifact@v4
178178
with:
179-
name: wheels
180179
path: wheelhouse/
181180
- name: Select only OpenCV wheels
182181
run: |
182+
tree
183183
mkdir dist
184-
cp wheelhouse/opencv_* dist/
184+
cp wheelhouse/wheel-*/opencv_* dist/
185185
- name: Upload all wheels
186186
uses: pypa/gh-action-pypi-publish@release/v1
187187
with:
@@ -205,15 +205,14 @@ jobs:
205205
steps:
206206
- uses: actions/download-artifact@v4
207207
with:
208-
name: wheels
209208
path: wheelhouse/
210209
- name: Select only OpenCV wheels
211210
run: |
212211
mkdir dist dist-contrib dist-headless dist-contrib-headless
213-
cp wheelhouse/opencv_python-* dist/
214-
cp wheelhouse/opencv_contrib_python-* dist-contrib/
215-
cp wheelhouse/opencv_python_headless-* dist-headless/
216-
cp wheelhouse/opencv_contrib_python_headless-* dist-contrib-headless/
212+
cp wheelhouse/wheel-*/opencv_python-* dist/
213+
cp wheelhouse/wheel-*/opencv_contrib_python-* dist-contrib/
214+
cp wheelhouse/wheel-*/opencv_python_headless-* dist-headless/
215+
cp wheelhouse/wheel-*/opencv_contrib_python_headless-* dist-contrib-headless/
217216
- name: Upload wheels for opencv_python
218217
uses: pypa/gh-action-pypi-publish@release/v1
219218
with:

.github/workflows/build_wheels_manylinux.yml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ jobs:
2323
shell: bash
2424
strategy:
2525
fail-fast: false
26-
matrix:
27-
python-version: ['3.9']
28-
platform: [x86_64, aarch64]
29-
manylinux: [2014, 2_28]
30-
with_contrib: [0, 1]
31-
without_gui: [0, 1]
26+
matrix:
27+
python-version: ['3.9']
28+
platform: [x86_64, aarch64]
29+
manylinux: [2014, 2_28]
30+
with_contrib: [0, 1]
31+
without_gui: [0, 1]
3232
build_sdist: [0]
3333
include:
3434
- platform: aarch64
3535
manylinux: 2014
36-
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20250630
36+
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20260102
3737
- platform: x86_64
3838
manylinux: 2014
39-
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630
39+
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260102
4040
- platform: x86_64
4141
manylinux: 2_28
42-
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64:20251013
42+
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-x86-64:20260102
4343
- platform: aarch64
4444
manylinux: 2_28
45-
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64:20251013
45+
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux_2_28-aarch64:20260102
4646

4747
env:
4848
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
@@ -60,7 +60,7 @@ jobs:
6060
SDIST: ${{ matrix.build_sdist || 0 }}
6161
ENABLE_HEADLESS: ${{ matrix.without_gui }}
6262
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
63-
63+
6464
steps:
6565
- name: Cleanup
6666
run: find . -mindepth 1 -delete
@@ -94,20 +94,20 @@ jobs:
9494
fail-fast: false
9595
matrix:
9696
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13']
97-
platform: [x86_64, aarch64]
97+
platform: [x86_64, aarch64]
9898
manylinux: [2014, 2_28]
9999
with_contrib: [0, 1]
100100
without_gui: [0, 1]
101101
build_sdist: [0]
102-
102+
103103
env:
104104
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
105105
MB_PYTHON_VERSION: ${{ matrix.python-version }}
106106
NP_TEST_DEP: numpy==1.19.4
107107
NP_TEST_DEP_LATEST: numpy==2.2.6
108108
CONFIG_PATH: travis_config.sh
109109
PLAT: ${{ matrix.platform }}
110-
SDIST: ${{ matrix.build_sdist || 0 }}
110+
SDIST: ${{ matrix.build_sdist || 0 }}
111111
ENABLE_HEADLESS: ${{ matrix.without_gui }}
112112
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
113113
DOCKER_TEST_IMAGE: ${{ matrix.platform == 'aarch64' && 'quay.io/opencv-ci/multibuild-focal_arm64v8:2025-11-13' || '' }}
@@ -120,9 +120,9 @@ jobs:
120120
with:
121121
submodules: true
122122
fetch-depth: 0
123-
123+
124124
- name: Setup Environment variables
125-
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi
125+
run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" -o "3.14" == "${{ 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
126126
- name: Download a wheel accordingly to matrix
127127
uses: actions/download-artifact@v4
128128
with:
@@ -155,7 +155,7 @@ jobs:
155155
NP_TEST_DEP: numpy==1.19.4
156156
TRAVIS_BUILD_DIR: ${{ github.workspace }}
157157
CONFIG_PATH: travis_config.sh
158-
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20250630
158+
DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20260102
159159
USE_CCACHE: 1
160160
UNICODE_WIDTH: 32
161161
SDIST: ${{ matrix.build_sdist || 0 }}
@@ -262,6 +262,7 @@ jobs:
262262
path: wheelhouse/
263263
- name: Select only OpenCV wheels
264264
run: |
265+
tree
265266
mkdir dist
266267
cp wheelhouse/wheel-*/opencv_* wheelhouse/wheel-*/opencv-* dist/
267268
- name: Upload all wheels

.github/workflows/build_wheels_windows.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,10 @@ jobs:
151151
- name: Select only OpenCV wheels
152152
run: |
153153
mkdir dist dist-contrib dist-headless dist-contrib-headless
154-
cp wheelhouse/opencv_python_rolling-* dist/
155-
cp wheelhouse/opencv_contrib_python_rolling-* dist-contrib/
156-
cp wheelhouse/opencv_python_headless_rolling-* dist-headless/
157-
cp wheelhouse/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
154+
cp wheelhouse/wheel-*/opencv_python_rolling-* dist/
155+
cp wheelhouse/wheel-*/opencv_contrib_python_rolling-* dist-contrib/
156+
cp wheelhouse/wheel-*/opencv_python_headless_rolling-* dist-headless/
157+
cp wheelhouse/wheel-*/opencv_contrib_python_headless_rolling-* dist-contrib-headless/
158158
- name: Upload wheels for opencv_python_rolling
159159
uses: pypa/gh-action-pypi-publish@release/v1
160160
with:
@@ -198,7 +198,7 @@ jobs:
198198
- name: Select only OpenCV wheels
199199
run: |
200200
mkdir dist
201-
cp wheelhouse/opencv_* dist/
201+
cp wheelhouse/wheel-*/opencv_* dist/
202202
- name: Upload all wheels
203203
uses: pypa/gh-action-pypi-publish@release/v1
204204
with:
@@ -226,10 +226,10 @@ jobs:
226226
- name: Select only OpenCV wheels
227227
run: |
228228
mkdir dist dist-contrib dist-headless dist-contrib-headless
229-
cp wheelhouse/opencv_python-* dist/
230-
cp wheelhouse/opencv_contrib_python-* dist-contrib/
231-
cp wheelhouse/opencv_python_headless-* dist-headless/
232-
cp wheelhouse/opencv_contrib_python_headless-* dist-contrib-headless/
229+
cp wheelhouse/wheel-*/opencv_python-* dist/
230+
cp wheelhouse/wheel-*/opencv_contrib_python-* dist-contrib/
231+
cp wheelhouse/wheel-*/opencv_python_headless-* dist-headless/
232+
cp wheelhouse/wheel-*/opencv_contrib_python_headless-* dist-contrib-headless/
233233
- name: Upload wheels for opencv_python
234234
uses: pypa/gh-action-pypi-publish@release/v1
235235
with:

0 commit comments

Comments
 (0)