Allow reporters to take dyn Metadata (#645)

This commit is contained in:
Charlie Marsh 2023-12-14 06:36:28 -05:00 committed by GitHub
parent 1a62ca0c62
commit eef9612719
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 18 deletions

View file

@ -8,7 +8,7 @@ use anyhow::Result;
use futures::StreamExt;
use rustc_hash::FxHashMap;
use distribution_types::Dist;
use distribution_types::{Dist, Metadata};
use pep440_rs::Version;
use pep508_rs::{Requirement, VersionOrUrl};
use platform_tags::{TagPriority, Tags};
@ -239,7 +239,7 @@ enum Response {
pub trait Reporter: Send + Sync {
/// Callback to invoke when a package is resolved to a specific distribution.
fn on_progress(&self, wheel: &Dist);
fn on_progress(&self, dist: &dyn Metadata);
/// Callback to invoke when the resolution is complete.
fn on_complete(&self);

View file

@ -752,10 +752,10 @@ pub trait Reporter: Send + Sync {
fn on_complete(&self);
/// Callback to invoke when a source distribution build is kicked off.
fn on_build_start(&self, dist: &SourceDist) -> usize;
fn on_build_start(&self, dist: &dyn Metadata) -> usize;
/// Callback to invoke when a source distribution build is complete.
fn on_build_complete(&self, dist: &SourceDist, id: usize);
fn on_build_complete(&self, dist: &dyn Metadata, id: usize);
/// Callback to invoke when a repository checkout begins.
fn on_checkout_start(&self, url: &Url, rev: &str) -> usize;