Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't update packages to latest in pyproject.toml? #11679

Closed
wrouesnel opened this issue Feb 20, 2025 · 3 comments
Closed

Can't update packages to latest in pyproject.toml? #11679

wrouesnel opened this issue Feb 20, 2025 · 3 comments
Labels
question Asking for clarification or support

Comments

@wrouesnel
Copy link

Question

I've searched the documentation a fair bit and I can't find an answer to this which does what I want.

If I have a list of dependencies like:

    "jmespath>=1.0.1",
    "passlib>=1.7.4",
    "netaddr>=0.9.0",
    "pytoml>=0.1.21",
    "ruamel-yaml>=0.18.6",
    "click>=8.1.7",
    "dictdiffer>=0.9.0",
    "pygithub>=2.3.0",
    "pykeepass==4.0.6",
    "ansible>=10.7.0",

on some old project, the most common action I want is "upgrade all the packages to the highest possible version". uv sync --upgrade seems like it's happy to bump revision numbers, but it won't edit the pyproject.toml file so that's out.

uv remove <package> and uv add <package> achieves the desired individual effect, but can't be used across the entire dependency tree.

I explicitly don't want the lock file to be too different to pyproject.toml - this is application software, not a library, so I want to be specific about what versions we did install (or take advantage of python specific ranges etc.) but periodically (usually when developing a new feature) I want to just say "upgrade all the libraries to where they can be" since that's usually the time that sort of maintenance is best done.

Have I missed something? Is there a command which will do this?

Platform

Linux 6.8.0-53-generic x86_64 GNU/Linux

Version

uv 0.5.21

@wrouesnel wrouesnel added the question Asking for clarification or support label Feb 20, 2025
@Gankra
Copy link
Contributor

Gankra commented Feb 21, 2025

@stuartmaxwell
Copy link

Sounds like you want this feature:

* [Add a command to read and update (i.e., bump) the project version, e.g., `uv version` #6298](https://github.com/astral-sh/uv/issues/6298)

No, I don't think that is what is being asked. The issue you linked to is about bumping the project version, which is often done with third party tools.

What @wrouesnel is asking (and I came here to ask the same thing), is how to update the list of dependencies in the pyproject.toml file to the latest versions. The versions of the packages in the pyproject.toml file remain the same as the day you add them to your project.

The only way I can see to do this, is to run uv remove <packagename> && uv add --upgrade <packagename> for each package in the dependency list, which is extremely time-consuming.

@charliermarsh
Copy link
Member

Are you referring to the lower-bound set in pyproject.toml? Yeah, we don't have any sort of command to bump those. I don't think you need to, though? It's a lower-bound -- you can upgrade the package without bumping the lower-bound.

I believe this is a duplicate of #6794, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Asking for clarification or support
Projects
None yet
Development

No branches or pull requests

4 participants