chore(examples): add -S to env shebangs for portability - #3210
chore(examples): add -S to env shebangs for portability#3210lucky-verma wants to merge 1 commit into
Conversation
|
Good portability cleanup. |
317260c to
e67afa8
Compare
jbeckwith-oai
left a comment
There was a problem hiding this comment.
One same-class executable shebang is still missing from this portability sweep: examples/realtime/push_to_talk_app.py:1 remains #!/usr/bin/env uv run (mode 100755). On Linux, the kernel passes uv run as one argument and GNU env tries to find an executable with that literal name, so direct invocation fails with the same error these four edits fix. Please change it to #!/usr/bin/env -S uv run as well. The four modified Rye shebangs, executable modes, Ruff/format checks, and compile validation are otherwise clean.
Five executable examples use an env shebang without the -S flag: examples/audio.py examples/speech_to_text.py examples/text_to_speech.py examples/realtime/realtime.py examples/realtime/push_to_talk_app.py CONTRIBUTING.md shows the canonical form as #!/usr/bin/env -S rye run python. Without -S the kernel passes the whole interpreter string to env as one argument, so env looks for a program named 'rye run python' and the script fails. This affects GNU env as well as BSD env. The first four use the rye shebang; push_to_talk_app.py has the same defect with 'uv run'. Only shebang lines change; executable modes are unchanged.
dd7db2c to
ae028fc
Compare
|
added |
five executable examples use an env shebang without
-S:added
push_to_talk_app.pyper your review. i checked every mode-100755 file underexamples/and those five are the only ones missing-S. (azure.py,azure_ad.pyandmodule_client.pyare 755 with no shebang at all — different issue, left alone.)also correcting myself: i said linux env splits the args so this only broke on older BSD. that's wrong, it fails there too — on coreutils 9.4
./examples/audio.pygivesenv: 'rye run python': No such file or directory.only shebang lines change. modes unchanged, ruff check + format clean on all five.