Who has wise guidance for using python scripts in the post Debian 12* world with packages that haven't been packaged for `apt install python3-whatever`?
-
Who has wise guidance for using python scripts in the post Debian 12* world with packages that haven't been packaged for `apt install python3-whatever`? (e.g. all of the google-cloud stuff)
venvs seem clumsy for the task, but doing a bunch of `pip install --break-system-packages` is also obviously bad.
Either my Google foo is weak here, or this is an elephant in the room that's being studiously ignored.
* also Raspberry Pi OS Bookworm, Ubuntu 24,04 etc.
@simon I'd value your thought?
-
@cpswan it’s still very new but this sounds like something uv might be great for
-
@simon I _love_ uv, but it just does all the venv stuff faster, and I'm not sure that's the right track for the places where we're using Python rather than bash (more sophisticated shell scripts for ops stuff).
There's a bit of me kind of wishes that the 'system' had gotten it's own damn venv and left the default namespace to be messed up however us muggles see fit.
-
@cpswan uv grew way beyond venv/pip a couple of months ago - it can now manage Python versions too, and do a neat trick where dependencies can be defined in the script itself https://docs.astral.sh/uv/guides/scripts/#declaring-script-dependencies
-
Simon Willisonreplied to Simon Willison last edited by
@cpswan “uv run script.py” where that script has a comment that lists the dependencies it needs might be a really good fit for ops scripts