-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
42 lines (36 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
42 lines (36 loc) · 1.45 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
PYTHON ?= python3
RUN_DIR ?= /tmp/patchproof-demo
IMAGE ?= python:3.12.10-slim@sha256:fd95fa221297a88e1cf49c55ec1828edd7c5a428187e67b5d1805692d11588db
BOTTLE_REPO ?= /tmp/patchproof-bottle
BOTTLE_AUDIT_DIR ?= /tmp/patchproof-bottle-audit
.PHONY: test demo-local demo bottle-local clean
test:
PYTHONPATH=src $(PYTHON) -m unittest discover -s tests -v
demo-local:
PYTHONPATH=src $(PYTHON) scripts/run_demo.py
bottle-local:
PYTHONPATH=src $(PYTHON) integrations/bottle-http-preconditions/run_case.py \
--repo $(BOTTLE_REPO) \
--audit-dir $(BOTTLE_AUDIT_DIR) \
--unsafe-local
demo:
PYTHONPATH=src $(PYTHON) -m patchproof propose \
--repo fixtures/calculator \
--diff fixtures/division-by-zero.diff \
--out $(RUN_DIR)/proposal.json
PYTHONPATH=src $(PYTHON) -m patchproof approve \
--proposal $(RUN_DIR)/proposal.json \
--proposal-hash "$$(PYTHONPATH=src $(PYTHON) -c 'import json; print(json.load(open("$(RUN_DIR)/proposal.json"))["proposal_hash"])')" \
--run-id demo \
--approved-by local-demo \
--out $(RUN_DIR)/approval.json
PYTHONPATH=src $(PYTHON) -m patchproof validate \
--repo fixtures/calculator \
--proposal $(RUN_DIR)/proposal.json \
--approval $(RUN_DIR)/approval.json \
--reproduction-tests fixtures/reproduction \
--hidden-tests fixtures/hidden \
--audit-dir $(RUN_DIR)/audit \
--docker-image $(IMAGE)
clean:
$(PYTHON) -c 'import shutil; shutil.rmtree("build", ignore_errors=True); shutil.rmtree("dist", ignore_errors=True)'