Live data from Hacker News

Switching from Pyenv to Uv

bluesock.org

221–230 of 239 posts

Re: Switching from Pyenv to Uv

#222
post #193
post #172

Earlier quoted context omitted.

Why would you be redoing your venv more than once?

Once rebuilding your venv takes negligible time, it opens up for all kinds of new ways to develop. For example I now always run my tests in a clean environment, just to make sure I haven't added anything that only happens to work in my dev venv.

I thought you wanted to test your program, but seems you want to make sure that your unzip library keeps working :D

Re: Switching from Pyenv to Uv

#223
post #172

Earlier quoted context omitted.

Why would you be redoing your venv more than once?

It has nothing to do with redoing venv: some package installs were just taking multiple minutes. I cancelled one at 4 minutes before switching to uv and having it finish in a few seconds

If only linux distributions had existed for decades…

Re: Switching from Pyenv to Uv

#224

Earlier quoted context omitted.

sync is something you would rarely use, it's most useful for scripting. uv run is the bread and meat of uv, it will run any command you need in the project, and ensure it will work by synching all deps and making sure your command can import stuff and call python. In fact, if you run a python script, you should do uv run python the_script.py, It's so common uv run the_script.py will work as a shortcut. I will write a…

Did you mean group and not sync? Really looking forward to the articles!

Sorry i misread and stayed on sync. Group and extras are for lib makers to create sets of optionals dependenacies. Groups are private ones for maintainers, extras are oublic one for users.

Re: Switching from Pyenv to Uv

#225

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…

Did you try pixi [1] too?

[1] https://pixi.sh/latest/

Re: Switching from Pyenv to Uv

#226
post #192

Earlier quoted context omitted.

It probably is. Just try it is the advice.

That's unhelpful. To answer my own question—and to actually help other people with similar use cases—I read about uv's build process and dependency locking. It does not appear to be able to lock dependencies for build distributions (wheels). https://docs.astral.sh/uv/concepts/projects/build/ https://docs.astral.sh/uv/pip/compile/ However, it does mention that Python supports multiple build systems, which I didn't kno…

If your time is so precious that you complain about wasting it here, I don't know what to tell you, but glad you aren't going back empty handed!

Re: Switching from Pyenv to Uv

#227

Earlier quoted context omitted.

Tool ? Maybe you mean uv tool install ? In that case it's something you don't need right now, uv tool is useful, but it's a bonus. It's to install 3rd party utilities outside of the project. There is no equivalent to script yets, althought they are adding it as we speak. uv run exec any command in the context of the venv (which is like a node_modules), you don't need to declare them prior to calling them. e.g: uv run…

I was looking at https://docs.astral.sh/uv/concepts/tools/#the-uv-tool-interf... Edit: I get it now. It's like npm's `npx` command.

uvx is the npx equivalent, it's provided with ux, and also has some nice bonuses.

Re: Switching from Pyenv to Uv

#228

Earlier quoted context omitted.

I'm pretty much with you and still trying to figure out why I want to switch away from pyenv+poetry. I get that uv does both, but I'm very happy with pyenv+poetry combo. Old baggage, but I came from the rvm world which attempted to do exactly what uv does, but rvm was an absolute mess in 2013. rbenv+bundler solved so many problems for me and the experience was so bad that when I saw uv my gut reaction was to say "nev…

Uv dependency solving is light years faster than poetry. If you are working on actual projects with many dependencies, poetry is a liability

You are right that it is faster but how often you are running dependency update? It will take more time to ensure that new dependencies did not break anything than doing upgrade.

Re: Switching from Pyenv to Uv

#229

Earlier quoted context omitted.

Uv dependency solving is light years faster than poetry. If you are working on actual projects with many dependencies, poetry is a liability

You are right that it is faster but how often you are running dependency update? It will take more time to ensure that new dependencies did not break anything than doing upgrade.

It should, but if you are using poetry and say you forgot to pin boto to a specific version, your entire day might be spent waiting for poetry to solve.

Re: Switching from Pyenv to Uv

#230
post #11

Earlier quoted context omitted.

I don't know how complex your project is but I moved my previous work from pyenv to rye(UV and rye have merged, most work is being done on uv, today I'd probably use UV) And am currently trying to move current work to UV. The problems seem to be possibility of unknown breakage for unknown users of the old project not any known technical issue. I'd highly reccomend UV. Its just easier/more flexible. And it downloads t…

`uv tool install` will create shims in .local/bin

Sorry I meant shims for python. I think I mentioned installing tools
Post reply on HN