Remove interpreter from BuildContext trait (#5800)

This commit is contained in:
Charlie Marsh 2024-08-05 16:32:10 -04:00 committed by GitHub
parent 92a2996e8e
commit 33ec6f063d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 11 deletions

View file

@ -18,7 +18,7 @@ use uv_dispatch::BuildDispatch;
use uv_git::GitResolver;
use uv_python::{EnvironmentPreference, PythonEnvironment, PythonRequest};
use uv_resolver::{FlatIndex, InMemoryIndex};
use uv_types::{BuildContext, BuildIsolation, InFlight};
use uv_types::{BuildIsolation, InFlight};
#[derive(Parser)]
pub(crate) struct BuildArgs {
@ -100,7 +100,7 @@ pub(crate) async fn build(args: BuildArgs) -> Result<PathBuf> {
let builder = SourceBuild::setup(
&args.sdist,
args.subdirectory.as_deref(),
build_dispatch.interpreter(),
python.interpreter(),
&build_dispatch,
SourceBuildContext::default(),
args.sdist.display().to_string(),

View file

@ -127,10 +127,6 @@ impl<'a> BuildContext for BuildDispatch<'a> {
self.git
}
fn interpreter(&self) -> &Interpreter {
self.interpreter
}
fn build_options(&self) -> &BuildOptions {
self.build_options
}

View file

@ -9,7 +9,7 @@ use pypi_types::Requirement;
use uv_cache::Cache;
use uv_configuration::{BuildKind, BuildOptions};
use uv_git::GitResolver;
use uv_python::{Interpreter, PythonEnvironment};
use uv_python::PythonEnvironment;
/// Avoids cyclic crate dependencies between resolver, installer and builder.
///
@ -57,10 +57,6 @@ pub trait BuildContext {
/// Return a reference to the Git resolver.
fn git(&self) -> &GitResolver;
/// All (potentially nested) source distribution builds use the same base python and can reuse
/// it's metadata (e.g. wheel compatibility tags).
fn interpreter(&self) -> &Interpreter;
/// Whether source distribution building or pre-built wheels is disabled.
///
/// This [`BuildContext::setup_build`] calls will fail if builds are disabled.