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

Progress bars for uv publish #7613

Merged
merged 1 commit into from
Sep 24, 2024
Merged

Progress bars for uv publish #7613

merged 1 commit into from
Sep 24, 2024

Conversation

konstin
Copy link
Member

@konstin konstin commented Sep 21, 2024

Add progress bars to uv publish, helpful when uploading large packages.

Copy link
Member

@BurntSushi BurntSushi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, although I think I would probably try to avoid defining a new trait here in favor of a concrete type or enum. (But I may be missing some context motivating the trait.)

fn on_download_start(&self, name: &str, size: Option<u64>) -> usize;
fn on_download_progress(&self, id: usize, inc: u64);
fn on_download_complete(&self);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How come you went for a trait here instead of asking for a concrete type? An enum would probably do the job in order to handle the case of the "dummy" reporter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this matches our other reporter patterns?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah. That would be a candidate for un-genericizing code in a hope to improve compile times. :)

(It may result in little gain if there's only one instantiation of the generics outside of tests though.)

Copy link
Member Author

@konstin konstin Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be nice to have a single reporter crate that is shared (or some callback) instead of copying this code for every new feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I think it can be completely monomorphic too with no parametric polymorphism.

@konstin konstin enabled auto-merge (squash) September 24, 2024 15:50
@konstin konstin merged commit c053dc8 into main Sep 24, 2024
59 checks passed
@konstin konstin deleted the konsti/publish5 branch September 24, 2024 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants