Skip to content

Accept target_values=None in surface_distance trio (#3712) #5146

Accept target_values=None in surface_distance trio (#3712)

Accept target_values=None in surface_distance trio (#3712) #5146

Workflow file for this run

name: pytest
on:
push:
branches:
- main
pull_request:
branches:
- '*'
# Nightly cron and a manual trigger so the full corpus (slow lane
# included) runs at least once a day. PR runs stay on the fast lane
# via `-m "not slow"`; this job has no such filter and exercises
# every fixture in the golden corpus, including the heavier
# compression cells. See issue #1930 for the fast / slow split.
#
# GitHub Actions only fires `schedule` triggers on the workflow file
# in the default branch. The cron will not run from a feature branch
# or PR head -- use `workflow_dispatch` below for an on-demand run.
schedule:
# 03:00 UTC daily. Off-peak to avoid contention with weekday PRs.
- cron: '0 3 * * *'
workflow_dispatch:
jobs:
run:
runs-on: ${{ matrix.os }}
# The free-threaded build (3.14t) is allowed to fail while numba and the
# rest of the stack finish their no-GIL support, so a broken install or a
# thread-safety failure reports signal without turning the PR check red or
# blocking a merge. Promote it to a required job once it stays green.
continue-on-error: ${{ endsWith(matrix.python, 't') }}
# Cap the free-threaded job so a no-GIL deadlock can't sit on a runner for
# the 360-minute default; other versions keep that default.
timeout-minutes: ${{ endsWith(matrix.python, 't') && 30 || 360 }}
strategy:
matrix:
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
python: ${{ github.event_name == 'pull_request' && fromJson('["3.14", "3.14t"]') || fromJson('["3.12", "3.13", "3.14", "3.14t"]') }}
env:
OS: ${{ matrix.os }}
PYTHON: ${{ matrix.python }}
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[tests]
- name: Run pytest (fast lane)
# PR triggers run the fast lane: `-m "not slow"` deselects the
# heavier corpus cells tagged via `_marks.fast_slow_marks_for`
# (today: the six compression fixtures). push-to-main and the
# nightly schedule run the full set with no filter.
if: github.event_name == 'pull_request'
# Force the GIL off only for the free-threaded (3.14t) test run so the
# suite exercises the real no-GIL path instead of letting CPython
# silently re-enable the GIL for a C extension that hasn't declared
# free-threaded support. Scoped to the pytest step (not the job) so it
# never reaches setup-python's bootstrap interpreter, where
# PYTHON_GIL=0 is a fatal error on a GIL build. Empty (ignored) on the
# GIL versions.
env:
PYTHON_GIL: ${{ endsWith(matrix.python, 't') && '0' || '' }}
run: pytest -m "not slow"
- name: Run pytest (full)
if: github.event_name != 'pull_request'
env:
PYTHON_GIL: ${{ endsWith(matrix.python, 't') && '0' || '' }}
run: pytest
# The `run` matrix above always resolves the newest of everything, so the
# lower bounds in setup.cfg are never exercised. This job pins each one to
# the exact floor it declares. When it goes red, either the floor is wrong
# or the code picked up a newer API -- fix one or the other, don't relax
# the pins. See issue #3701.
#
# Unlike `run`, this stays on the fast lane for every trigger. The slow
# corpus cells exercise codecs, not dependency APIs, so running them a
# second time against old pins buys nothing.
min-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install dependencies at the declared floors
# One pip invocation so the pins take part in a single resolve
# instead of being downgraded on top of an already-solved tree.
run: |
python -m pip install --upgrade pip
pip install -e .[tests] \
numba==0.59.0 scipy==1.11.2 xarray==2025.11.0 \
numpy==1.26.0 pandas==2.2.0 urllib3==2.7.0 zstandard==0.22.0
- name: Run pytest (fast lane)
run: pytest -m "not slow"
gpu-extras-resolve:
# The GPU extras name packages no test job ever installs, so a broken
# requirement sits there indefinitely. Issue #3699: the `gpu` extra
# pinned `cuspatial`, a PyPI name-holder whose install raises, plus the
# sdist-only `cupy` project, which made `pip install xarray-spatial[gpu]`
# fail on every machine. Resolve them (metadata only, no download) so a
# future edit that names an uninstallable package turns the PR red.
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Upgrade pip
run: python -m pip install --upgrade pip
- name: Resolve gpu extra (CUDA 12)
run: pip install --dry-run --ignore-installed '.[gpu]'
- name: Resolve gpu-cuda13 extra (CUDA 13)
run: pip install --dry-run --ignore-installed '.[gpu-cuda13]'