Switching from Pyenv to Uv
221–230 of 239 posts
Re: Switching from Pyenv to Uv
#222Earlier 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.
Re: Switching from Pyenv to Uv
#223Earlier 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
Re: Switching from Pyenv to Uv
#224Earlier 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!
Re: Switching from Pyenv to Uv
#225I 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…
Re: Switching from Pyenv to Uv
#226Earlier 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…
Re: Switching from Pyenv to Uv
#227Earlier 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.
Re: Switching from Pyenv to Uv
#228Earlier 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
Re: Switching from Pyenv to Uv
#229Earlier 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.
Re: Switching from Pyenv to Uv
#230Earlier 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