Skip to content

Progress bars for uv publish#7613

Merged
konstin merged 1 commit intomainfrom
konsti/publish5
Sep 24, 2024
Merged

Progress bars for uv publish#7613
konstin merged 1 commit intomainfrom
konsti/publish5

Conversation

@konstin
Copy link
Member

@konstin konstin commented Sep 21, 2024

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

@konstin konstin requested a review from BurntSushi September 21, 2024 14:31
@konstin konstin added the enhancement New feature or improvement to existing functionality label Sep 21, 2024
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.

Base automatically changed from konsti/publish2 to main September 24, 2024 15:33
@konstin konstin enabled auto-merge (squash) September 24, 2024 15:50
@konstin konstin merged commit c053dc8 into main Sep 24, 2024
@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 improvement to existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants