forked from postlund/pyatv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_dev_env.sh
executable file
·84 lines (54 loc) · 1.49 KB
/
setup_dev_env.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
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
#!/bin/bash
set -e
PYTHON="python3.7 python3.6 python3.5"
found_version=
for p in $PYTHON
do
which $p 2>&1 > /dev/null
if [ $? -eq 0 ]; then
found_version=$p
break
fi
done
set -e
if [ -z $found_version ]; then
>&2 echo "no python installation found"
exit 1
fi
echo "-> Using python: $found_version"
echo "-> Creating python virtual environment..."
virtualenv -p $found_version .
echo "-> Activating virtual environment..."
source bin/activate
echo "-> Upgrading pip..."
pip install --upgrade pip
echo "-> Installing library as develop..."
python setup.py develop
echo "-> Installing protobuf-setuptools..."
pip install protobuf-setuptools
echo "-> Installing test dependencies..."
pip install -r requirements_test.txt
pip install tox
echo "-> Running tests as verification..."
python setup.py test
echo "-> Generating documentation..."
cd docs && make html
cat <<EOF
==================================================
When starting a new shell, run:
source bin/activate
To run tests, run any of:
python setup.py test
py.test tests/test_conf.py # Single test
To re-generate protobuf messages:
./scripts/build_proto.sh
The CLI application can be used, e.g. run:
atvremote --debug -a commands
atvremote --developer --debug -a dev_playstatus
HTML documentation has been generated in:
docs/generated/html
To re-generate documentation, e.g. run:
make -C docs html
==================================================
Environment is configured and ready to use!
EOF