-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (56 loc) · 1.88 KB
/
Makefile
File metadata and controls
75 lines (56 loc) · 1.88 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
73
74
75
# Default Python interpreter can be overridden: `make test PYTHON=$(which python3)`
PYTHON ?=
VENV ?= venv
STAMP_DIR ?= .stamps
DEV_STAMP := $(STAMP_DIR)/dev.stamp
.PHONY: all setup deps test lint coverage build wheel sdist install probe clean
all: test
$(STAMP_DIR):
@mkdir -p $(STAMP_DIR)
$(VENV):
@python3 -m venv $(VENV)
$(DEV_STAMP): pyproject.toml | $(STAMP_DIR) $(VENV)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
PIP_CMD="$$PYTHON -m pip"; \
$$PIP_CMD install --upgrade pip; \
$$PIP_CMD install -e .[dev]; \
touch $(DEV_STAMP)
setup: $(DEV_STAMP)
deps: setup
test: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m pytest
lint: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m compileall src tests
coverage: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m pytest --cov=src/gratekeeper --cov-report=term-missing
build: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m pip install --upgrade build; \
$$PYTHON -m build
wheel: build
sdist: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m pip install --upgrade build; \
$$PYTHON -m build --sdist
install: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON -m pip install --force-reinstall .
probe: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
$$PYTHON scripts/rate_limit_probe.py --help
demo: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
GRATEKEEPER_RUN_DEMOS=1 GITHUB_TOKEN=$$GITHUB_TOKEN $$PYTHON scripts/run_demo_scenarios.py
demo-test: $(DEV_STAMP)
@PYTHON=$${PYTHON:-$(VENV)/bin/python3}; \
GRATEKEEPER_RUN_DEMOS=1 GITHUB_TOKEN=$$GITHUB_TOKEN $$PYTHON -m pytest -m demo
demo-ui:
@./scripts/run_dashboard_demo.sh
demo-ui-gif: demo-ui
vhs render demo.cast --output demo.gif
clean:
@rm -rf $(STAMP_DIR) dist *.egg-info .pytest_cache
@find . -name "__pycache__" -type d -prune -exec rm -rf {} +