docs(agents): never use Python; tests and guards use bash and jq #272

Merged
binjovi-bot merged 1 commit from sean/never-python into trunk 2026-09-10 13:28:04 +00:00 AGit
Owner

Python is present in these images whether anyone asks or not: on AlmaLinux 10 dnf IS Python (/usr/bin/dnf is a symlink to dnf-3, dnf5 is not packaged for this release), so the interpreter and fourteen python3 rpms arrive with the package manager. Measured: elixir-builder:v2 answers python3 3.12.13 although no line in its Dockerfile installs it. Its presence is not permission. The cost is start-up and it compounds: over 200 iterations python3 starts in 18 ms, 21 ms once it imports json/os/sys/urllib, against 2.7 ms for jq -- 7.6 times. One test file starts its Python fake-mc fixture 2,806 times in a single run, counted by instrumenting the fixture; at 21 ms that is about 59 seconds of interpreter start-up inside a 112-second test, and most of the 69 seconds of CPU it costs. Tests, guards and fixtures use bash and jq. https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76

Python is present in these images whether anyone asks or not: on AlmaLinux 10 dnf IS Python (/usr/bin/dnf is a symlink to dnf-3, dnf5 is not packaged for this release), so the interpreter and fourteen python3 rpms arrive with the package manager. Measured: elixir-builder:v2 answers python3 3.12.13 although no line in its Dockerfile installs it. Its presence is not permission. The cost is start-up and it compounds: over 200 iterations python3 starts in 18 ms, 21 ms once it imports json/os/sys/urllib, against 2.7 ms for jq -- 7.6 times. One test file starts its Python fake-mc fixture 2,806 times in a single run, counted by instrumenting the fixture; at 21 ms that is about 59 seconds of interpreter start-up inside a 112-second test, and most of the 69 seconds of CPU it costs. Tests, guards and fixtures use bash and jq. https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76
docs(agents): never use Python; tests and guards use bash and jq
All checks were successful
binjovi/ci Binjovi completed the frozen plan
f401683023
WHY THIS IS A RULE AND NOT A PREFERENCE. Python is present in these images
whether anyone asks for it or not. On AlmaLinux 10 `dnf` IS Python:
/usr/bin/dnf is a symlink to dnf-3, dnf5 is not packaged for this release, and
so the interpreter plus fourteen python3 rpms arrive with the package manager.
Measured, not assumed: elixir-builder:v2 answers `python3 --version` with
3.12.13 although no line in its Dockerfile installs it. An interpreter that is
merely present gets used, and its presence is not permission.

THE COST IS START-UP, AND IT COMPOUNDS. Measured on this fleet, 200 iterations
each: python3 starts in 18 ms, and 21 ms once it imports json, os, sys and
urllib. jq starts in 2.7 ms. That is 7.6 times.

One test file, tests/object-store-converge-test.py, starts its Python fake-mc
fixture 2,806 times in a single run -- counted, by instrumenting the fixture.
At 21 ms that is about 59 seconds of interpreter start-up inside a
112-second test, and it accounts for most of the 69 seconds of CPU the run
costs. The tests are not slow because they do much. They are slow because they
start an interpreter three thousand times.

jq reads the JSON these tests handle, and it is the tool to reach for.

Claude-Session: https://claude.ai/code/session_01KZoQin34jeyt6nDGqvJA76
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sean/builder-images!272
No description provided.