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

Clear #6673

Closed
wants to merge 2 commits into from
Closed

Clear #6673

wants to merge 2 commits into from

Conversation

Filimoa
Copy link
Contributor

@Filimoa Filimoa commented Aug 27, 2024

Summary

I realize this might make the docs slightly more cluttered, but maybe it would be helpful to clarify how to update packages to the latest version? This seems like a super common workflow.

While it does make sense that you guy are just inheriting from what pip does, it's also not intuitive since you're using the add command to install a package in the first place.

Personally I tried:

uv update fastapi # cargo, poetry, npm
uv upgrade fastapi # yarn, brew
uv add fastapi@latest # fails + adds a random line to my pyproject.toml?

Before finally running uv add --help

Test Plan

n/a

@zanieb
Copy link
Member

zanieb commented Aug 27, 2024

Sorry I'm not sure I follow. uv lock --upgrade or uv sync --upgrade is how you should upgrade to the latest version of a package (as supported by your constraints). I don't think the example you provided will always bump to the latest released version — e.g. if you've provided constraints the pyproject.toml won't change during that invocation.

@zanieb zanieb added the documentation Improvements or additions to documentation label Aug 27, 2024
@zanieb zanieb self-assigned this Aug 27, 2024
@Filimoa
Copy link
Contributor Author

Filimoa commented Aug 27, 2024

Ok thanks for clarifying - I learned something today about poetry. What is the correct way to bump to the latest version available (even if it's outside of your explicit constraints)?

fastapi==0.91.0

To

fastapi==0.112.2

Is this the best practice then?

$ uv add fastapi==0.112.2

It seems very tedious to go to pypi every time to check what the latest version is? Npm handles this by npm install package@latest. Poetry also handles this by poetry add pendulum@latest.

@zanieb
Copy link
Member

zanieb commented Aug 27, 2024

Yes, uv add with a new constraint would be proper. There's no reason to pin versions in your pyproject.toml though, that's what the uv.lock file is for. We'll do all of the pinning for you behind the scenes. The changes I made in #6698 might be helpful to you.

(We don't support bumping the minimum compatible version to the latest version or next semver compatible version yet)

@Filimoa
Copy link
Contributor Author

Filimoa commented Aug 27, 2024

Ok thanks that's helpful. Maybe it would be helpful to have a section in the docs explaining this? I imagine many users are coming from pip freeze > requirements.txt and are used to using pyproject.toml as essentially a lock file?

I also realize this might just be a "me" problem - just an idea.

@zanieb zanieb closed this Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants