snekbox
snekbox copied to clipboard
Multiple binary support api
This allows setting a binary_path key in the request body to /eval to specify which binary to run under.
If not supplied, it defaults to "/lang/python/default/bin/python"
if supplied, snekbox ensures that the path is within /lang (to avoid executing arbitrary binaries on the fs) and that the file exists.
This PR also comes with two unrelated changes
- https://github.com/python-discord/snekbox/pull/196/commits/07ddd848fd1d72feb72578d68416fc74e18a197f was needed as previous we were dropping the text after the last period when creating the path to install Python to. However, for 3.13-dev this would result in it being installed into
/lang/3. Instead, we now split on the last.or the last- - https://github.com/python-discord/snekbox/pull/196/commits/84b5928f95f09a5798e1a404e8f82c5392227c28 which is required when building 3.13-dev right now.
- https://github.com/python-discord/snekbox/pull/196/commits/5f67817e1314f429007ffd1efad53495f5c09e85 which was needed to get pre-commit running on my local machine
coverage: 89.158% (-1.7%) from 90.826% when pulling b58f98bd5127cac43cba4dcff66f9d7a01527576 on multi-version-api into b276a04f2cb9b2e974b84b66719b2b0984f3a800 on main.
I plan to pick this PR up soon just had time to rebase this evening
Hey how's this PR going? It would be very useful for a project I'm working on.
Now ready for (re)review