mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Avoid double resolution during source builds (#656)
## Summary This PR ensures that we re-use the resolution to install the build dependencies when building a source distribution. Currently, we only pass along the list of requirements, and then use the `Finder` to map each requirement to a distribution. But we already determine the correct distribution when resolving! Closes https://github.com/astral-sh/puffin/issues/655.
This commit is contained in:
parent
1129661a22
commit
9470c20e7a
14 changed files with 177 additions and 158 deletions
|
@ -12,6 +12,7 @@ use anyhow::Result;
|
|||
use chrono::{DateTime, Utc};
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use distribution_types::Resolution;
|
||||
use pep508_rs::{MarkerEnvironment, Requirement, StringVersion};
|
||||
use platform_host::{Arch, Os, Platform};
|
||||
use platform_tags::Tags;
|
||||
|
@ -53,13 +54,13 @@ impl BuildContext for DummyContext {
|
|||
fn resolve<'a>(
|
||||
&'a self,
|
||||
_requirements: &'a [Requirement],
|
||||
) -> Pin<Box<dyn Future<Output = Result<Vec<Requirement>>> + Send + 'a>> {
|
||||
) -> Pin<Box<dyn Future<Output = Result<Resolution>> + Send + 'a>> {
|
||||
panic!("The test should not need to build source distributions")
|
||||
}
|
||||
|
||||
fn install<'a>(
|
||||
&'a self,
|
||||
_requirements: &'a [Requirement],
|
||||
_resolution: &'a Resolution,
|
||||
_venv: &'a Virtualenv,
|
||||
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>> {
|
||||
panic!("The test should not need to build source distributions")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue