Skip to content

Commit

Permalink
Remove interpreter from BuildContext trait (astral-sh#5800)
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh authored Aug 5, 2024
1 parent 92a2996 commit 33ec6f0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 11 deletions.
4 changes: 2 additions & 2 deletions crates/uv-dev/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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(),
Expand Down
4 changes: 0 additions & 4 deletions crates/uv-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
6 changes: 1 addition & 5 deletions crates/uv-types/src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 33ec6f0

Please sign in to comment.