forked from ValvePython/steam
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
72 lines (52 loc) · 1.98 KB
/
Copy pathMakefile
File metadata and controls
72 lines (52 loc) · 1.98 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
72
define HELPBODY
Available commands:
make help - this thing.
make init - install python dependancies
make test - run tests and coverage
make pylint - code analysis
make build - pylint + test
make pb_fetch - fetch protobufs from SteamRE
make pb_compile - compile with protoc
make pb_clear - removes *.proto
make pb_update - pb_fetch + pb_compile
make webauth_gen - generate vcr cassettes for webauth tests
endef
SHELL := /bin/bash
export HELPBODY
help:
@echo "$$HELPBODY"
init:
pipx install poetry
poetry install --extras client --with dev
test:
pytest --cov=steam
build:
poetry build
clean:
rm -rf dist steam.egg-info steam/*.pyc
webauth_gen:
rm -f vcr/webauth*
python3 tests/generete_webauth_vcr.py
pb_fetch:
wget -nv --show-progress -N -P ./protobufs/ -i protobuf_list.txt || exit 0
for FN in protobufs/*.steamclient.proto; do \
mv "$${FN}" "$${FN/.steamclient.proto/.proto}"; \
done;
sed -i '1s/^/syntax = "proto2"\;\n/' protobufs/*.proto
sed -i 's/cc_generic_services/py_generic_services/' protobufs/*.proto
sed -i 's/\.steamclient\.proto/.proto/' protobufs/*.proto
pb_compile:
for filepath in protobufs/*.proto protobufs/tests/*.proto; do \
protoc --python_out steam/protobufs/ --proto_path=protobufs "$$filepath"; \
done;
sed -i '/^import sys/! s/^import /import steam.protobufs./' steam/protobufs/*_pb2.py
pb_clear:
rm -f protobufs/*.proto steam/protobufs/*_pb2.py
pb_services:
grep -B 99999 MARK_SERVICE_START steam/core/msg/unified.py > steam/core/msg/unified.py.tmp
grep '^service' protobufs/*.proto | tr '/.:' ' ' | awk '{ printf(" %-35s '\''steam.protobufs.%s_pb2'\'',\n", "'\''" $$5 "'\'':", $$2) }' >> steam/core/msg/unified.py.tmp
grep -A 99999 MARK_SERVICE_END steam/core/msg/unified.py >> steam/core/msg/unified.py.tmp
mv steam/core/msg/unified.py.tmp steam/core/msg/unified.py
pb_gen_enums:
python3 generate_enums_from_proto.py > steam/enums/proto.py
pb_update: pb_clear pb_fetch pb_compile pb_services pb_gen_enums