-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTaskfile.yml
More file actions
141 lines (117 loc) · 4.25 KB
/
Copy pathTaskfile.yml
File metadata and controls
141 lines (117 loc) · 4.25 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
version: "3"
dotenv: [".env"]
tasks:
install:
desc: >-
Install the project using poetry (including dependencies and git hooks).
cmds:
- uv sync
- pre-commit install
format-check:
desc: >-
Check code formatting using ruff.
cmds:
- uv run ruff format --diff --check .
format:
desc: >-
Format code using ruff.
cmds:
- uv run ruff format .
lint:
desc: >-
Run linting using ruff.
summary: |
Run linting using ruff.
This will check the code using the ruff linter.
If the `FIX` environment variable is set to "true", the linter will attempt to fix the issues.
If the `UNSAFE_FIXES` environment variable is set to "true", the linter will attempt to fix the issues using unsafe fixes.
vars:
FIX: '{{ .FIX | default "false" }}'
UNSAFE_FIXES: '{{ .UNSAFE_FIXES | default "false" }}'
cmds:
- uv run ruff check src tests
{{ if eq .FIX "true" }}
--fix
{{end}}
{{ if eq .UNSAFE_FIXES "true" }}
--unsafe-fixes
{{end}}
typecheck:
desc: >-
Run type checking using mypy.
cmds:
- uv run mypy --ignore-missing-imports --install-types --non-interactive src tests
test:
desc: |-
Run tests using pytest with the default flags defined in pyproject.toml.
cmds:
- uv run pytest tests {{ .CLI_ARGS }}
test-all:
desc: >-
Run all tests using pytest.
deps:
- test
test-watch:
desc: >-
Run tests using pytest anytime you save a file.
summary: Run tests using pytest every time a file changes.
This will run the tests using pytest in a watch loop. The tests will be re-run
whenever a file changes.
The `MARKS` environment variable can be used to filter the tests using pytest marks.
The `TEST_PATH` environment variable can be used to specify the path to the tests.
The default is to run all unit tests in `tests/`
vars:
MARKS: '{{ .MARKS | default "" }}'
TEST_PATH: '{{ .TEST_PATH | default "tests/" }}'
cmds:
- uv run ptw . --now {{ .TEST_PATH }} {{ .MARKS }}
test-benchmark:
desc: >-
Run only the benchmark tests using pytest.
cmds:
- uv run pytest --benchmark-enable --benchmark-only tests/ {{ .CLI_ARGS }}
coverage:
desc: >-
Run tests using pytest and generate a coverage report.
summary: |
Run tests using pytest and generate a coverage report.
This will run the tests using pytest and generate a coverage report.
The coverage report will be output to the terminal.
sources:
- src/**
- tests/**
- pyproject.toml
- poetry.lock
cmds:
- uv run coverage run --source src -m pytest
- uv run coverage report
test-nf-core-pixelator:
desc: >-
Run the default nf-core/pixelator test profile with this version of pixelator.
summary: |
Run the default nf-core/pixelator test profile with this version of pixelator.
If the pipeline is not found in the directory `PIPELINE_SOURCE_DIR`, it will be cloned
from the PixelgenTechnologies/nf-core-pixelator repository using the `PIPELINE_BRANCH` branch.
By default the "pixelator-next" branch of nf-core-pixelator will be used.
If the `PIPELINE_SOURCE_DIR` exists this task will assume that the pipeline is already present and checked out
in the right branch.
Note that the current dev version of pixelator must be installed and available in the PATH.
If the `RESUME` environment variable is set to "true", the pipeline will be resumed if it was previously run.
dir: "{{ .USER_WORKING_DIR }}"
vars:
RESUME: '{{ .RESUME | default "false" }}'
PIPELINE_BRANCH: '{{ .PIPELINE_BRANCH | default "pixelator-next" }}'
PIPELINE_SOURCE_DIR: '{{ .PIPELINE_SOURCE_DIR | default ".nf-core-pixelator-{{ .BRANCH }}" }}'
cmds:
- task: tests:pull-nf-core-pixelator
vars:
{
PIPELINE_BRANCH: "{{ .PIPELINE_BRANCH }}",
PIPELINE_SOURCE_DIR: "{{ .PIPELINE_SOURCE_DIR }}",
}
- task: tests:run-nf-core-pixelator-test-profile
vars: { PIPELINE_SOURCE_DIR: "{{ .PIPELINE_SOURCE_DIR }}" }
includes:
tests:
taskfile: ./tests/Taskfile.yml
dir: ./tests