Live data from Hacker News

Switching from Pyenv to Uv

bluesock.org

31–40 of 239 posts

Re: Switching from Pyenv to Uv

#32
The functionalities of three tooling projects, namely uv, ruff (linter), and pyright (type checker) need to merge and become mandatory for new Python projects. Together they will bring some limited sanity to Python.

Re: Switching from Pyenv to Uv

#33
post #13

15 year Python dev who usually adopts tooling slowly. Just do it, uv's absolutely worth it. I also use mise with it, which is a great combination and gives you automatic venv activation among other things. See, among other mise docs related to Python, https://mise.jdx.dev/mise-cookbook/python.html See also a Python project template I maintain built on mise + uv: https://github.com/level12/coppy

ideally mise could be replaced entirely by uv or at least just be a thin wrapper around uv (in some ways that's already the case), but given this article requires the use of the custom uv-python-symlink utility it seems uv isn't quite there yet

Re: Switching from Pyenv to Uv

#34
post #27

I wasn’t able to figure how to make a uv installed python version a global when “python” is called, at least in the current shell, as I need it in CI.

That feature's in preview now. You can run it like:

  uv python install --preview --default 3.13
and then you get Python 3.13 whenever you run `python` outside of an environment that declares something else.

Re: Switching from Pyenv to Uv

#35
post #27

I wasn’t able to figure how to make a uv installed python version a global when “python” is called, at least in the current shell, as I need it in CI.

That feature's in preview now. You can run it like: uv python install --preview --default 3.13 and then you get Python 3.13 whenever you run `python` outside of an environment that declares something else.

Thank you!! Will try it tomorrow.

Re: Switching from Pyenv to Uv

#36

I highly, highly recommend uv. It solves & installs dependencies incredibly fast, and the CLI is very intuitive once you've memorized a couple commands. It handles monorepos well with the "workspaces" concept, it can replace pipx with "uv tool install," handle building & publishing, and the docker image is great, you just add a FROM line to the top and copy the bin from /uv. I've used 'em all, pip + virtualenv, conda…

The install speed alone makes it worthwhile for me. It went from minutes to seconds.

Re: Switching from Pyenv to Uv

#37

[flagged]

You're being downvoted (for snark presumably) but you have a point. During my tenures as a Python developer I've had to deal with pip, pipx, venv, pipenv, setuptools, conda, and poetry. I'd not heard of pyenv or uv until this thread (or maybe I've touched pyenv and got it confused with one of the 7 other tools I mentioned) and I'm sure there are other dependency/environment management tools floating around that I mis…

In the past 10 years, virtualenv and pip have been perfectly fine for me. They still are. I ignored any new tooling.

uv is great so far, I did run into a hiccup where moving from pip with a requirements.txt file to uv slowed a CI pipeline way down that I had to revert.

Re: Switching from Pyenv to Uv

#38
post #35

Earlier quoted context omitted.

That feature's in preview now. You can run it like: uv python install --preview --default 3.13 and then you get Python 3.13 whenever you run `python` outside of an environment that declares something else.

Thank you!! Will try it tomorrow.

You bet. I was so happy to find that!

Re: Switching from Pyenv to Uv

#39

Maybe this one will finally be adopted as the official package manager for Python? Only 20 years late, but it would be a nice development.

Pfft. Pull the other one. The PSF hates the idea of dealing with something so icky.

I have been pretty pleased with uv, but I am continually worried about the funding model. What happens when the VC starts demanding a return?

Re: Switching from Pyenv to Uv

#40

Uv really fixes Python. It takes it from "oh god I have to fight Python again" to "wow it was actually fast and easy". I think all the other projects (pyenv, poetry, pip, etc.) should voluntarily retire for the good of Python. If everyone moved to Uv right now, Python would be in a far better place. I'm serious. (It's not going to happen though because the Python community has no taste.) The only very minor issue I'v…

Agree. I mostly do front end in my day job, and despite JavaScript being a bit of a mess lang, dealing with npm is way better than juggling anaconda, miniforge, Poetry, pip, venv, etc depending on the project.

UV is such a smooth UX that it makes you wonder how something like it wasn’t part of Python from the start.

Post reply on HN