cosmopolitan icon indicating copy to clipboard operation
cosmopolitan copied to clipboard

Idea: uvfile (`uv` + embedded Python script, similar to llamafile)

Open phirsch opened this issue 8 months ago • 1 comments

Feel free to close if too wild/off-topic.

I was wondering whether there would be a place for something similar to llamafile (i.e. bundling an APE executable along with data), but applied to uv.

This would allow to distribute stand-alone python scripts as single-file multi-platform executables. Since uv already accepts self-describing Python files including PEP-723 metadata headers to specify dependencies, and it is a standalone static binary, it looks like an ideal basis for this kind of tool (which I haven't seen implemented anywhere yet).

Any thoughts?

phirsch avatar Apr 12 '25 10:04 phirsch

You can download Python as an APE binary from here: https://cosmo.zip/pub/cosmos/bin/

Doing something with uv is currently blocked on cosmo+rust support. https://ahgamut.github.io/2022/07/27/ape-rust-example/ We've had limited success with it in the past. But I predict it'll finally happen by the end of the year. So keep following the project and we'll be able to take care of you soon enough.

jart avatar Apr 15 '25 04:04 jart