Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If you specify your constraints in pyproject.toml like this: `package1==0.4.0`; then that is the latest (and only) version satisfying your constraints. Not upgrading is expected behavior, because upgrading would violate constraints.

pyproject.toml’s dependency list specifies compatibility: we expect the program to run with versions that satisfy constraints.

If you want to specify an exact version as a validated configuration for a reproducible build with guaranteed functionality, well, that’s what the lock file is for.

In serious projects, I usually write that dependency section by hand so that I can specify the constraints that match my needs (e.g., what is the earliest version receiving security patches or the earliest version with the functionality I need?). In unserious projects, I’ll leave the constraints off entirely until a breakage is discovered in practice.

If `uv` is adding things with `==` constraints, that’s why upgrades are not occurring, but the solution is to relax the constraints to indicate where you are okay with upgrades happening.



> ... the solution is to relax the constraints to indicate where you are okay with upgrades happening.

Yeah, that's pretty much what I've been doing with my workaround script. And btw most of my projects are deeply unserious, and I do understand why one should not do that in any other scenario.

Still, I dream of `uv refresh` :D


There's an open issue for "Upgrade dependencies in pyproject.toml (uv upgrade)":

https://github.com/astral-sh/uv/issues/6794




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: