uv icon indicating copy to clipboard operation
uv copied to clipboard

`uv run -` should pipe input

Open charliermarsh opened this issue 1 year ago • 6 comments

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

charliermarsh avatar Aug 23 '24 15:08 charliermarsh

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

zanieb avatar Aug 23 '24 15:08 zanieb

Yeah makes sense, thanks.

charliermarsh avatar Aug 23 '24 15:08 charliermarsh

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.

charliermarsh avatar Aug 25 '24 15:08 charliermarsh

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.

zanieb avatar Aug 26 '24 16:08 zanieb

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

charliermarsh avatar Aug 26 '24 17:08 charliermarsh

It can!? What the heck, spec.

zanieb avatar Aug 26 '24 18:08 zanieb