-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
31 lines (22 loc) · 1.07 KB
/
Makefile
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
PROTO_SOURCES = $(wildcard protos/*.proto)
PROTO_CLASSES = $(patsubst protos/%.proto,keynote_parser/generated/%_pb2.py,$(PROTO_SOURCES))
.PHONY: all clean install test
all: $(PROTO_CLASSES) keynote_parser/generated/__init__.py
install: $(PROTO_CLASSES) keynote_parser/generated/__init__.py keynote_parser/*
python3 setup.py install
upload: $(PROTO_CLASSES) keynote_parser/generated/__init__.py keynote_parser/*
python3 setup.py upload
keynote_parser/generated:
mkdir -p keynote_parser/generated
keynote_parser/generated/%_pb2.py: protos/%.proto keynote_parser/generated
protoc -I=protos --proto_path protos --python_out=keynote_parser/generated $<
keynote_parser/generated/__init__.py: keynote_parser/generated $(PROTO_CLASSES)
touch $@
# Huge hack for py3 support, see https://github.com/protocolbuffers/protobuf/issues/1491
futurize --no-diffs --nobackups --both-stages --processes 4 -w keynote_parser/generated/
clean:
rm -rf keynote_parser/generated
rm -rf keynote_parser.egg_info
rm -rf dist
test: all
python3 -m pytest . --cov=keynote_parser -W ignore::DeprecationWarning