-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathrun
More file actions
executable file
路71 lines (58 loc) 路 1.38 KB
/
Copy pathrun
File metadata and controls
executable file
路71 lines (58 loc) 路 1.38 KB
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
#!/usr/bin/env bash
set -o errexit
set -o pipefail
TIMEFORMAT="Task completed in %3lR"
BIN="./.venv/bin"
function help {
echo "Options:"
echo " check: Formatting checks"
echo " clean: Clean all build and test directories, as well as extraneous artificats"
echo " cov: Run tests with code coverage"
echo " docs: Build the documentation"
echo " format: Run formatter"
echo " init: Setup dev environment"
echo " lint: Linter"
echo " test: Execute tests"
}
function init {
python3 -m venv --prompt sw venv
"${BIN}/python" -m pip install -e ".[dev,test,docs]"
}
function lint {
"${BIN}/ruff" check swingtime demo tests
}
function check {
"${BIN}/ruff" format --check swingtime demo tests
}
function format {
"${BIN}/ruff" format swingtime demo tests
}
function test {
"${BIN}/pytest" -s tests "$@"
}
function cov {
"${BIN}/pytest" --cov-report html --cov-report term --cov=swingtime
}
function clean {
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
rm -f demo/karate.db .coverage
rm -rf \
.tox \
.pytest_cache \
build \
django_swingtime.egg-info \
dist
}
function docs {
pushd docs
make html
popd
}
if [ -z "$1" ]; then
help
else
what=$1
shift
time ${what:-help} "$@"
fi