-
Notifications
You must be signed in to change notification settings - Fork 16
/
Taskfile.yml
88 lines (76 loc) · 1.89 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
version: "3"
dotenv: [".env"]
tasks:
ci:
desc: "Run code analyzers from pre-commit and unit tests"
deps: [install-poetry, create-virtual-env]
cmds:
- task: unit
- task: lint
lint:
desc: "Install and init pre-commits."
deps: [install-poetry, create-virtual-env]
cmds:
- poetry run pre-commit run --all-files
unit:
desc: "Run unit tests"
deps: [install-poetry, create-virtual-env]
cmds:
- poetry run pytest
silent: true
install-poetry:
desc: "Install poetry package manager."
cmds:
- pip install poetry
status:
- poetry --version
generates:
- $HOME/.poetry/env
create-virtual-env:
desc: "Create poetry virtual env."
deps: [install-poetry]
cmds:
- poetry install
build:
desc: "Build python package for publication."
deps: [install-poetry]
cmds:
- poetry build
sources:
- fastapi_oidc/**
- poetry.lock
- pyproject.toml
generates:
- dist/**
publish:
desc: "Push package to PIPy"
deps: [build]
cmds:
- echo "Publishing as $PYPI_USERNAME"
- poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD
# sources:
# # TODO This is erroneously registering as up to date
# # After a build has been run :( )
# - dist/**
# - poetry.lock
# - pyproject.toml
# status:
# - echo "Return nonzero code if we shouldn't publish"
clean:
desc: "Remove artifacts and caches."
cmds:
- rm -rf ./build ./dist ./*.egg-info __pycache__
init-pre-commit-ci:
desc: "Init pre-commit."
deps: [install-pre-commit-ci]
cmds:
- python3 pre-commit-2.8.2.pyz install
generates:
- .git/hooks/pre-commit
build_docs:
desc: "Build sphinx docs in /docs"
deps: [create-virtual-env]
cmds:
- |
cd docs &&
source $HOME/.poetry/env && poetry run make html