Skip to content

Commit a5d8646

Browse files
authored
Add code check CI (#142)
* Add code check CI * uv lock --upgrade * Fix nb-clean
1 parent acab904 commit a5d8646

File tree

3 files changed

+316
-257
lines changed

3 files changed

+316
-257
lines changed

.github/workflows/code-check.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Code Check
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
code-check:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Set up Python
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.11"
20+
21+
- name: Install uv
22+
uses: astral-sh/setup-uv@v6
23+
with:
24+
version: "0.8.4"
25+
enable-cache: true
26+
27+
- name: Install dependencies
28+
run: uv sync --locked --group lint
29+
30+
- name: Check imports with ruff
31+
run: uv run ruff check --select I --exit-non-zero-on-fix .
32+
33+
- name: Check formatting with ruff
34+
run: uv run ruff format --check .
35+
36+
- name: Clean notebooks
37+
run: uv run nb-clean check --remove-empty-cells --remove-all-notebook-metadata --preserve-cell-outputs examples/*.ipynb

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ ssl = ["certifi>=2025.7.14"]
4242

4343
[dependency-groups]
4444
dev = [
45+
{ include-group = "lint" },
4546
{ include-group = "docs" },
4647
{ include-group = "test" },
4748
"pre-commit>=4.2.0",
48-
"ruff>=0.12.5",
49-
"nb-clean>=4.0.1",
5049
"ipykernel>=6.30.0",
5150
]
51+
lint = ["ruff>=0.12.5", "nb-clean>=4.0.1"]
5252
docs = ["furo>=2025.7.19", "myst-parser>=3.0.1", "sphinx>=7.4.7"]
5353
test = ["pytest>=8.4.1", "pytest-rerunfailures>=15.1"]
5454

0 commit comments

Comments
 (0)