-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
83 lines (79 loc) · 2.25 KB
/
Taskfile.yaml
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
version: '3'
vars:
BUILD_DIR: app_name_here
IMAGE_NAME: appnamehere
DOCKER_FILE: Dockerfile
tasks:
default:
- task: test
- task: commit
setup:
- python3 -m pip install pipx
- python3 -m pipx ensurepath
- pipx install poetry
- poetry install
test:
silent: false
interactive: false
cmds:
- poetry install
- task: security
- task: pytest
commit:
# Run all actions at same time
deps:
- task: format
- task: security
- task: docs
clean:
- rm -rf dist
- poetry cache clear _default_cache --all --no-interaction
- poetry cache clear PyPI --all --no-interaction
- poetry check
- py3clean .
security:
- poetry run whispers {{.BUILD_DIR}} # Check for security issues
- poetry run bandit --silent -r {{.BUILD_DIR}}
- poetry run tartufo scan-local-repo .
pytest:
silent: false
interactive: false
dotenv: [.env]
cmds:
- poetry run vulture --min-confidence 100 {{.BUILD_DIR}}
- poetry run pytest --cov --cov-fail-under=75 #--typeguard-packages={{.BUILD_DIR}} # Leave typeguard off for now
format:
silent: false
interactive: false
cmds:
- poetry run isort --atomic . # Sort imports
- poetry run black . # Format code
- poetry run flake8
- poetry version $(git describe --tags --abbrev=0)
docs:
silent: false
interactive: false
cmds:
- rm -rf docsprod
- poetry run pdoc3 {{.BUILD_DIR}} -o docs -f
- poetry run pyreverse {{.BUILD_DIR}} -d docs
- git add docs
# Build Scripts
install:
- pip install . --upgrade
build:
- poetry version $(git describe --tags --abbrev=0)
- docker-compose build --no-cache --pull --progress=plain
publish:
- task: security
- task: build
- poetry publish
build_poetry:
env:
PIPENV_IGNORE_VIRTUALENVS: 1
deps: [ docs, clean ]
cmds:
- poetry build
run:
- task: build
- docker-compose up