-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathMakefile
More file actions
81 lines (63 loc) · 1.86 KB
/
Makefile
File metadata and controls
81 lines (63 loc) · 1.86 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
76
77
78
79
80
PYTHON := python3.13
VENV := .venv
BIN := $(VENV)/bin
UV := uv
PIP := $(BIN)/pip
STAMP_VENV := $(VENV)/.created
STAMP_DEPS := $(VENV)/.deps
.DEFAULT_GOAL := dev
$(STAMP_VENV):
$(UV) venv $(VENV)
touch $(STAMP_VENV)
.venv: $(STAMP_VENV)
$(STAMP_DEPS): $(STAMP_VENV) pyproject.toml
$(UV) pip install --python $(BIN)/python -e .
$(UV) pip install --python $(BIN)/python \
ruff \
pylint \
bandit
touch $(STAMP_DEPS)
deps: $(STAMP_DEPS)
dev: deps
@source $(BIN)/activate && \
[ -f local.env ] && source local.env || true && \
IRI_API_ADAPTER_facility=app.demo_adapter.DemoAdapter \
IRI_API_ADAPTER_status=app.demo_adapter.DemoAdapter \
IRI_API_ADAPTER_account=app.demo_adapter.DemoAdapter \
IRI_API_ADAPTER_compute=app.demo_adapter.DemoAdapter \
IRI_API_ADAPTER_filesystem=app.demo_adapter.DemoAdapter \
IRI_API_ADAPTER_task=app.demo_adapter.DemoAdapter \
DEMO_QUEUE_UPDATE_SECS=2 \
OPENTELEMETRY_ENABLED=true \
API_URL_ROOT='http://localhost:8000' fastapi dev
.PHONY: clean
clean:
rm -rf iri_sandbox
rm -rf .venv
# Format and lint
format: deps
$(BIN)/ruff format --line-length 200 .
ruff: deps
$(BIN)/ruff check . --fix || true
pylint: deps
find . -path ./$(VENV) -prune -o -type f -name "*.py" -print0 | while IFS= read -r -d '' f; do \
echo "Pylint $$f"; \
$(BIN)/pylint $$f --rcfile pylintrc || true; \
done
# Security
audit: deps
uv pip compile pyproject.toml -o requirements.txt
uv pip sync requirements.txt
uv pip install pip-audit
$(BIN)/pip-audit || true
rm -f requirements.txt
bandit: deps
$(BIN)/bandit -r app || true
# Full validation bundle
lint: clean format ruff pylint audit bandit
globus: deps
@source local.env && $(BIN)/python ./tools/globus.py
ARGS ?=
# call it via: make manage-globus ARGS=scopes-show
manage-globus: deps
@source local.env && $(BIN)/python ./tools/manage_globus.py $(ARGS)