8000 CI: add new GHA CI jobs to run MyPy across OS/Python flavors · numpy/numpy@3411697 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3411697

Browse files
committed
CI: add new GHA CI jobs to run MyPy across OS/Python flavors
1 parent b7e6f99 commit 3411697

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

.github/workflows/linux_meson.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,5 @@ jobs:
6868
TERM: xterm-256color
6969
LD_LIBRARY_PATH: "/usr/local/lib/" # to find libopenblas.so.0
7070
run: |
71-
export NPY_RUN_MYPY_IN_TESTSUITE=1
7271
pip install pytest pytest-xdist hypothesis typing_extensions
7372
spin test -j auto

.github/workflows/mypy.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Run MyPy
2+
3+
# Mypy is too slow to run as part of regular CI. The purpose of the jobs in
4+
# this file is to cover running Mypy across:
5+
#
6+
# - OSes: Linux, Windows and macOS
7+
# - Python versions: lowest/highest supported versions, and an intermediate one
8+
#
9+
# The build matrix aims for sparse coverage across those two dimensions.
10+
# Use of BLAS/LAPACK and SIMD is disabled on purpose, because those things
11+
# don't matter for static typing and this speeds up the builds.
12+
#
13+
# This is a separate job file so it's easy to trigger by hand.
14+
15+
on:
16+
pull_request:
17+
branches:
18+
- main
19+
- maintenance/**
20+
paths-ignore:
21+
- '!benchmarks/'
22+
- '!.circlecl/'
23+
- '!docs/'
24+
- '!meson_cpu/'
25+
- '!tools/'
26+
workflow_dispatch:
27+
28+
defaults:
29+
run:
30+
shell: bash
31+
32+
concurrency:
33+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
34+
cancel-in-progress: true
35+
36+
permissions:
37+
contents: read # to fetch code (actions/checkout)
38+
39+
jobs:
40+
mypy:
41+
if: "github.repository == 'numpy/numpy'"
42+
name: "MyPy"
43+
runs-on: ${{ matrix.os_python[0] }}
44+
strategy:
45+
matrix:
46+
os_python:
47+
- [ubuntu-latest, '3.10'] # switch to 3.12-dev after mypy is upgraded (see gh-23764)
48+
- [windows-2019, '3.11']
49+
- [macos-12, '3.9']
50+
steps:
51+
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
52+
with:
53+
submodules: recursive
54+
fetch-depth: 0
55+
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4.7.0
56+
with:
57+
python-version: ${{ matrix.os_python[1] }}
58+
- name: Install dependencies
59+
run: |
60+
pip install -r build_requirements.txt
61+
pip install -r test_requirements.txt
62+
- name: Build
63+
run: |
64+
spin build -j2 -- -Dallow-noblas=true -Ddisable-optimization=true --vsenv
65+
- name: Run Mypy
66+
run: |
67+
spin mypy

0 commit comments

Comments
 (0)
0