-
Notifications
You must be signed in to change notification settings - Fork 53
70 lines (57 loc) · 1.84 KB
/
Copy pathpython.yml
File metadata and controls
70 lines (57 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# PR / push CI for the Python client package under python/. Runs ruff (lint +
# format), mypy (type check) once on the pinned interpreter, and pytest (unit
# + lifecycle tests) across a floor/current/ceiling Python version matrix. It
# needs neither MLX nor the mlxcel binary, so it runs on plain ubuntu-latest
# and is independent of the Rust CI in ci.yml. The e2e test is skipped here
# because it requires a built binary (set MLXCEL_BIN to run it locally).
name: Python
on:
push:
branches: [main]
paths:
- 'python/**'
- '.github/workflows/python.yml'
pull_request:
branches: [main]
paths:
- 'python/**'
- '.github/workflows/python.yml'
permissions:
contents: read
jobs:
lint:
name: lint, type-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: '3.11'
- name: Install package with dev extras
run: python -m pip install --upgrade pip && pip install -e "python[dev]"
- name: Ruff lint
run: ruff check python
- name: Ruff format check
run: ruff format --check python
- name: Mypy
run: mypy python/src
test:
name: test (Python ${{ matrix.python-version }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.11', '3.13']
steps:
- uses: actions/checkout@v7
with:
persist-credentials: false
- uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install package with dev extras
run: python -m pip install --upgrade pip && pip install -e "python[dev]"
- name: Pytest (unit + lifecycle)
run: pytest python/tests -m "not e2e" -q