Bump mamba-org/setup-micromamba from 2 to 3 #567
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Wheels & sdist | |
| on: | |
| push: | |
| branches: [ main ] | |
| release: | |
| types: [ released, prereleased ] | |
| pull_request: # also build on PRs touching this file | |
| paths: | |
| - ".github/workflows/release.yaml" | |
| - "ci/proj-compile-wheels.sh" | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| PROJ_VERSION: "9.7.1" | |
| DEBIAN_FRONTEND: noninteractive | |
| jobs: | |
| make_sdist: | |
| name: Make sdist | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Conda | |
| uses: mamba-org/setup-micromamba@v3 | |
| with: | |
| init-shell: bash | |
| environment-name: sdist_env | |
| create-args: >- | |
| python-build | |
| twine>=1.12 | |
| cython | |
| proj=${{ env.PROJ_VERSION }} | |
| - name: Make sdist | |
| shell: bash | |
| run: | | |
| micromamba run -n sdist_env python -m build --sdist | |
| - name: Check packages | |
| shell: bash | |
| run: | | |
| micromamba run -n sdist_env twine check --strict dist/* | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: sdist | |
| path: ./dist/*.tar.gz | |
| retention-days: 5 | |
| build_wheels: | |
| name: Build ${{ matrix.arch }} wheels on ${{ matrix.os }} | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: ubuntu-22.04 | |
| arch: x86_64 | |
| - os: ubuntu-22.04-arm | |
| arch: aarch64 | |
| - os: macos-14 | |
| arch: arm64 | |
| cmake_osx_architectures: arm64 | |
| macos_deployment_target: "14.0" | |
| - os: macos-15-intel | |
| arch: x86_64 | |
| cmake_osx_architectures: x86_64 | |
| macos_deployment_target: "15.0" | |
| - os: "windows-2022" | |
| arch: "auto64" | |
| triplet: "x64-windows" | |
| vcpkg_cache: "c:\\vcpkg\\installed" | |
| vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log" | |
| - os: "windows-2022" | |
| arch: "auto32" | |
| triplet: "x86-windows" | |
| vcpkg_cache: "c:\\vcpkg\\installed" | |
| vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log" | |
| - os: "windows-11-arm" | |
| arch: "ARM64" | |
| triplet: "arm64-windows" | |
| vcpkg_cache: "c:\\vcpkg\\installed" | |
| vcpkg_logs: "c:\\vcpkg\\buildtrees\\**\\*.log" | |
| msvc_arch: ARM64 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| - name: Setup MSVC (32-bit) | |
| if: ${{ matrix.triplet == 'x86-windows' }} | |
| uses: bus1/cabuild/action/msdevshell@e22aba57d6e74891d059d66501b6b5aed8123c4d # v1 | |
| with: | |
| architecture: 'x86' | |
| - name: Activate MSVC | |
| uses: ilammy/[email protected] | |
| with: | |
| arch: ${{ matrix.msvc_arch }} | |
| if: ${{ matrix.msvc_arch }} | |
| - name: Cache vcpkg | |
| if: contains(matrix.os, 'windows') | |
| uses: actions/cache@v5 | |
| id: vcpkgcache | |
| with: | |
| path: | | |
| ${{ matrix.vcpkg_cache }} | |
| # bump the last digit to avoid using previous build cache | |
| key: ${{ matrix.os }}-${{ matrix.triplet }}-vcpkg-proj${{ env.PROJ_VERSION }}-cache0 | |
| - name: Install PROJ with vcpkg | |
| if: contains(matrix.os, 'windows') | |
| env: | |
| VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} | |
| shell: bash | |
| run: | | |
| # Workaround for vcpkg downloading issue: | |
| # https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 | |
| export SystemDrive="$SYSTEMDRIVE" | |
| export SystemRoot="$SYSTEMROOT" | |
| export windir="$WINDIR" | |
| cd "$VCPKG_INSTALLATION_ROOT" | |
| git pull > nul | |
| ./bootstrap-vcpkg.bat -disableMetrics | |
| vcpkg install --feature-flags="versions,manifests" --x-manifest-root=${GITHUB_WORKSPACE}/ci --x-install-root=$VCPKG_INSTALLATION_ROOT/installed | |
| mkdir -p ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj | |
| cp "$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }}/share/proj/"* ${GITHUB_WORKSPACE}/pyproj/proj_dir/share/proj/ | |
| - name: Build wheels | |
| uses: pypa/[email protected] | |
| env: | |
| CIBW_ENABLE: cpython-freethreading | |
| CIBW_ARCHS: ${{ matrix.arch }} | |
| # Skip free-threaded Python builds due to segfault in Cython extension during tests | |
| # Affects both Linux aarch64 and macOS x86_64 - likely Cython free-threading issue | |
| # See: https://github.com/cython/cython/issues/6221 | |
| CIBW_SKIP: "*t-*" | |
| CIBW_ENVIRONMENT_LINUX: | |
| PROJ_WHEEL=true | |
| PROJ_NETWORK=ON | |
| PROJ_VERSION=${{ env.PROJ_VERSION }} | |
| PROJ_DIR=/project/pyproj/proj_dir | |
| CIBW_ENVIRONMENT_MACOS: | |
| PROJ_WHEEL=true | |
| PROJ_NETWORK=ON | |
| PROJ_VERSION=${{ env.PROJ_VERSION }} | |
| PROJ_DIR=${GITHUB_WORKSPACE}/pyproj/proj_dir | |
| CMAKE_OSX_ARCHITECTURES='${{ matrix.cmake_osx_architectures }}' | |
| MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_deployment_target }} | |
| LDFLAGS="${LDFLAGS} -Wl,-rpath,${GITHUB_WORKSPACE}/pyproj/proj_dir/lib" | |
| CIBW_ENVIRONMENT_WINDOWS: | |
| PROJ_WHEEL=true | |
| PROJ_NETWORK=ON | |
| PROJ_VERSION=${{ env.PROJ_VERSION }} | |
| PROJ_DIR=$VCPKG_INSTALLATION_ROOT/installed/${{ matrix.triplet }} | |
| # Rename Git's link.exe to avoid conflict with MSVC link.exe (meson issue) | |
| CIBW_BEFORE_BUILD_WINDOWS: > | |
| python -m pip install delvewheel && | |
| if exist "C:\Program Files\Git\usr\bin\link.exe" (rename "C:\Program Files\Git\usr\bin\link.exe" "link.exe.bak") | |
| # Add Windows System32 explicitly to the path https://github.com/adang1345/delvewheel/issues/54 | |
| CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair --add-path C:/Windows/System32 --add-path C:/vcpkg/installed/${{ matrix.triplet }}/bin -w {dest_dir} {wheel}" | |
| CIBW_BEFORE_ALL_LINUX: bash ./ci/proj-compile-wheels.sh | |
| CIBW_BEFORE_ALL_MACOS: bash ./ci/proj-compile-wheels.sh | |
| CIBW_TEST_REQUIRES: cython pytest numpy --config-settings=setup-args="-Dallow-noblas=true" | |
| # Install numpy first so Shapely can find numpy headers during build | |
| CIBW_BEFORE_TEST: python -m pip install numpy && python -m pip install shapely pandas xarray || echo "Optional requirements install failed" | |
| CIBW_TEST_COMMAND: > | |
| pyproj -v && | |
| python -c "import pyproj; pyproj.Proj(init='epsg:4269')" && | |
| cp -r {package}/test . && | |
| python -m pytest test -v -s | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: wheels-${{ matrix.os }}-${{ matrix.arch }} | |
| path: ./wheelhouse/*.whl | |
| retention-days: 5 | |
| publish: | |
| name: Publish on PyPI | |
| needs: [make_sdist,build_wheels] | |
| if: ${{ github.repository_owner == 'pyproj4' && github.event_name != 'pull_request' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: sdist | |
| path: dist | |
| - uses: actions/download-artifact@v8 | |
| continue-on-error: ${{ github.event_name == 'push' && github.ref_type != 'tag' }} | |
| with: | |
| pattern: wheels-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Upload Wheels to PyPI | |
| # release on every tag | |
| if: ${{ github.event_name == 'release' && github.ref_type == 'tag' }} | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.PYPI_API_TOKEN }} | |
| skip_existing: true | |
| # repository_url: https://test.pypi.org/legacy/ # To test | |
| - name: Upload Nightly Wheelsref | |
| if : ${{ github.ref_type == 'branch' && github.ref_name == 'main' }} | |
| uses: scientific-python/upload-nightly-action@5748273c71e2d8d3a61f3a11a16421c8954f9ecf | |
| with: | |
| artifacts_path: dist | |
| anaconda_nightly_upload_token: ${{ secrets.ANACONDA_ORG_UPLOAD_TOKEN }} |