-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathTaskfile.yml
More file actions
122 lines (104 loc) · 2.56 KB
/
Taskfile.yml
File metadata and controls
122 lines (104 loc) · 2.56 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
# https://taskfile.dev
version: '3'
env:
PYTHONUNBUFFERED: 1
PYTHONDONTWRITEBYTECODE: 1
vars:
SOURCES: ./django_asgi_lifespan/ ./example/ ./tests/
tasks:
test:
aliases:
- tests
- pytest
- pytests
desc: Run pytests
cmds:
- uv run pytest
silent: false
coverage:
desc: Run coverage
cmds:
- uv run pytest --cov=./django_asgi_lifespan/ --cov-branch --cov-report=xml --cov-report=term-missing ./tests/
silent: false
clean:
desc: Clean build files
cmds:
- >
{{if eq OS "windows"}}
powershell -Command Remove-Item *.egg-info, dist, .tox, coverage.xml, .coverage, .mypy_cache, .pytest_cache -Recurse -Force -ErrorAction SilentlyContinue
{{else}}
rm -rf *egg-info dist .tox coverage.xml .coverage .mypy_cache .pytest_cache
{{end}}
silent: false
mypy:
desc: Type check with mypy and pyright
cmds:
- uv run mypy {{.SOURCES}}
- uv run pyright ./example/
silent: false
ruff:
desc: Run ruff
cmds:
- uv run ruff check {{.SOURCES}}
silent: false
lint:
desc: Run linters and type checks
cmds:
- task: mypy
- task: ruff
- task: isort_check
- task: black_check
silent: false
isort:
desc: Fix import order and remove unused imports (auto-fix)
cmds:
- uv run ruff check --select I,F401 --fix {{.SOURCES}}
silent: false
isort_check:
desc: Check import order and unused imports
cmds:
- uv run ruff check --select I,F401 {{.SOURCES}}
silent: false
black:
aliases:
- fmt
desc: Format code (ruff format)
cmds:
- uv run ruff format {{.SOURCES}}
silent: false
black_check:
desc: Check code formatting
cmds:
- uv run ruff format --check {{.SOURCES}}
silent: false
format:
desc: Format code and check import order
cmds:
- task: isort
- task: black
silent: false
doc:
desc: Build documentation with MkDocs
cmds:
- uv run mkdocs build
silent: false
build:
desc: Build the package
cmds:
- uv build
silent: false
build_check:
desc: Check built distributions with Twine
cmds:
- uv run twine check dist/*
silent: false
test_install:
desc: Try to install local dist
vars:
PROJECT_NAME: django-asgi-lifespan
deps: [ build ]
cmds:
- uv pip uninstall {{.PROJECT_NAME}}
- uv pip install --no-cache-dir --no-index --find-links=file:./dist {{.PROJECT_NAME}}
- uv pip uninstall {{.PROJECT_NAME}}
silent: false