Repository navigation
Add Python 3 to the image for scripts and tasks - #15
Merged
Merged
Conversation
Claude reaches for Python for anything beyond a one-liner (parsing JSON or logs, date arithmetic, sums), and the attempt failed because the image had none. python3 from Debian is added: the standard library only, no pip. The base instructions say so and tell Claude to run Python in the container and feed it from the server. The shell tests, which need python3, now run in the image as it is.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The image had
bash,jq,perland Bun, but no Python. Claude reaches for Python for anything beyond a one-liner (parsing JSON or logs, date arithmetic, sums over SMART or pool data), so that attempt failed and it had to retry withjqorawk. Task scripts with real logic were harder to write and to read than they need to be.Change
python3from Debian's packages (3.11 on bookworm). The standard library only; nopip.pipso nothing is to be installed, run Python in the container and feed it from the server (host … | python3 -c '…') instead ofhost python3, and a Python block inside a task'scheck.shis fine because the owner approves it with the script.pipis absent.A
python3 …command asks for approval like any other command that is not on the allow list. The image already hadperland Bun, so this adds no new kind of capability.Size
The image grows from 658 MB to 692 MB.
Testing
Built and deployed on the dev server:
python3runs in the container and parses output piped from ahostcommand;pipandpip3are absent.CLAUDE.md.tests/run.shruns in the image as it is (it needed python3 installed by hand before): all 489 pass. The 129 bridge tests pass.