-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathTaskfile.yml
123 lines (105 loc) · 2.34 KB
/
Taskfile.yml
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
# https://taskfile.dev
version: '3'
env:
PYTHONUNBUFFERED: 1
PYTHONDONTWRITEBYTECODE: 1
vars:
SOURCES: ./django_brotli/ ./tests/
tasks:
test:
aliases:
- tests
- pytest
- pytests
desc: Run pytests
cmds:
- poetry run pytest
silent: false
coverage:
desc: Run coverage
cmds:
- pytest --cov=./django_brotli/ --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: Check setup
cmds:
- mypy {{.SOURCES}}
silent: false
ruff:
desc: Run ruff
cmds:
- ruff check {{.SOURCES}}
silent: false
lint:
desc: Check setup
cmds:
- task: mypy
- task: ruff
- task: isort_check
- task: format_check
silent: false
isort:
desc: Optimize imports
cmds:
- ruff check --select I,F401 {{.SOURCES}}
silent: false
isort_check:
desc: Check isort
cmds:
- ruff check --select I,F401 --fix {{.SOURCES}}
silent: false
ruff_format:
aliases:
- fmt
desc: Format using ruff
cmds:
- ruff format {{.SOURCES}}
silent: false
format_check:
desc: Check ruff formatting
cmds:
- ruff format --check {{.SOURCES}}
silent: false
format:
desc: Check setup
cmds:
- task: isort
- task: ruff
silent: false
doc:
desc: Check distribution
cmds:
- mkdocs build
silent: false
build:
desc: Build the package
cmds:
- poetry build
silent: false
build_check:
desc: Check distribution
cmds:
- twine check dist/*
silent: false
test_install:
desc: Try to install local dist
vars:
PROJECT_NAME: django-brotli
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
deps: [ build ]
cmds:
- pip uninstall {{.PROJECT_NAME}} --yes
- pip install --no-cache-dir --no-index --find-links=file:./dist {{.PROJECT_NAME}}
- pip uninstall {{.PROJECT_NAME}} --yes
silent: false