HACKER Q&A
📣 oulipo

Best practice to distribute private Python CLI tools in a team


I'm wondering what would be the best practice today to distribute a CLI tool to an internal team?

I think `uv` with `uv tool` and `uv tool upgrade` might be quite interesting, coupled with either private git repo, or a private pip repo

is there a way to package the python app so that people in the team are not required to have a working Python installation at first? to avoid issues with dependencies, or "doesn't work on my machine", etc?

also is there a "best practice" or existing lib for the python program to auto-detect that the package has a newer version (eg a new Github release) and then when quitting tells the user "A new version is available, run `mytool --update` to update"?


  👤 franktankbank Accepted Answer ✓
I'd build it around pip and just accept that your users will have to install python and do the one-time pip install. Just do

pip install -U

to get the latest.


👤 philomath_mn
Can you easily combine it into one file? You could use PEP 723 and `uv`'s script running capability [0].

If your project is not flat, you could have a "build" step to combine everything into one file (assuming everything is simple).

`uv tool` would be great but you'd need to manage a private repo and credentials -- the "it just works" magic kinda goes away at that point.

[0] https://docs.astral.sh/uv/guides/scripts/#declaring-script-d...


👤 oulipo
So after looking for many alternatives, I think what I'd do now is use `mise` and/or `aqua` which seem well-designed exactly for that purpose, and can handle various stacks (python, js, etc)

👤 __d
I use PyInstaller to distribute a Qt5-based GUI app, and some associated CLI tools. It's fairly easy to configure, and works out fine.

👤 toomuchtodo
Docker container? It’s heavier but requires no local env considerations.