News for hackers. Stuff that matters.
Re:Things I've learned about building CLI tools in Python by xavdid on Wednesday October 25, 2023 @02:56AM (#38009996)
I recommend pipx (https://pypa.github.io/pipx/) for this to get the same basic result. While it's not a pre-compiled binary, it is a standalone installation that takes care of dependencies and virtual virtual environments in a way that the user never has to think about them. As far as they're concerned, they `pipx install ...` and it "just works".
Re:Things I've learned about building CLI tools in Python by zuck_vs_musk on Wednesday October 25, 2023 @03:20AM (#38010133)
What if you are on Python 3.10 and the Python code was built using Python 3.11 features? I don't think `pipx` would work in that case.
Re:Things I've learned about building CLI tools in Python by xavdid on Wednesday October 25, 2023 @03:28AM (#38010188)
IIRC pipx uses your local Python version. So in your example, you'd need to `pipx install` while py 3.11 was active.

Certainly not ideal, but I find it's unusual for a tool to require a super-new version. Plus, `pyenv` makes it easy enough to install multiple versions in parallel and run commands under specific versions.

Sure, it would be better if this whole process wasn't so complicated, but I find it's pretty workable overall.

Re:Things I've learned about building CLI tools in Python by tspng on Wednesday October 25, 2023 @04:14AM (#38010479)
You'd need to install 3.11 first. When installing a package with pipx you can specify what other Python installation to use, if it's not the default one.
Re:Things I've learned about building CLI tools in Python by dikei on Wednesday October 25, 2023 @05:20AM (#38010876)
By default, pipx use the python it's installed with, but you can change the python interpreter for each installed application.