-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
86 lines (64 loc) · 2.38 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
version: "3"
env:
CONDA: micromamba
vars:
PROJECT: nearness
TESTS: tests
tasks:
env-create:
cmd: $CONDA env create -n {{.PROJECT}} --file env.yml --yes
env-remove:
cmd: $CONDA env remove -n {{.PROJECT}} --yes
poetry-setup:
cmds:
- curl -sSL https://install.python-poetry.org | python -
- poetry config virtualenvs.create false
poetry-remove:
cmd: curl -sSL https://install.python-poetry.org | python - --uninstall
poetry-install:
cmd: poetry install --all-extras --with dev --no-interaction
poetry-update:
cmd: poetry update --with dev
poetry-update-dev:
cmd: poetry add notebook@latest pytest@latest pytest-html@latest hypothesis@latest coverage@latest pytest-cov@latest pytest-benchmark@latest coverage-badge@latest ruff@latest pre-commit@latest black@latest pyright@latest bandit@latest safety@latest -G dev
poetry-use:
cmds:
- |
$CONDA activate {{.PROJECT}}
poetry env use system
pre-commit-install:
cmd: poetry run pre-commit install
pre-commit-all:
cmd: poetry run pre-commit run --all-files
lint:
cmds:
- poetry run ruff check src/{{.PROJECT}}
- poetry run black --diff --check --config pyproject.toml src/{{.PROJECT}} {{.TESTS}}
format:
cmds:
- poetry run ruff check src/{{.PROJECT}} --fix
- poetry run black --config pyproject.toml src/{{.PROJECT}} {{.TESTS}}
test:
cmds:
- poetry run pytest -rsx -c pyproject.toml --cov-report=html --cov=src/{{.PROJECT}} {{.TESTS}}/
- poetry run coverage-badge -o assets/coverage.svg -f
typing:
cmd: poetry run pyright
typing-quality:
cmd: poetry run pyright --ignoreexternal --verifytypes nearness
safety:
cmds:
- poetry run safety check --full-report
- poetry run bandit -ll --recursive src/{{.PROJECT}} {{.TESTS}}
check:
cmds:
- task: lint
- task: typing
- task: test
- task: safety
build:
cmd: poetry build
publish:
cmd: poetry publish --skip-existing
sysinfo:
cmd: poetry run python .github/system_info.py