Skip to content

Commit

Permalink
Substitute python limited API version for current interpriter on Wind…
Browse files Browse the repository at this point in the history
…ows and Mac M1.
  • Loading branch information
asmorkalov committed Jun 17, 2024
1 parent 214f2cd commit 6d30be8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build_wheels_macos_m1.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ jobs:
SDIST: ${{ matrix.build_sdist || 0 }}
ENABLE_HEADLESS: ${{ matrix.without_gui }}
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
PYTHON_VERSION: ${{ matrix.python-version }}
MACOSX_DEPLOYMENT_TARGET: 11.0
PIP_INDEX_URL: https://pypi.tuna.tsinghua.edu.cn/simple
steps:
- name: Cleanup
Expand All @@ -52,9 +54,9 @@ jobs:
git submodule update --init multibuild
echo $ENABLE_CONTRIB > contrib.enabled
echo $ENABLE_HEADLESS > headless.enabled
export MACOSX_DEPLOYMENT_TARGET=11.0
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
python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api=cp37 --dist-dir=wheelhouse -v
export PYTHON_VERSION=${{ matrix.python-version }}
python${{ matrix.python-version }} setup.py bdist_wheel --py-limited-api="cp${PYTHON_VERSION//./}" --dist-dir=wheelhouse -v
delocate-wheel ${{ github.workspace }}/wheelhouse/opencv*
- name: Saving all wheels
uses: actions/upload-artifact@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/build_wheels_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
SDIST: ${{ matrix.build_sdist || 0 }}
ENABLE_HEADLESS: ${{ matrix.without_gui }}
ENABLE_CONTRIB: ${{ matrix.with_contrib }}
PYTHON_VERSION: ${{ matrix.python-version }}
OPENCV_TEST_DATA_PATH: ${{ github.workspace }}\opencv_extra\testdata
steps:
- name: Cleanup
Expand Down Expand Up @@ -65,7 +66,7 @@ jobs:
python -m pip install --upgrade setuptools
python -m pip install cmake==3.24.2
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=cp37 --dist-dir=%cd%\wheelhouse -v
set "CI_BUILD=1" && python setup.py bdist_wheel --py-limited-api=cp%PYTHON_VERSION:.=% --dist-dir=%cd%\wheelhouse -v
shell: cmd
- name: Saving all wheels
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 6d30be8

Please sign in to comment.