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

uv pip install -U somepkg should only update the specified package, unless additional upgrades are necessary #4779

Open
ThiefMaster opened this issue Jul 3, 2024 · 3 comments
Labels
compatibility Compatibility with a specification or another tool needs-design Needs discussion, investigation, or design

Comments

@ThiefMaster
Copy link

Classic pip did the same until a few years ago where they changed the default to --upgrade-strategy only-if-needed for which uv currently does not have an equivalent. The only way to get this behavior is uv pip install -P somepkg somepkg which is a bit ugly since I need to specify the package name twice.

I think this behavior would be more desirable than "upgrade everything" because:

  • In most proper production deployments you have lock files anyway and will not use uv pip install -U at all
  • If you have some extra packages in such an environment, you do NOT want updating that package to also update some random dependency (that's actually specified in another package's lock file)
  • In a development environment, I guess it's a matter of preference

My suggestion would be to:

  • Change the default to match --upgrade-strategy only-if-needed (or at least implement this option)
  • Display a notice if any (direct?) dependencies of the specified package could also be updated (maybe only if this does not conflict with version pins of already-installed packages?)
@zanieb
Copy link
Member

zanieb commented Jul 3, 2024

Sounds like you're just looking for --upgrade-package? Why is it a big deal to specify the name twice? Isn't it harder for users to do uv pip install <package> --upgrade --upgrade-strategy eager to update their environment? I've been bitten by this surprising behavior in pip several times in CI.

@zanieb zanieb added the question Asking for clarification or support label Jul 3, 2024
@zanieb
Copy link
Member

zanieb commented Jul 3, 2024

I'm not particularly opposed to --upgrade applying to all of the "given packages" if we can find a nice way to specify upgrading the environment. I guess --upgrade-strategy isn't bad.

@zanieb zanieb added the needs-design Needs discussion, investigation, or design label Jul 3, 2024
@zanieb zanieb added compatibility Compatibility with a specification or another tool and removed question Asking for clarification or support labels Oct 21, 2024
@zanieb
Copy link
Member

zanieb commented Oct 21, 2024

Related #7176

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool needs-design Needs discussion, investigation, or design
Projects
None yet
Development

No branches or pull requests

2 participants