-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathTaskfile.yml
More file actions
109 lines (91 loc) · 2.82 KB
/
Copy pathTaskfile.yml
File metadata and controls
109 lines (91 loc) · 2.82 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
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
includes:
tests:
taskfile: ./tests/Taskfile.yml
dir: ./tests