astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.97k stars 619 forks source link

`uv run -` should pipe input #6529

Open charliermarsh opened 1 month ago

charliermarsh commented 1 month ago

See: https://github.com/astral-sh/uv/pull/6481#discussion_r1728931167

zanieb commented 1 month ago

Is this performance? I'm not sure. Memory usage at least.

charliermarsh commented 1 month ago

Yeah makes sense, thanks.

charliermarsh commented 1 month ago

I think we can't do this if we want to support tool.uv settings in scripts from stdin... Which we probably should? Since, in that case, we need to extract the settings before we run it.

zanieb commented 4 weeks ago

I think we'd just need to read until we finish the scripts block then stream the rest via a pipe — which is a bit more complicated but seems pretty reasonable. I don't think this is high priority until someone encounters a problem with storing the entire file in memory.

charliermarsh commented 4 weeks ago

The scripts block can be anywhere in the file, so we'd have to read the whole thing in the negative case :joy:

zanieb commented 4 weeks ago

It can!? What the heck, spec.