forked from tombenke/py-12f-common
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
113 lines (93 loc) · 2.44 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
# https://taskfile.dev
version: 3
vars:
VERSION:
sh: git describe --tags --always --match v* ${GITHUB_REF}
GIT_HOOKS_DIR:
sh: sh -c 'echo "$(pwd)/.git/hooks"'
env:
tasks:
default:
desc: Executes all the tests then build the binary.
cmds:
- task: test
- task: docs
echo:
cmds:
- echo {{.GIT_HOOKS_DIR}}
format:
desc: Autoformat the source files
cmds:
- black .
test:
desc: Run all the tests.
cmds:
- task: format
- python -m unittest discover
test-verbose:
desc: Run all the go tests.
cmds:
- task: format
- python -m unittest discover -v
coverage:
desc: Test coverage
cmds:
- coverage run -m unittest discover -v
- coverage html
- coverage report
- coverage-badge -f -o coverage.svg
lint:
desc: Run python linter
cmds:
- task: format
- pylint common/
build:
desc: Build
cmds:
- task: clean
- rm dist/* -fr
- VERSION={{.VERSION}} python -m build
publish-package:
desc: Publish the package to PyPI
cmds:
- twine upload -r pypi dist/*
pre-commit:
desc: Runs the QA tasks from a git pre-commit hook
cmds:
- task: lint
- task: coverage
install-git-hooks:
desc: Install git hooks
cmds:
- echo -e "#!/bin/bash\ntask pre-commit" > ./.git/hooks/pre-commit
- chmod ug+x {{.GIT_HOOKS_DIR}}/pre-commit
install:
desc: Install the package and its dependencies
cmds:
- pip install .
- task: install-git-hooks
install-dev:
desc: Install the package and its dependencies for development
cmds:
- pip install .[dev]
- task: install-git-hooks
install-dev-editable:
desc: Install the package and its dependencies for development with editablility
cmds:
- VERSION={{.VERSION}} pip install -e .[dev]
- task: install-git-hooks
docs:
desc: Generate module documentation into the docs/ folder
cmds:
- task: install-dev-editable
- rm docs/* -fr
- echo {{.VERSION}}
#- PYTHONPATH=. sphinx-autogen docs_src/modules.rst
- sphinx-apidoc -o docs_src/modules common common/*/tests/ -e -f -M
- sphinx-build -b html docs_src/ docs
# - pdoc -o docs common/app/ common/config/ common/logger/ --footer-text="py-12f-common {{.VERSION}}"
clean:
desc: Clean temporary files and folders
cmds:
- rm .coverage -f
- rm htmlcov -fr