-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathTaskfile.yml
96 lines (89 loc) · 1.95 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
# https://taskfile.dev/
version: "3"
vars:
PYTHON_BIN: python3.7
VENVS: ./venvs/
FLAKE8_ENV: "{{.VENVS}}flake8"
MYPY_ENV: "{{.VENVS}}mypy"
FLIT_ENV: "{{.VENVS}}flit"
PYTEST_ENV: "{{.VENVS}}pytest"
ISORT_ENV: "{{.VENVS}}isort"
env:
FLIT_ROOT_INSTALL: "1"
tasks:
venv:create:
status:
- "test -f {{.ENV}}/bin/activate"
cmds:
- "{{.PYTHON_BIN}} -m venv {{.ENV}}"
- "{{.ENV}}/bin/python3 -m pip install -U pip setuptools wheel"
flit:init:
status:
- "test -f {{.FLIT_ENV}}/bin/flit"
deps:
- task: venv:create
vars:
ENV: "{{.FLIT_ENV}}"
cmds:
- "{{.FLIT_ENV}}/bin/python3 -m pip install flit"
flit:install:
sources:
- pyproject.toml
- "{{.ENV}}/bin/activate"
deps:
- flit:init
- task: venv:create
vars:
ENV: "{{.ENV}}"
cmds:
- >
{{.FLIT_ENV}}/bin/flit install
--python={{.ENV}}/bin/python3
--deps=production
--extras={{.EXTRA}}
flit:build:
deps:
- flit:init
cmds:
- "{{.FLIT_ENV}}/bin/flit build"
flit:upload:
deps:
- flit:build
cmds:
- "{{.FLIT_ENV}}/bin/flit publish"
flake8:run:
sources:
- "**/*.py"
deps:
- task: flit:install
vars:
ENV: "{{.FLAKE8_ENV}}"
EXTRA: dev
cmds:
- "{{.FLAKE8_ENV}}/bin/flake8 ."
pytest:run:
deps:
- task: flit:install
vars:
ENV: "{{.PYTEST_ENV}}"
EXTRA: dev
cmds:
- "{{.PYTEST_ENV}}/bin/pytest {{.CLI_ARGS}}"
mypy:run:
deps:
- task: flit:install
vars:
ENV: "{{.MYPY_ENV}}"
EXTRA: dev
cmds:
- "{{.MYPY_ENV}}/bin/mypy --ignore-missing-imports --allow-redefinition flake8_length/"
isort:run:
sources:
- "**/*.py"
deps:
- task: flit:install
vars:
ENV: "{{.ISORT_ENV}}"
EXTRA: dev
cmds:
- "{{.ISORT_ENV}}/bin/isort ."