Skip to content

Commit 073bd2b

Browse files
authored
chore: add lock files and top-level check commands (#1)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Added automated linting checks for Snakemake workflows to the CI pipeline * Enhanced development task automation and configuration * **Documentation** * Updated contributor guidelines with current development commands and procedures <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 6c46d1e commit 073bd2b

File tree

7 files changed

+2882
-76
lines changed

7 files changed

+2882
-76
lines changed

.github/workflows/python_package.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
matrix:
1515
PYTHON_VERSION: ["3.12", "3.13"]
1616
steps:
17-
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17+
- name: Checkout from GitHub
18+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
1819

1920
- name: Install uv
2021
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
@@ -26,5 +27,4 @@ jobs:
2627

2728
- name: Test the library
2829
run: |
29-
uv run --locked poe check-all
30-
30+
uv run --directory divref --locked poe check-all
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Snakemake linting check
2+
3+
on:
4+
push:
5+
6+
env:
7+
PIXI_VERSION: v0.65.0
8+
9+
jobs:
10+
Tests:
11+
runs-on: ubuntu-latest
12+
environment: github-actions-snakemake-linting
13+
steps:
14+
- name: Checkout from GitHub
15+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
16+
17+
- name: Install Pixi
18+
uses: prefix-dev/setup-pixi@14c8aabd75893f83f4ab30c03e7cf853c8208961 # v0.8.10
19+
with:
20+
pixi-version: ${{ env.PIXI_VERSION }}
21+
cache: true
22+
23+
- name: Run linting
24+
run: pixi run lint --check

CONTRIBUTING.md

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5,71 +5,77 @@
55
To check and resolve linting issues in the codebase, run:
66

77
```console
8-
uv run ruff check --fix
8+
uv run --directory divref ruff check --fix
99
```
1010

1111
To check and resolve formatting issues in the codebase, run:
1212

1313
```console
14-
uv run ruff format
14+
uv run --directory divref ruff format
1515
```
1616

1717
To check the unit tests in the codebase, run:
1818

1919
```console
20-
uv run pytest
20+
uv run --directory divref pytest
2121
```
2222

2323
To check the typing in the codebase, run:
2424

2525
```console
26-
uv run mypy
26+
uv run --directory divref mypy
2727
```
2828

2929
To generate a code coverage report after testing locally, run:
3030

3131
```console
32-
uv run coverage html
32+
uv run --directory divref coverage html
3333
```
3434

35-
To check the lock file is up to date:
35+
To check the `uv` lock file is up to date:
3636

3737
```console
38-
uv lock --check
38+
uv lock --directory divref --check
39+
```
40+
41+
To check the `pixi` lock file is up to date:
42+
43+
```console
44+
pixi run check-lock
3945
```
4046

4147
## Shortcut Task Commands
4248

43-
###### For Running Individual Checks
49+
###### For Running Individual Toolkit Checks
4450

4551
```console
46-
uv run poe check-format
47-
uv run poe check-lint
48-
uv run poe check-tests
49-
uv run poe check-typing
52+
uv run --directory divref poe check-format
53+
uv run --directory divref poe check-lint
54+
uv run --directory divref poe check-tests
55+
uv run --directory divref poe check-typing
5056
```
5157

52-
###### For Running All Checks
58+
###### For Running All Toolkit Checks
5359

5460
```console
55-
uv run poe check-all
61+
pixi run check-toolkit
5662
```
5763

5864
###### For Running Individual Fixes
5965

6066
```console
61-
uv run poe fix-format
62-
uv run poe fix-lint
67+
uv run --directory divref poe fix-format
68+
uv run --directory divref poe fix-lint
6369
```
6470

6571
###### For Running All Fixes
6672

6773
```console
68-
uv run poe fix-all
74+
uv run --directory divref poe fix-all
6975
```
7076

7177
###### For Running All Fixes and Checks
7278

7379
```console
74-
uv run poe fix-and-check-all
80+
pixi run fix-and-check-all
7581
```

divref/uv.lock

Lines changed: 1 addition & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.lock

Lines changed: 2811 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ version = "0.1.0"
88
[feature.snakemake.dependencies]
99
python = ">=3.12.8,<3.13"
1010
snakemake-minimal = ">=8.28.0,<9.0"
11+
snakefmt = ">=1.0.0,<2"
1112

1213
[pypi-dependencies]
1314
divref = { path = "./divref", editable = true }
@@ -16,4 +17,20 @@ divref = { path = "./divref", editable = true }
1617
default = { features = ["snakemake"] }
1718

1819
[tasks]
20+
check-toolkit = "uv run --directory divref poe check-all"
21+
fix-and-check-toolkit = "uv run --directory divref poe fix-and-check-all"
22+
23+
check-lock = "pixi lock --check"
24+
25+
check-all = [
26+
{ task = "check-toolkit" },
27+
{ task = "check-lock" },
28+
]
29+
30+
fix-and-check-all = [
31+
{ task = "fix-and-check-toolkit" },
32+
{ task = "check-lock" },
33+
]
34+
35+
lint = "snakefmt --line-length 100 workflows/*.smk"
1936
download = "snakemake -j1 -s workflows/download.smk"

workflows/download.smk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
from snakemake.utils import validate
22

3+
34
configfile: os.path.join(workflow.basedir, "config", "config.yml")
45

6+
57
validate(config, os.path.join(workflow.basedir, "config", "config_schema.yml"))
68

79
SAMPLES = config["samples"]

0 commit comments

Comments
 (0)