@@ -12,83 +12,98 @@ concurrency:
12
12
cancel-in-progress : true
13
13
14
14
env :
15
+ UV_LOCKED : 1
15
16
# Many color libraries just need this to be set to any value, but at least
16
17
# one distinguishes color depth, where "3" -> "256-bit color".
17
18
FORCE_COLOR : 3
18
19
19
20
jobs :
20
- format :
21
- name : Format
21
+ lint :
22
+ name : lint
22
23
runs-on : ubuntu-latest
23
24
steps :
24
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
25
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
25
26
26
27
- name : Install uv
27
- uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba
28
+ uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
28
29
29
- - name : Install the project
30
- run : uv sync --locked --group test
30
+ - name : ruff
31
+ run : |
32
+ uv run ruff check --output-format=github
33
+ uv run ruff format --check
31
34
32
- - name : Run lefthook hooks
33
- run : uv run --frozen lefthook run pre-commit
35
+ # TODO: Fail if lefthook changes any files:
36
+ # https://github.com/data-apis/array-api-typing/pull/35/files#r2179941334
37
+ - name : lefthook
38
+ run : uv run lefthook run pre-commit
34
39
35
- checks :
36
- name : Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
40
+ - name : mypy
41
+ run : uv run mypy --tb --no-incremental --cache-dir=/dev/null src
42
+
43
+ # TODO: (based)pyright
44
+
45
+ test_runtime :
46
+ name : runtime tests
37
47
runs-on : ${{ matrix.runs-on }}
38
- needs : [format]
39
48
strategy :
40
49
fail-fast : false
41
50
matrix :
42
51
python-version : ["3.11", "3.12", "3.13"]
43
52
runs-on : [ubuntu-latest, macos-latest, windows-latest]
44
53
45
54
steps :
46
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
55
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
47
56
48
57
- name : Install uv
49
- uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba
58
+ uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
50
59
with :
51
60
python-version : ${{ matrix.python-version }}
52
61
53
- - name : Install the project
54
- run : uv sync --locked --group test
55
-
56
62
- name : Test package
57
63
run : >-
58
- uv run --frozen pytest
59
- --cov --cov-report=xml --cov-report=term --durations=20
64
+ uv run --group=test_runtime
65
+ pytest --cov --cov-report=xml --cov-report=term --durations=20
60
66
61
67
- name : Upload coverage report
62
- uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
68
+ uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5.4.3
63
69
with :
64
70
token : ${{ secrets.CODECOV_TOKEN }}
65
71
66
- check_oldest :
67
- name : Check Oldest Dependencies
68
- runs-on : ${{ matrix.runs-on }}
69
- needs : [format]
72
+ test_integration_numpy :
73
+ name : integration tests (numpy)
74
+ runs-on : ubuntu-latest
70
75
strategy :
71
76
fail-fast : false
72
77
matrix :
73
- python-version : ["3.11"]
74
- runs-on : [ubuntu-latest]
78
+ numpy-version : ["1.25.0", "1.26.4", "2.0.2", "2.1.3", "2.2.6", "2.3.1"]
75
79
76
80
steps :
77
- - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
78
-
79
- - name : Install uv
80
- uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba
81
- with :
82
- python-version : ${{ matrix.python-version }}
83
- - name : Install the project
84
- run : uv sync --group test --resolution lowest-direct
81
+ - uses : actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
85
82
86
- - name : Test package
87
- run : >-
88
- uv run --frozen pytest
89
- --cov --cov-report=xml --cov-report=term --durations=20
90
-
91
- - name : Upload coverage report
92
- uses : codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24
83
+ - uses : astral-sh/setup-uv@bd01e18f51369d5a26f1651c3cb451d3417e3bba # v6.3.1
93
84
with :
94
- token : ${{ secrets.CODECOV_TOKEN }}
85
+ python-version : " 3.11"
86
+ activate-environment : true
87
+
88
+ - name : get major numpy version
89
+ id : numpy-major
90
+ run : |
91
+ version=$(echo ${{ matrix.numpy-version }} | cut -c 1)
92
+ echo "::set-output name=version::$version"
93
+
94
+ - name : install deps
95
+ run : |
96
+ uv sync --no-editable --group=mypy
97
+ uv pip install numpy==${{ matrix.numpy-version }}
98
+
99
+ # NOTE: `uv run --with=...` will be ignored by mypy (and `--isolated` does not help)
100
+ - name : mypy
101
+ run : >
102
+ uv run --no-sync --active
103
+ mypy --tb --no-incremental --cache-dir=/dev/null
104
+ tests/integration/test_numpy${{ steps.numpy-major.outputs.version }}.pyi
105
+
106
+ # TODO: (based)pyright
107
+
108
+ # TODO: integration tests for array-api-strict
109
+ # TODO: integration tests for 3rd party libs such as cupy, pytorch, tensorflow, dask, etc.
0 commit comments