mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-27 02:17:08 +00:00
Add BuildOptions for centralized combination of NoBuild and NoBinary (#4284)
As requested in review of https://github.com/astral-sh/uv/pull/4067
This commit is contained in:
parent
1ab4041baa
commit
5a007b6b9f
20 changed files with 186 additions and 267 deletions
|
|
@ -28,7 +28,7 @@ use uv_cache::{
|
|||
use uv_client::{
|
||||
CacheControl, CachedClientError, Connectivity, DataWithCachePolicy, RegistryClient,
|
||||
};
|
||||
use uv_configuration::{BuildKind, NoBinary, NoBuild, PreviewMode};
|
||||
use uv_configuration::{BuildKind, PreviewMode};
|
||||
use uv_extract::hash::Hasher;
|
||||
use uv_fs::{write_atomic, LockedFile};
|
||||
use uv_types::{BuildContext, SourceBuildTrait};
|
||||
|
|
@ -1390,21 +1390,7 @@ impl<'a, T: BuildContext> SourceDistributionBuilder<'a, T> {
|
|||
debug!("Building: {source}");
|
||||
|
||||
// Guard against build of source distributions when disabled.
|
||||
let no_build = match self.build_context.no_build() {
|
||||
NoBuild::All => match self.build_context.no_binary() {
|
||||
// Allow `all` to be overridden by specific binary exclusions
|
||||
NoBinary::Packages(packages) => {
|
||||
!source.name().is_some_and(|name| packages.contains(name))
|
||||
}
|
||||
_ => true,
|
||||
},
|
||||
NoBuild::None => false,
|
||||
NoBuild::Packages(packages) => {
|
||||
source.name().is_some_and(|name| packages.contains(name))
|
||||
}
|
||||
};
|
||||
|
||||
if no_build {
|
||||
if self.build_context.build_options().no_build(source.name()) {
|
||||
if source.is_editable() {
|
||||
debug!("Allowing build for editable source distribution: {source}");
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue