-
Notifications
You must be signed in to change notification settings - Fork 1
/
makefile
53 lines (36 loc) · 946 Bytes
/
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
SOURCES = $(wildcard *.py)
TESTS = $(wildcard tests/*.py)
all: lint test
run: $(SOURCES)
python3.8 pyflamegraph.py tests/test_cases/simple.dtrace
# N.B. We run black on the test suite to format it, but we don't type check
# or lint it because that seems unnecessary
lint: black mypy pylint
black: $(SOURCES:.py=.py.black) $(TESTS:.py=.py.black)
%.py.black: %.py
black $<
touch $@
mypy: $(SOURCES:.py=.py.mypy)
%.py.mypy: %.py
mypy $<
touch $@
pylint: $(SOURCES:.py=.py.pylint)
%.py.pylint: %.py
pylint $<
touch $@
test: $(SOURCES) $(TESTS)
pytest
clean:
rm -f *.py.black
rm -f *.py.mypy
rm -f *.py.pylint
rm -f tests/*.py.black
rm -f tests/*.py.mypy
rm -f tests/*.py.pylint
rm -rf .mypy_cache
rm -rf .pytest_cache
rm -rf __pycache__
rm -rf tests/__pycache__
#python3 flamegraph/prof.py
#python3 -m cProfile -o stacktrace.prof flamegraph/stacktrace.py | tee output
#python3 flamegraph/stacktrace.py | tee output