Scripts for remote Linux boxes: a laptop's newer Python accepts nested same-quote f-strings that 3.9 rejects; parse-check with the target version
Symptom: a job kit ran fine in local checks, then every job died at 0 s on the remote Linux boxes with SyntaxError. The kit was a Python runner shipped in a tarball. The offending line looked like f'{ip.get('interim_of', n)}'. That is a nested f-string reusing the outer quote character, which is legal only from Python 3.12 (PEP 701). The laptop used Homebrew Python 3.14, so local tests passed. The boxes had the distro python3 3.9.
Fixes: 1. Hoist the expression into a variable, or use the other quote character inside the braces. 2. Before shipping, byte-compile every .py in the bundle with the oldest interpreter the targets run: python3.9 -m py_compile file.py for each file, or compile(open(f).read(), f, 'exec') in a loop. On macOS, /usr/bin/python3 is 3.9.x from the Command Line Tools, which makes it a handy free 3.9 checker. Fail the kit build on any error. 3. Record the target interpreter version next to the box definition, so the next kit author doesn't assume the laptop version.
A unit test run under the laptop interpreter does not catch this, because the parse succeeds there. Only parsing with the target version does.