Skip to content

Update build process & sync master and 3.4 #480

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,27 @@ jobs:
name: wheels
path: dist/opencv*.tar.gz

test_release_opencv_python:
if: github.event_name == 'release' && github.event.release.prerelease
needs: [build, build-windows-x86_64, build_sdist]
runs-on: ubuntu-latest
environment: test-opencv-python-release
defaults:
run:
shell: bash
steps:
- uses: actions/download-artifact@v2
with:
name: wheels
path: wheelhouse/

- name: Upload all wheels
run: |
python -m pip install twine
python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_*

release_opencv_python:
if: startsWith(github.ref, 'refs/tags/v')
if: github.event_name == 'release' && !github.event.release.prerelease
needs: [build, build-windows-x86_64, build_sdist]
runs-on: ubuntu-latest
environment: opencv-python-release
Expand All @@ -257,6 +276,7 @@ jobs:
with:
name: wheels
path: wheelhouse/

- name: Upload wheels for opencv_python
run: |
python -m pip install twine
Expand All @@ -273,7 +293,6 @@ jobs:
python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-*

- name: Upload wheels for opencv_contrib_python_headless

run: |
python -m pip install twine
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-*
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ requires = [
"setuptools", "wheel", "scikit-build", "cmake", "pip",
"numpy==1.13.3; python_version=='3.6' and platform_machine != 'aarch64'",
"numpy==1.19.3; python_version>='3.6' and sys_platform == 'linux' and platform_machine == 'aarch64'",
"numpy==1.20.1; python_version>='3.6' and sys_platform == 'darwin' and platform_machine == 'aarch64'",
"numpy==1.14.5; python_version=='3.7' and platform_machine != 'aarch64'",
"numpy==1.17.3; python_version=='3.8' and platform_machine != 'aarch64'",
"numpy==1.19.3; python_version>='3.9' and platform_machine != 'aarch64'"
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ def main():
if sys.version_info[:2] >= (3, 9):
minimum_supported_numpy = "1.19.3"

# arm64 is a special case
if sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64":
# linux arm64 is a special case
if sys.platform.startswith("linux") and sys.version_info[:2] >= (3, 6) and platform.machine() == "aarch64":
minimum_supported_numpy = "1.19.3"

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

numpy_version = "numpy>=%s" % minimum_supported_numpy

python_version = cmaker.CMaker.get_python_version()
Expand Down