-
Notifications
You must be signed in to change notification settings - Fork 61
66 lines (57 loc) · 1.62 KB
/
lint.yml
File metadata and controls
66 lines (57 loc) · 1.62 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
name: Styling and lints
on:
push:
pull_request:
workflow_call:
jobs:
lint:
name: Run lints
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Run ruff
uses: astral-sh/ruff-action@v3
with:
src: kernels/src kernels/tests
black:
name: Run black check
runs-on: ubuntu-latest
env:
UV_PYTHON_PREFERENCE: only-managed
steps:
- uses: actions/checkout@v6
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: 3.12
- name: Check formatting
run: uv run --with black black --check kernels/src kernels/tests
isort:
name: Run isort check
runs-on: ubuntu-latest
env:
UV_PYTHON_PREFERENCE: only-managed
steps:
- uses: actions/checkout@v6
- name: Install uv and set the python version
uses: astral-sh/setup-uv@v7
with:
python-version: 3.12
- name: Check import sorting
run: uv run --with isort isort --check-only --diff kernels/src kernels/tests
validate-dependencies:
name: Validate python_depends.json
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Validate python_depends.json is up-to-date
run: |
(cd kernels && python update_python_depends.py --validate) || {
echo "Error: python_depends.json is out of date."
echo "Please run: python update_python_depends.py"
exit 1
}