Skip to content

fix(engine): gp.run and model steps say which tool parameters they ignore (#2307) #8584

fix(engine): gp.run and model steps say which tool parameters they ignore (#2307)

fix(engine): gp.run and model steps say which tool parameters they ignore (#2307) #8584

Workflow file for this run

name: Python package
# The `rustgis` package on PyPI (apps/rustgis-python): tested on every change to it or the
# engine; wheels for every platform built on each published release, attached to it and
# uploaded to PyPI with trusted publishing (the `pypi` environment, no token). The package's
# version is the workspace's, so each release's wheels carry its tag's version.
#
# Pull requests test on Linux; macOS and Windows on main, by hand and for releases, and for a
# pull request labelled `ci:macos`, `ci:windows` or `ci:full` (adding the label runs that platform
# straight away, in ci-label.yml; later pushes include it here).
on:
push:
branches: [main]
pull_request:
paths:
- "apps/rustgis-python/**"
- "crates/**"
- "Cargo.toml"
- "Cargo.lock"
- ".github/workflows/python.yml"
- ".github/workflows/test-python.yml"
- ".github/scripts/platforms.sh"
release:
types: [published]
workflow_dispatch:
# A new push to a pull request replaces its earlier run. Runs on main, by hand and for releases
# are never cancelled: a merge landing mid-build must not stop the wheels being built.
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}-${{ github.event_name != 'pull_request' && github.run_id || 'pr' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
env:
CARGO_TERM_COLOR: always
jobs:
plan:
name: Platforms
runs-on: ubuntu-latest
outputs:
os: ${{ steps.os.outputs.os }}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
sparse-checkout: .github/scripts
- id: os
env:
EVENT: ${{ github.event_name }}
ACTION: ${{ github.event.action }}
LABELS: ${{ toJSON(github.event.pull_request.labels.*.name) }}
run: echo "os=$(.github/scripts/platforms.sh)" >> "$GITHUB_OUTPUT"
test:
needs: plan
uses: ./.github/workflows/test-python.yml
with:
os: ${{ needs.plan.outputs.os }}
wheels:
name: Wheels (${{ matrix.platform.name }})
if: github.event_name == 'release' || github.event_name == 'workflow_dispatch'
runs-on: ${{ matrix.platform.runner }}
strategy:
fail-fast: false
matrix:
platform:
- { name: linux-x86_64, runner: ubuntu-latest, target: x86_64, manylinux: "2_28" }
- { name: linux-aarch64, runner: ubuntu-22.04-arm, target: aarch64, manylinux: "2_28" }
- { name: macos-x86_64, runner: macos-15-intel, target: x86_64 }
- { name: macos-aarch64, runner: macos-latest, target: aarch64 }
- { name: windows-x86_64, runner: windows-latest, target: x64 }
- { name: windows-aarch64, runner: windows-11-arm, target: aarch64 }
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
# The Windows ARM64 image ships no Rust toolchain; maturin-action needs rustup.
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
if: runner.os == 'Windows' && runner.arch == 'ARM64'
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
working-directory: apps/rustgis-python
target: ${{ matrix.platform.target }}
manylinux: ${{ matrix.platform.manylinux || 'auto' }}
args: --release --locked --out dist
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: "3.14"
# Each runner builds for its own architecture, so the wheel installs and runs here.
- name: Smoke-test the wheel
shell: bash
run: |
python -m pip install --no-index --find-links apps/rustgis-python/dist rustgis
python -c "import rustgis; s = rustgis.Session(sample=True); assert s.layers() and s.to_png(width=64, height=32)"
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: wheels-${{ matrix.platform.name }}
path: apps/rustgis-python/dist
# On every change too: the sdist carries the workspace crates it builds from, and a missing
# one would otherwise only show at release time.
sdist:
name: Source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: dtolnay/rust-toolchain@b725eda525362e7cf34af9a7243cac1e3f01a7ec # stable
- uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2
with:
# Only main saves the cache (see test-rust.yml).
save-if: ${{ github.ref == 'refs/heads/main' }}
# The Python package ships a copy of the license (pyproject.toml's license-files can't
# reach the repository root).
- name: The license copy matches LICENSE
run: cmp LICENSE apps/rustgis-python/LICENSE || { echo "::error::apps/rustgis-python/LICENSE differs from LICENSE."; exit 1; }
- uses: PyO3/maturin-action@e83996d129638aa358a18fbd1dfb82f0b0fb5d3b # v1
with:
working-directory: apps/rustgis-python
command: sdist
args: --out dist
- uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7
with:
python-version: "3.14"
- name: Build and test from the sdist alone
shell: bash
run: |
mkdir -p /tmp/sdist-check
cp apps/rustgis-python/dist/*.tar.gz apps/rustgis-python/tests/test_session.py /tmp/sdist-check/
cd /tmp/sdist-check
# conda-forge and other repackagers need the license in the sdist.
# PyPI rejects an sdist whose PKG-INFO License-File isn't at its root.
tar tzf ./*.tar.gz | grep -E '^[^/]+/LICENSE$' || { echo "::error::The sdist has no LICENSE file at its root."; exit 1; }
tar tzf ./*.tar.gz | grep -E '^[^/]+/THIRD-PARTY-LICENSES.txt$' || { echo "::error::The sdist has no THIRD-PARTY-LICENSES.txt at its root."; exit 1; }
python -m pip install ./*.tar.gz pytest
python -m pytest -q test_session.py
- uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: wheels-sdist
path: apps/rustgis-python/dist
# The wheels and the sdist are attached to the GitHub release too, beside the app's packages.
release-assets:
name: Attach to the release
if: github.event_name == 'release'
needs: [test, wheels, sdist]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
pattern: wheels-*
merge-multiple: true
path: dist
- name: Upload
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ github.event.release.tag_name }}
run: gh release upload "$TAG" dist/* --clobber -R "$GITHUB_REPOSITORY"
publish:
name: Publish to PyPI
if: github.event_name == 'release'
needs: [test, wheels, sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
steps:
- uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8
with:
pattern: wheels-*
merge-multiple: true
path: dist
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # release/v1
with:
packages-dir: dist