| 1 |
name: stubtest |
| 2 |
permissions: read-all |
| 3 |
|
| 4 |
# Stubtest depends on different branches and paths than mypy does, so we have a separate workflow. |
| 5 |
|
| 6 |
on: |
| 7 |
pull_request: |
| 8 |
branches: |
| 9 |
- "main" |
| 10 |
- "maintenance/2.**" |
| 11 |
# Stubtest requires numpy>=2.4 |
| 12 |
- "!maintenance/2.[0-3].x" |
| 13 |
paths: |
| 14 |
- ".github/workflows/stubtest.yml" |
| 15 |
- "numpy/**" |
| 16 |
- "!numpy/**/tests/**" |
| 17 |
- "requirements/test_requirements.txt" |
| 18 |
- "tools/stubtest/**" |
| 19 |
workflow_dispatch: |
| 20 |
|
| 21 |
concurrency: |
| 22 |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} |
| 23 |
cancel-in-progress: true |
| 24 |
|
| 25 |
jobs: |
| 26 |
mypy: |
| 27 |
# To enable this workflow on a fork, comment out: |
| 28 |
if: github.repository == 'numpy/numpy' |
| 29 |
|
| 30 |
name: stubtest |
| 31 |
runs-on: ${{ matrix.os }}-latest |
| 32 |
strategy: |
| 33 |
fail-fast: false |
| 34 |
matrix: |
| 35 |
# TODO: consider including macos and windows |
| 36 |
os: [ubuntu] |
| 37 |
py: ["3.11", "3.14"] |
| 38 |
|
| 39 |
steps: |
| 40 |
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 41 |
with: |
| 42 |
submodules: recursive |
| 43 |
fetch-tags: true |
| 44 |
persist-credentials: false |
| 45 |
|
| 46 |
- uses: astral-sh/setup-uv@1e862dfacbd1d6d858c55d9b792c756523627244 # v7.1.4 |
| 47 |
with: |
| 48 |
python-version: ${{ matrix.py }} |
| 49 |
activate-environment: true |
| 50 |
cache-dependency-glob: | |
| 51 |
requirements/build_requirements.txt |
| 52 |
requirements/test_requirements.txt |
| 53 |
|
| 54 |
- name: uv pip install |
| 55 |
run: >- |
| 56 |
uv pip install |
| 57 |
-r requirements/build_requirements.txt |
| 58 |
-r requirements/test_requirements.txt |
| 59 |
|
| 60 |
- name: spin build |
| 61 |
run: spin build -j2 -- -Dallow-noblas=true -Ddisable-optimization=true --vsenv |
| 62 |
|
| 63 |
- name: spin stubtest |
| 64 |
run: spin stubtest |