←back to thread

741 points chirau | 1 comments | | HN request time: 0.316s | source
Show context
incognito124 ◴[] No.44358514[source]
uv is almost perfect. my only pet peeve is updating dependencies. sometimes I just want to go "uv, bump all my dependencies to the as latest version as possible while respecting their constraints". I still haven't found an elegant way to do this, but I have written a script that parses pyproject.toml, removes the deps, and invokes `uv add --upgrade` with them.

other than that, it's invaluable to me, with the best features being uvx and PEP 723

replies(4): >>44358537 #>>44358636 #>>44358716 #>>44374060 #
jmtulloss ◴[] No.44358537[source]
Does `uv lock —upgrade` not do what you want?
replies(1): >>44358602 #
incognito124 ◴[] No.44358602[source]
Unfortunately, no. Only `uv.lock` gets updated, but the dependencies in `pyproject.toml` are frozen at their original constraints.

What I want is, if my project depends on `package1==0.4.0` and there are new versions of package1, for uv to try install the newer version. and to do that for a) all the deps, simultaneously, b) without me explicitly stating the dependencies in the command line since they're already written in the pyproject.toml. an `uv refresh` of sorts

replies(5): >>44358700 #>>44358709 #>>44358807 #>>44358867 #>>44358896 #
petters ◴[] No.44358867[source]
You are writing your project file incorrectly. It's not a lock file
replies(1): >>44359152 #
incognito124 ◴[] No.44359152[source]
I never, ever, write my project file[1]. uv {add,remove} is all I ever use.

[1]: I do sometimes write the title or the description. But never the deps themselves

replies(3): >>44359356 #>>44360378 #>>44380539 #
1. wtallis ◴[] No.44359356[source]
Even using `uv add`, you don't have to limit yourself to declaring exact versions when your intention is to allow newer versions.