Live data from Hacker News

uv downloads overtake Poetry for Wagtail users

wagtail.org

191–200 of 206 posts

Re: uv downloads overtake Poetry for Wagtail users

#191
post #72

Earlier quoted context omitted.

But for example, if I install the Python package "shapely", it will need a C package named GEOS as a shared library. How do I ensure that the version of GEOS on my system is the one shapely wants? By trial and error? And how does that work with environments, where I have different versions of packages in different places? It sounds a bit messy to me, compared to a solution where everything is managed by a single pack…

This type of situation is why I use Docker for pretty much all of my projects—single package managers are frequently not enough to bootstrap an entire project, and it’s really nice to have a central record of how everything needed was actually installed. It’s so much easier to deal with getting things running on different machines, or things on a single machine that have conflicting dependencies.

Docker is good for deployment, but devcontainer is nice for development. Devcontainer uses Docker under the hood. Both are also critically important for security isolation unless one is explicitly using jails.

Re: uv downloads overtake Poetry for Wagtail users

#192

Earlier quoted context omitted.

Python has been mostly working okay for me since I switched to Poetry. (“Mostly” because I think I’ve run into some weird issue once but I’ve tried to recall what it was and I just can’t.) uv felt a bit immature at the time, but sounds like it’s way better now. I really want to try it out... but Poetry just works, so I don’t really have an incentive to switch just yet. (Though I’ve switched from FlakeHeaven or someth…

A lot of Wagtail usage is with Poetry. Tends to be projects with 30-50 dependencies. It "just works" but we see a lot of people struggle with common tasks ("how do I upgrade this package"), and complain about how slow it is. I don’t have big insights outside of Wagtail users but I don’t think it’s too different.

n=1 but i've tried "manual" .venv, conda/miniconda, pipenv, poetry, and finally now at uv. uv is great. poetry feels like it's focused on people who are publishing packages. uv is great to use for personal dev, spinning up/down lots of venv, speedy, and uvx/uv script is very convenient compared to having all my sandbox project in one poetry env.

Re: uv downloads overtake Poetry for Wagtail users

#193
post #18

For the uninitiated what is the benefit of UV over pip? I've been working with pip for so long now that I barely notice it unless something goes very wrong.

- uv is aware of your dependencies, you can add/remove development dependencies, create group of development dependencies (test, lint, dev, etc) and add or remove those and only those at will. You can add dependencies and optional dependencies for a project as well, think my_app[cli,standard]. You don't need to have different requirements.txt for each case nor do you need to remove things by hand as you'd do in pip,…

Honestly this sounds more likely to replace some workflows I historically would have done with Docker.

The pain of creating a python environment that is durable across different deployments had me going for the nuclear option with full containerisation.

Re: uv downloads overtake Poetry for Wagtail users

#194
post #44

Earlier quoted context omitted.

Google's not that broken yet: https://pixi.sh/latest/

That (main) page doesn't mention python once, so personally I was immediately wondering if this is an alternative to tools like uv or more generally tools like mise and asdf. It really isn't that clear so could you try to elaborate a bit?

Google works for you too, friend.

Re: uv downloads overtake Poetry for Wagtail users

#195
Biggest issue I have, is not solving all the dependency hell that is Python with its unversioned libraries, but supply chain attacks. Also regressions introduced by new versions all the time.

That is why for projects I resolve everything by hand, add all coarsely audited 3rd party libraries to ./lib/, and the main entry file then does this:

#!/usr/bin/env -S /bin/sh -c "_top_dir=\"\$(dirname \"\$(realpath -s \"\$0\")\")\"; cd \"\$_top_dir\"; exec \"\$_top_dir/python/install/bin/python3\" -W once::DeprecationWarning -X dev \"\$0\" \"\$@\""

import os

import sys

# Insert ./lib/ in front of search path

sys.path.insert(0, os.path.join(os.path.dirname(__file__), "lib"))

...

I like the excellent standalone CPython by indygreg, now under astral-sh's github organization. Unpack as is into ./python/ and done. Because Arch Linux would just roll forward to whatever version is latest, introducing new warnings every month or two and havoc on any new major version.

Project is fully portable, copy anywhere that has glibc, run.

Re: uv downloads overtake Poetry for Wagtail users

#196
post #162
post #77

I feel for me, at least one nice thing about poetry over uv is, that if I have an issue or feature extension, I can just write my own plugin in pure Python. With uv, I'd need to learn Rust in addition to python/c/c++/etc. I wonder what it would take to get poetry on par with uv for those who are already switching to it? Poetry is definitely very slow downloading multiple versions of packages to determine dependencies…

I wonder what it would take to get poetry on par with uv for those who are already switching to it? Poetry and uv have quite different philosophy. Poetry is incredibly opinionated in how you should do things, and trying to make poetry fit an existing project or combining poetry with other tools is quite likely to break. Uv on the hand is far more flexible and easier to make work with your current workflow. For me tha…

Curious what you found too opinionated about Poetry (not saying it doesn't happen)

Re: uv downloads overtake Poetry for Wagtail users

#197

Earlier quoted context omitted.

Does this also replace, or work well with tox? We currently use it to run basic CI/local workflows (`tox -e lint` for all linters, `tox -e py310`, `tox -e py312` to run tests suites on chosen interpreters' environments), and to set up a local environment with package installed in-place (so that we can run `myprogram -arg1 -arg2` as if it was installed via `pip`, but still have it be editable by directly editing the r…

I'm not personally releasing a ton of internal packages where I work but I know of https://github.com/tox-dev/tox-uv . Haven't tried it yet though but it seems to do what you want. I also saw that nox (tox but in python instead of a tox.ini file https://nox.thea.codes/en/stable/config.html ), is supporting uv from what I understand. I don't think there's a definite answer yet.

tox-uv has been a great selling point for my personal use of uv. I'm typically testing across 4-5 different versions of Python and the build speedup has been significant.

Re: uv downloads overtake Poetry for Wagtail users

#198
post #152

Earlier quoted context omitted.

> I am a casual user of python and I don't want to touch it unless I have a damn good reason to use it. I... what? Python is a beautiful way to evolve beyond the troglodyte world of sh for system scripts. You are seriously missing out by being so pertinently against it.

Just you wait till someone shows you how Rust is to Python what Python is to shell scripts. For one, null safety is a major issue in most corporate Python code, and much less of an issue in Rust code.

Rust is decidedly not a scripting language.

Don't get me wrong, Rust is great and I use it too, but for very different purposes than (system) scripts.

Re: uv downloads overtake Poetry for Wagtail users

#199
post #162

Earlier quoted context omitted.

I wonder what it would take to get poetry on par with uv for those who are already switching to it? Poetry and uv have quite different philosophy. Poetry is incredibly opinionated in how you should do things, and trying to make poetry fit an existing project or combining poetry with other tools is quite likely to break. Uv on the hand is far more flexible and easier to make work with your current workflow. For me tha…

Curious what you found too opinionated about Poetry (not saying it doesn't happen)

The way it assumes one and exactly one venv per project was a big one. The one that broke me however was trying to get it work with external build systems, specifically trying to compile C++ code as part of the build process. Another important one was that it doesn't play nicely with older code built on pip and pip based workflows. You basically have to start from scratch, while uv makes it much easier to slowly transition.
Post reply on HN