Skip to content

Commit 6d30be8

Browse files
committed
Substitute python limited API version for current interpriter on Windows and Mac M1.
1 parent 214f2cd commit 6d30be8

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.github/workflows/build_wheels_macos_m1.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ jobs:
3232
SDIST: ${{ matrix.build_sdist || 0 }}
3333
ENABLE_HEADLESS: ${{ matrix.without_gui }}
3434
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
35+
PYTHON_VERSION: ${{ matrix.python-version }}
36+
MACOSX_DEPLOYMENT_TARGET: 11.0
3537
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
3638
steps:
3739
- name: Cleanup
@@ -52,9 +54,9 @@ jobs:
5254
git submodule update --init multibuild
5355
echo $ENABLE_CONTRIB > contrib.enabled
5456
echo $ENABLE_HEADLESS > headless.enabled
55-
export MACOSX_DEPLOYMENT_TARGET=11.0
5657
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
57-
python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
58+
export PYTHON_VERSION=${{ matrix.python-version }}
59+
python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api="cp${PYTHON_VERSION//./}" --dist-dir=wheelhouse -v
5860
delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
5961
- name: Saving all wheels
6062
uses: actions/upload-artifact@v3

.github/workflows/build_wheels_windows.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ jobs:
3131
SDIST: ${{ matrix.build_sdist || 0 }}
3232
ENABLE_HEADLESS: ${{ matrix.without_gui }}
3333
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
34+
PYTHON_VERSION: ${{ matrix.python-version }}
3435
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
3536
steps:
3637
- name: Cleanup
@@ -65,7 +66,7 @@ jobs:
6566
python -m pip install --upgrade setuptools
6667
python -m pip install cmake==3.24.2
6768
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
68-
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=%cd%\wheelhouse -v
69+
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp%PYTHON_VERSION:.=% --dist-dir=%cd%\wheelhouse -v
6970
shell: cmd
7071
- name: Saving all wheels
7172
uses: actions/upload-artifact@v3

0 commit comments

Comments
 (0)