"Fossies" - the Fresh Open Source Software Archive

Member "scikit-image-0.19.3/.github/workflows/wheel_tests_and_release.yml" (12 Jun 2022, 12489 Bytes) of package /linux/misc/scikit-image-0.19.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "wheel_tests_and_release.yml": 0.19.2_vs_0.19.3.

    1 name: Build Wheels and Release
    2 on:
    3   push:
    4     tags:
    5       - 'v*'
    6       - 'buildwheels*'
    7 env:
    8   CIBW_BUILD_VERBOSITY: 2
    9   CIBW_TEST_REQUIRES: "-r requirements/test.txt"
   10   CIBW_TEST_COMMAND: pytest --pyargs skimage
   11   CIBW_ENVIRONMENT: PIP_PREFER_BINARY=1
   12 
   13 
   14 jobs:
   15   build_linux_37_and_above_wheels:
   16     name: Build python ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
   17     runs-on: ${{ matrix.os }}
   18     strategy:
   19       fail-fast: false
   20       matrix:
   21         os: [ubuntu-18.04]
   22         cibw_python: [ "cp38-*", "cp39-*"]
   23         cibw_manylinux: [ manylinux2014 ]
   24         cibw_arch: [ "x86_64", "i686" ]
   25         include:
   26           - os: ubuntu-18.04
   27             cibw_python: "cp37-*"
   28             cibw_manylinux: manylinux2010
   29             cibw_arch: x86_64
   30           - os: ubuntu-18.04
   31             cibw_python: "cp37-*"
   32             cibw_manylinux: manylinux2010
   33             cibw_arch: i686
   34           - os: ubuntu-18.04
   35             cibw_python: "cp310-*"
   36             cibw_manylinux: manylinux2014
   37             cibw_arch: x86_64
   38             # exclude i686 on Python 3.10 (No NumPy or SciPy wheels available)
   39     steps:
   40       - uses: actions/checkout@v2
   41         with:
   42           fetch-depth: 0
   43       - uses: actions/setup-python@v2
   44         name: Install Python
   45         with:
   46           python-version: '3.7'
   47       - name: Install cibuildwheel
   48         run: |
   49           python -m pip install cibuildwheel
   50       - name: Build the wheel
   51         run: |
   52           python -m cibuildwheel --output-dir dist
   53         env:
   54           CIBW_BUILD: ${{ matrix.cibw_python }}
   55           CIBW_ARCHS_LINUX: ${{ matrix.cibw_arch }}
   56           CIBW_SKIP: "*-musllinux_*"
   57           CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw_manylinux }}
   58           CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw_manylinux }}
   59           CIBW_ENVIRONMENT_PASS_LINUX: SKIMAGE_LINK_FLAGS
   60           SKIMAGE_LINK_FLAGS: "-Wl,--strip-debug"
   61       - uses: actions/upload-artifact@v2
   62         with:
   63           name: wheels
   64           path: ./dist/*.whl
   65 
   66   build_linux_aarch64_wheels:
   67     name: Build python ${{ matrix.cibw_python }} aarch64 wheels on ${{ matrix.os }}
   68     runs-on: ${{ matrix.os }}
   69     strategy:
   70       fail-fast: false
   71       matrix:
   72         os: [ubuntu-18.04]
   73         cibw_python: [ "cp37-*", "cp38-*" , "cp39-*" , "cp310-*" ]
   74         cibw_manylinux: [ manylinux2014 ]
   75     steps:
   76       - uses: actions/checkout@v2
   77         with:
   78           fetch-depth: 0
   79       - uses: actions/setup-python@v2
   80         name: Install Python
   81         with:
   82           python-version: '3.7'
   83       - name: Set up QEMU
   84         uses: docker/setup-qemu-action@v1
   85         with:
   86           platforms: arm64
   87       - name: Install cibuildwheel
   88         run: |
   89           python -m pip install cibuildwheel
   90       - name: Build the wheel
   91         run: |
   92           python -m cibuildwheel --output-dir dist
   93         env:
   94           CIBW_BUILD: ${{ matrix.cibw_python }}
   95           CIBW_SKIP: "*-musllinux_*"
   96           # skip aarch64 tests which often exceed the 6 hour time limit
   97           CIBW_TEST_SKIP: "*_aarch64"
   98           CIBW_ARCHS_LINUX: aarch64
   99           CIBW_MANYLINUX_X86_64_IMAGE: ${{ matrix.cibw_manylinux }}
  100           CIBW_MANYLINUX_I686_IMAGE: ${{ matrix.cibw_manylinux }}
  101           CIBW_ENVIRONMENT_PASS_LINUX: SKIMAGE_LINK_FLAGS
  102           SKIMAGE_LINK_FLAGS: "-Wl,--strip-debug"
  103       - uses: actions/upload-artifact@v2
  104         with:
  105           name: wheels
  106           path: ./dist/*.whl
  107 
  108   build_macos_wheels:
  109     name: Build python ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
  110     runs-on: ${{ matrix.os }}
  111     strategy:
  112       fail-fast: false
  113       matrix:
  114         os: [macos-latest]
  115         cibw_python: [ "cp37-*", "cp38-*", "cp39-*", "cp310-*" ]
  116         # TODO: add "universal2" once a universal2 libomp is available
  117         cibw_arch: [ "x86_64", "arm64"]
  118         exclude:
  119           - os: macos-latest
  120             cibw_python: "cp37-*"
  121             cibw_arch: arm64
  122         #   - os: macos-latest
  123         #     cibw_python: "cp37-*"
  124         #     cibw_arch: universal2
  125 
  126     steps:
  127       - uses: actions/checkout@v2
  128         with:
  129           fetch-depth: 0
  130 
  131       - uses: actions/setup-python@v2
  132         name: Install Python
  133         with:
  134           python-version: '3.9'
  135 
  136       - name: Install cibuildwheel
  137         run: |
  138           python -m pip install cibuildwheel
  139 
  140       - name: Build wheels for CPython Mac OS
  141         run: |
  142           # Make sure to use a libomp version binary compatible with the oldest
  143           # supported version of the macos SDK as libomp will be vendored into
  144           # the scikit-image wheels for macos. The list of binaries are in
  145           # https://packages.macports.org/libomp/.  Currently, the oldest
  146           # supported macos version is: High Sierra / 10.13. When upgrading
  147           # this, be sure to update the MACOSX_DEPLOYMENT_TARGET environment
  148           # variable accordingly. Note that Darwin_17 == High Sierra / 10.13.
  149           if [[ "$CIBW_ARCHS_MACOS" == arm64 ]]; then
  150               # SciPy requires 12.0 on arm to prevent kernel panics
  151               # https://github.com/scipy/scipy/issues/14688
  152               # so being conservative, we just do the same here
  153               export MACOSX_DEPLOYMENT_TARGET=12.0
  154               OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-arm64/llvm-openmp-11.1.0-hf3c4609_1.tar.bz2"
  155           else
  156               export MACOSX_DEPLOYMENT_TARGET=10.13
  157               OPENMP_URL="https://anaconda.org/conda-forge/llvm-openmp/11.1.0/download/osx-64/llvm-openmp-11.1.0-hda6cdc1_1.tar.bz2"
  158           fi
  159           echo MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET}
  160 
  161           # use conda to install llvm-openmp
  162           # Note that we do NOT activate the conda environment, we just add the
  163           # library install path to CFLAGS/CXXFLAGS/LDFLAGS below.
  164           sudo conda create -n build $OPENMP_URL
  165           PREFIX="/usr/local/miniconda/envs/build"
  166           export CC=/usr/bin/clang
  167           export CXX=/usr/bin/clang++
  168           export CPPFLAGS="$CPPFLAGS -Xpreprocessor -fopenmp"
  169           export CFLAGS="$CFLAGS -Wno-implicit-function-declaration -I$PREFIX/include"
  170           export CXXFLAGS="$CXXFLAGS -I$PREFIX/include"
  171           export LDFLAGS="$LDFLAGS -Wl,-S -Wl,-rpath,$PREFIX/lib -L$PREFIX/lib -lomp"
  172 
  173           python -m cibuildwheel --output-dir dist
  174         env:
  175           CIBW_BUILD: ${{ matrix.cibw_python }}
  176           CIBW_ARCHS_MACOS: ${{ matrix.cibw_arch }}
  177           CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
  178           CIBW_MANYLINUX_I686_IMAGE: manylinux1
  179           CIBW_TEST_SKIP: "*-macosx_arm64"
  180 
  181       - uses: actions/upload-artifact@v2
  182         with:
  183           name: wheels
  184           path: ./dist/*.whl
  185 
  186   build_windows_wheels:
  187     name: Build ${{ matrix.cibw_python }} ${{ matrix.cibw_arch }} wheels on ${{ matrix.os }}
  188     runs-on: ${{ matrix.os }}
  189     strategy:
  190       fail-fast: false
  191       matrix:
  192         os: [windows-latest]
  193         cibw_arch: ["AMD64", "x86"]
  194         cibw_python: ["cp37-*", "cp38-*", "cp39-*", "cp310-*"]
  195         exclude:
  196           - os: windows-latest
  197             cibw_python: "cp310-*"
  198             cibw_arch: x86
  199 
  200     steps:
  201       - uses: actions/checkout@v2
  202         with:
  203           fetch-depth: 0
  204 
  205       - uses: actions/setup-python@v2
  206         name: Install Python
  207         with:
  208           python-version: '3.7'
  209 
  210       # install choco package manager
  211       - uses: crazy-max/ghaction-chocolatey@v1
  212         name: Install chocolatey
  213         with:
  214           args: -h
  215 
  216       # install x86 clang-cl (needed for Pythran)
  217       - name: Install x86 clang-cl
  218         if: matrix.cibw_arch == 'x86'
  219         run: |
  220           choco install --force --x86 llvm
  221 
  222       - name: Install x64 clang-cl
  223         if: matrix.cibw_arch == 'AMD64'
  224         run: |
  225           choco install --force llvm
  226 
  227       - name: Install cibuildwheel and add clang-cl to path
  228         run: |
  229           python -m pip install cibuildwheel
  230           SET PATH="C:\\Program Files\\LLVM\\bin;%PATH%"
  231           SET PATH="C:\\Program Files (x86)\\LLVM\\bin;%PATH%"
  232 
  233       - name: Build x86 Windows wheels for CPython
  234         if: matrix.cibw_arch == 'x86'
  235         # To avoid "LINK : fatal error LNK1158: cannot run 'rc.exe'"
  236         # we explicitly add rc.exe to path using the method from:
  237         # https://github.com/actions/virtual-environments/issues/294#issuecomment-588090582
  238         # with additional -arch=x86 flag to vsdevcmd.bat
  239         run: |
  240           function Invoke-VSDevEnvironment {
  241             $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
  242               $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
  243               $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
  244             & "${env:COMSPEC}" /s /c "`"$Command`" -arch=x86 -no_logo && set" | Foreach-Object {
  245                   if ($_ -match '^([^=]+)=(.*)') {
  246                       [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
  247                   }
  248               }
  249           }
  250           Invoke-VSDevEnvironment
  251           Get-Command rc.exe | Format-Table -AutoSize
  252           python -m cibuildwheel --output-dir dist
  253         env:
  254           CIBW_BUILD: ${{ matrix.cibw_python }}
  255           CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_arch }}
  256           # -Wl,-S equivalent to gcc's -Wl,--strip-debug
  257           LDFLAGS: "-Wl,-S"
  258 
  259       - name: Build x64 Windows wheels for CPython
  260         if: matrix.cibw_arch == 'AMD64'
  261         # To avoid "LINK : fatal error LNK1158: cannot run 'rc.exe'"
  262         # we explicitly add rc.exe to path using the method from:
  263         # https://github.com/actions/virtual-environments/issues/294#issuecomment-588090582
  264         # with additional -arch=x86 flag to vsdevcmd.bat
  265         run: |
  266           function Invoke-VSDevEnvironment {
  267             $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
  268               $installationPath = & $vswhere -prerelease -legacy -latest -property installationPath
  269               $Command = Join-Path $installationPath "Common7\Tools\vsdevcmd.bat"
  270             & "${env:COMSPEC}" /s /c "`"$Command`" -arch=amd64 -no_logo && set" | Foreach-Object {
  271                   if ($_ -match '^([^=]+)=(.*)') {
  272                       [System.Environment]::SetEnvironmentVariable($matches[1], $matches[2])
  273                   }
  274               }
  275           }
  276           Invoke-VSDevEnvironment
  277           Get-Command rc.exe | Format-Table -AutoSize
  278           python -m cibuildwheel --output-dir dist
  279         env:
  280           CIBW_BUILD: ${{ matrix.cibw_python }}
  281           CIBW_ARCHS_WINDOWS: ${{ matrix.cibw_arch }}
  282           # -Wl,-S equivalent to gcc's -Wl,--strip-debug
  283           LDFLAGS: "-Wl,-S"
  284 
  285       - uses: actions/upload-artifact@v2
  286         with:
  287           name: wheels
  288           path: ./dist/*.whl
  289 
  290   deploy:
  291     name: Release
  292     needs: [build_linux_37_and_above_wheels, build_linux_aarch64_wheels, build_macos_wheels, build_windows_wheels]
  293     if: github.repository_owner == 'scikit-image' && startsWith(github.ref, 'refs/tags/v') && always()
  294     runs-on: ubuntu-latest
  295     steps:
  296       - uses: actions/checkout@v2
  297         with:
  298           fetch-depth: 0
  299       - uses: actions/setup-python@v2
  300         name: Install Python
  301         with:
  302           python-version: '3.9'
  303 
  304       - name: Install Twine
  305         run: |
  306           python -m pip install --upgrade pip
  307           pip install -r requirements/build.txt
  308           pip install twine
  309 
  310       - uses: actions/download-artifact@v2
  311         id: download
  312         with:
  313           name: wheels
  314           path: ./dist
  315     
  316       - name: Publish the source distribution on PyPI
  317         run: |
  318           SK_VERSION=$(git describe --tags)
  319           python setup.py sdist
  320           ls -la ${{ github.workspace }}/dist
  321           # We prefer to release wheels before source because otherwise there is a
  322           # small window during which users who pip install scikit-image will require compilation.
  323           twine upload ${{ github.workspace }}/dist/*.whl
  324           twine upload ${{ github.workspace }}/dist/scikit-image-${SK_VERSION:1}.tar.gz
  325         env:
  326           TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
  327           TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
  328               
  329       - name: Github release
  330         uses: softprops/action-gh-release@v1
  331         env:
  332           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  333           GITHUB_REPOSITORY: ${{ github.repository }}