Skip to content

Commit 644291e

Browse files
committed
SEP-1652: Run check_nomad_payload_size via venv make target
Add make check-nomad-payload-size and a clear import error when python_minifier is missing from the active Python interpreter.
1 parent b5868da commit 644291e

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,9 @@ regen-pbm-payloads: venv
195195
regen-pbm-payloads-check: venv
196196
@$(DARWIN_DYLD) "${VENV_BIN}"/python scripts/gen_pbm_payloads.py --check
197197

198+
check-nomad-payload-size: venv
199+
@$(DARWIN_DYLD) "${VENV_BIN}"/python scripts/check_nomad_payload_size.py $(ARGS)
200+
198201
changelog-add:
199202
ifndef TICKET
200203
$(error TICKET is required. Usage: make changelog-add TICKET=SEP-XXX SECTION=added MSG="description")

scripts/check_nomad_payload_size.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,14 @@
2222
import io
2323
import sys
2424

25-
from python_minifier import minify
25+
try:
26+
from python_minifier import minify
27+
except ModuleNotFoundError:
28+
sys.exit(
29+
"python_minifier is not installed for this Python interpreter.\n"
30+
"Use the project venv: venv/bin/python scripts/check_nomad_payload_size.py ...\n"
31+
"Or: make check-nomad-payload-size ARGS='--report <path>...'"
32+
)
2633

2734
NOMAD_PAYLOAD_SIZE_LIMIT = 16384
2835

0 commit comments

Comments
 (0)