diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_linux.yml index 3176df1a..3731389f 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_linux.yml @@ -13,8 +13,6 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] - schedule: - - cron: '0 3 * * 6' workflow_dispatch: @@ -27,10 +25,10 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7'] + python-version: ['3.9'] platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] + with_contrib: [1] # [0, 1] + without_gui: [1] # [0, 1] build_sdist: [0] env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true @@ -41,7 +39,7 @@ jobs: MB_ML_VER: 2014 TRAVIS_BUILD_DIR: ${{ github.workspace }} CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 + DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20240524 USE_CCACHE: 0 UNICODE_WIDTH: 32 PLAT: x86_64 @@ -64,16 +62,23 @@ jobs: fetch-depth: 0 - name: Build a package run: source scripts/build.sh + - name: Log cmake stuff + continue-on-error: true + if: ${{ failure() }} + uses: actions/upload-artifact@v3 + with: + name: CMake build dir + path: /io/_skbuild/linux-x86_64-3.7 - name: Saving all wheels uses: actions/upload-artifact@v3 with: name: wheels - path: wheelhouse/opencv*.whl + path: wheelhouse/*.whl - name: Saving a wheel accordingly to matrix uses: actions/upload-artifact@v3 with: name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} - path: wheelhouse/opencv*.whl + path: wheelhouse/*.whl Test: needs: [Build] @@ -84,10 +89,10 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python-version: ['3.10', '3.11'] platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] + with_contrib: [1] # [0, 1] + without_gui: [1] # [0, 1] build_sdist: [0] env: ACTIONS_ALLOW_UNSECURE_COMMANDS: true @@ -106,7 +111,7 @@ jobs: submodules: true fetch-depth: 0 - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ 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 + run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ 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 - name: Download a wheel accordingly to matrix uses: actions/download-artifact@v3 with: @@ -115,73 +120,6 @@ jobs: - name: Package installation and run tests run: source scripts/install.sh - Build_sdist: - runs-on: ubuntu-20.04 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - python-version: [3.8] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [1] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - PROJECT_SPEC: opencv-python - PLAT: x86_64 - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - MB_ML_VER: 2014 - NP_TEST_DEP: numpy==1.19.4 - TRAVIS_BUILD_DIR: ${{ github.workspace }} - CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-x86-64:20230628 - USE_CCACHE: 1 - UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0 }} - ENABLE_HEADLESS: ${{ matrix.without_gui || 0 }} - ENABLE_CONTRIB: ${{ matrix.with_contrib || 0 }} - steps: - - name: Cleanup - run: find . -mindepth 1 -delete - working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV - fi - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - architecture: ${{ matrix.platform }} - - name: Build a package - run: | - set -e - # Build and package - set -x - python -m pip install --upgrade pip - python -m pip install scikit-build - python setup.py sdist --formats=gztar - set +x - # Install and run tests - set -x - echo "skipping tests because of sdist" - - name: saving artifacts - uses: actions/upload-artifact@v3 - with: - name: wheels - path: dist/opencv*.tar.gz - Release_rolling: if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} needs: [Build, Test] @@ -198,23 +136,23 @@ jobs: - name: Upload wheels for opencv_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_python_rolling-* wheelhouse/*-python-rolling-* - name: Upload wheels for opencv_contrib_python_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_contrib_python_rolling-* wheelhouse/*-contrib-python-rolling-* - name: Upload wheels for opencv_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_python_headless_rolling-* wheelhouse/*-python-headless-rolling-* - name: Upload wheels for opencv_contrib_python_headless_rolling run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_contrib_python_headless_rolling-* wheelhouse/*-contrib-python-headless-rolling-* Pre-release: if: github.event_name == 'release' && github.event.release.prerelease - needs: [Build, Build_sdist, Test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: test-opencv-python-release defaults: @@ -228,11 +166,11 @@ jobs: - 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_* wheelhouse/opencv-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*-* Release: if: github.event_name == 'release' && !github.event.release.prerelease - needs: [Build, Build_sdist, Test] + needs: [Build, Test] runs-on: ubuntu-20.04 environment: opencv-python-release defaults: @@ -243,19 +181,19 @@ jobs: with: name: wheels path: wheelhouse/ - - name: Upload wheels for opencv_python + - name: Upload wheels for st-opencv_python run: | python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* wheelhouse/opencv-python-[^h]* - - name: Upload wheels for opencv_contrib_python + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_python-* wheelhouse/*-python-[^h]* + - name: Upload wheels for st-opencv_contrib_python run: | python -m pip install twine - 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]* - - name: Upload wheels for opencv_python_headless + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_contrib_python-* wheelhouse/*-contrib-python-[^h]* + - name: Upload wheels for st-opencv_python_headless run: | python -m pip install twine - 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-* - - name: Upload wheels for opencv_contrib_python_headless + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_python_headless-* wheelhouse/*-python-headless-* + - name: Upload wheels for st-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-* wheelhouse/opencv-contrib-python-headless-* + python -m twine upload --repository ${{ secrets.PIPY_REP_URL }} -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/*_contrib_python_headless-* st-wheelhouse/*-contrib-python-headless-* diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml index 5a9de23f..9fc1a119 100644 --- a/.github/workflows/build_wheels_linux_arm.yml +++ b/.github/workflows/build_wheels_linux_arm.yml @@ -13,8 +13,6 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] - schedule: - - cron: '0 3 * * 6' workflow_dispatch: diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 1defd1e5..50e8c71d 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -13,8 +13,6 @@ on: - '.github/workflows/build_wheels_macos_m1.yml' release: types: [published, edited] - schedule: - - cron: '0 3 * * 6' workflow_dispatch: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 2aed7d4b..57b476e4 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -13,8 +13,6 @@ on: - '.github/workflows/build_wheels_macos.yml' release: types: [published, edited] - schedule: - - cron: '0 3 * * 6' workflow_dispatch: diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index b1a98d26..669b9df7 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -12,8 +12,6 @@ on: - '.github/workflows/build_wheels_macos*' release: types: [published, edited] - schedule: - - cron: '0 3 * * 6' workflow_dispatch: diff --git a/.gitignore b/.gitignore index 15079e07..de0e69a1 100644 --- a/.gitignore +++ b/.gitignore @@ -23,6 +23,7 @@ var/ *.egg-info/ .installed.cfg *.egg +*.whl # PyInstaller # Usually these files are written by a python script from a template diff --git a/.gitmodules b/.gitmodules index 7193d3b9..c7e9f1d8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -3,7 +3,8 @@ url = https://github.com/opencv/opencv.git [submodule "opencv_contrib"] path = opencv_contrib - url = https://github.com/opencv/opencv_contrib.git + url = https://github.com/scantrust/opencv_contrib.git + branch = feature/add-scantust-qr-reader [submodule "multibuild"] path = multibuild url = https://github.com/multi-build/multibuild.git diff --git a/find_version.py b/find_version.py index 13e8003c..4106ddc8 100644 --- a/find_version.py +++ b/find_version.py @@ -32,7 +32,7 @@ git_hash = ( subprocess.check_output(["git", "rev-parse", "--short", "HEAD"]) .splitlines()[0] - .decode() + .decode()[:6] ) # this outputs the annotated tag if we are exactly on a tag, otherwise --g try: diff --git a/opencv_contrib b/opencv_contrib index f10c84d4..0cebb7af 160000 --- a/opencv_contrib +++ b/opencv_contrib @@ -1 +1 @@ -Subproject commit f10c84d48b0714f2b408c9e5cccfac1277c8e6cc +Subproject commit 0cebb7af8763ed13b8fa6cc205c7a65dca386b0d diff --git a/setup.py b/setup.py index f6056969..8b7639d6 100644 --- a/setup.py +++ b/setup.py @@ -81,16 +81,16 @@ def main(): # https://stackoverflow.com/questions/1405913/python-32bit-or-64bit-mode is64 = sys.maxsize > 2 ** 32 - package_name = "opencv-python" + package_name = "st-opencv-python" if build_contrib and not build_headless: - package_name = "opencv-contrib-python" + package_name = "st-opencv-contrib-python" if build_contrib and build_headless: - package_name = "opencv-contrib-python-headless" + package_name = "st-opencv-contrib-python-headless" if build_headless and not build_contrib: - package_name = "opencv-python-headless" + package_name = "st-opencv-python-headless" if build_rolling: package_name += "-rolling"