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 lock --upgrade should add an additional marker for major version upgrades #10842

Open
purajit opened this issue Jan 22, 2025 · 2 comments
Open
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality

Comments

@purajit
Copy link

purajit commented Jan 22, 2025

Summary

A symbol (like a !) at the end of the lines Updated v... -> v... where a major version is bumped (and as a moonshot, for the minor version where they are similarly significant) would make changes much easier to review.

The more direct context is that we have a monorepo with several independent uv projects, and run uv lock --upgrade on a cron on all of them. We put the Updated logs into the PR description for the papertrail, but also to help the reviewer, and having a symbol to easily check these lines would make it much easier to narrow down the expected scope of impact. Currently we parse and use python-packaging to inject these.

Willing to PR if this seems reasonable, just using PythonVersion::major.

Couple add-ons:

  • it would be good to differentiate Update based on whether the version increased or decreased, and use appropriate symbols
  • we don't need this, but this could be easily extended to other things people might want to know, like if they're being upgraded to a pre-release

Example

This is what I'm currently doing with some manual parsing:

(+/- for added/removed, > for upgraded, ≫ for major version upgraded; I have been trying to
think of something that stands out more than ≫ - for a normal upgrade and > for major
works, but just looks a bit weird - any of these are fine by me)

+ pytz v2024.2
+ rapidfuzz v3.11.0
> referencing v0.35.1 -> v0.36.1
- requests-toolbelt v1.0.0
- sniffio v1.3.1
+ tini v4.0.0
+ types-pyyaml v6.0.12.20241230
≫ tzdata v2024.2 -> v2025.1
- websockets v11.0.3
- yarl v1.18.3

Example for the alternative:

› referencing v0.35.1 -> v0.36.1
> tzdata v2024.2 -> v2025.1

with emojis (could also be ▶️/⏩):

➕ pytz v2024.2
➕ rapidfuzz v3.11.0
⬆️ referencing v0.35.1 -> v0.36.1
➖ sniffio v1.3.1
➕ tini v4.0.0
➕ types-pyyaml v6.0.12.20241230
⏫ tzdata v2024.2 -> v2025.1
➖ websockets v11.0.3
➖ yarl v1.18.3

I mostly chose to do it this way to have a constant-sized column at the beginning since it's
visually easy to grok, but any kind of indication would be good enough. Particularly, I think
being able to clearly distinguish the lines even without color would be great, since you won't
be able to preserve that while posting comments/PRs. I don't have strong opinions myself about
sticking to the ASCII chart, using emojis, etc.

One kinda neat thing about +/-/! is that those lines can be colored using GitHub's diff
syntax highlighter, but the problem there is typically we wouldn't care about tertiary
dependencies being added/removed, and those are the ones that would stand out the most,
and major upgrades don't stand out:

+ types-pyyaml v6.0.12.20241230
! tzdata v2024.2 -> v2025.1
- websockets v11.0.3

I understand these are all bigger changes; just showing what I've been doing. Any kind of visual
marker that helps things stand out is good enough.

@purajit purajit added the enhancement New feature or improvement to existing functionality label Jan 22, 2025
@zanieb zanieb added the cli Related to the command line interface label Jan 22, 2025
@zanieb
Copy link
Member

zanieb commented Jan 22, 2025

Seems reasonable, but I'm not quite sure how we'd want it to look. Can you share an example of the current output and your desired one?

@purajit
Copy link
Author

purajit commented Jan 22, 2025

UPDATE: Added all context to the issue itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli Related to the command line interface enhancement New feature or improvement to existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants