-
Notifications
You must be signed in to change notification settings - Fork 21
/
tools.sh
executable file
·44 lines (37 loc) · 970 Bytes
/
tools.sh
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
#!/bin/bash
set -o errexit -o nounset -o pipefail
script_abspath="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Don't forget to update the version in setup.py, commit, tag and
# push tags.
cmd-deploy() {
# Clean out dist to avoid "file already exists" errors:
rm -f ./dist/*
source venv/bin/activate
python3 setup.py sdist bdist_wheel
python3 -m twine upload dist/*
}
cmd-dev-setup() {
python3 -m venv venv
source venv/bin/activate
pip install -r requirements-dev.txt
}
cmd-test() {
source venv/bin/activate
dirs=(
"grpc-stubs"
"grpc_channelz-stubs"
"grpc_health-stubs"
"grpc_reflection-stubs"
"grpc_status-stubs"
)
for dir in "${dirs[@]}"; do
pushd "$script_abspath/$dir" > /dev/null
echo "$dir"
mypy -- .
popd > /dev/null
done
# This test setup is based on the instructions here:
# https://sobolevn.me/2019/08/testing-mypy-types
pytest --mypy-ini-file=setup.cfg
}
"cmd-$1" "${@:2}"