mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 19:08:04 +00:00
Avoid validating extra and group sources in build-system.requires
(#9273)
## Summary This was an oversight in the initial implementation. We shouldn't validate sources for the `build-system.requires` field, since extras and groups can _never_ be active. Closes https://github.com/astral-sh/uv/issues/9259.
This commit is contained in:
parent
ccc0962cbd
commit
289771e311
7 changed files with 193 additions and 20 deletions
|
@ -28,7 +28,7 @@ use tokio::sync::{Mutex, Semaphore};
|
|||
use tracing::{debug, info_span, instrument, Instrument};
|
||||
|
||||
use uv_configuration::{BuildKind, BuildOutput, ConfigSettings, LowerBound, SourceStrategy};
|
||||
use uv_distribution::RequiresDist;
|
||||
use uv_distribution::BuildRequires;
|
||||
use uv_distribution_types::{IndexLocations, Resolution};
|
||||
use uv_fs::{PythonExt, Simplified};
|
||||
use uv_pep440::Version;
|
||||
|
@ -464,15 +464,12 @@ impl SourceBuild {
|
|||
.map(|project| &project.name)
|
||||
.or(package_name)
|
||||
{
|
||||
// TODO(charlie): Add a type to lower requirements without providing
|
||||
// empty extras.
|
||||
let requires_dist = uv_pypi_types::RequiresDist {
|
||||
let build_requires = uv_pypi_types::BuildRequires {
|
||||
name: name.clone(),
|
||||
requires_dist: build_system.requires,
|
||||
provides_extras: vec![],
|
||||
};
|
||||
let requires_dist = RequiresDist::from_project_maybe_workspace(
|
||||
requires_dist,
|
||||
let build_requires = BuildRequires::from_project_maybe_workspace(
|
||||
build_requires,
|
||||
install_path,
|
||||
None,
|
||||
locations,
|
||||
|
@ -481,7 +478,7 @@ impl SourceBuild {
|
|||
)
|
||||
.await
|
||||
.map_err(Error::Lowering)?;
|
||||
requires_dist.requires_dist
|
||||
build_requires.requires_dist
|
||||
} else {
|
||||
build_system
|
||||
.requires
|
||||
|
@ -909,15 +906,12 @@ async fn create_pep517_build_environment(
|
|||
let extra_requires = match source_strategy {
|
||||
SourceStrategy::Enabled => {
|
||||
if let Some(package_name) = package_name {
|
||||
// TODO(charlie): Add a type to lower requirements without providing
|
||||
// empty extras.
|
||||
let requires_dist = uv_pypi_types::RequiresDist {
|
||||
let build_requires = uv_pypi_types::BuildRequires {
|
||||
name: package_name.clone(),
|
||||
requires_dist: extra_requires,
|
||||
provides_extras: vec![],
|
||||
};
|
||||
let requires_dist = RequiresDist::from_project_maybe_workspace(
|
||||
requires_dist,
|
||||
let build_requires = BuildRequires::from_project_maybe_workspace(
|
||||
build_requires,
|
||||
install_path,
|
||||
None,
|
||||
locations,
|
||||
|
@ -926,7 +920,7 @@ async fn create_pep517_build_environment(
|
|||
)
|
||||
.await
|
||||
.map_err(Error::Lowering)?;
|
||||
requires_dist.requires_dist
|
||||
build_requires.requires_dist
|
||||
} else {
|
||||
extra_requires.into_iter().map(Requirement::from).collect()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue