diff --git a/crates/uv-configuration/src/dev.rs b/crates/uv-configuration/src/dependency_groups.rs similarity index 87% rename from crates/uv-configuration/src/dev.rs rename to crates/uv-configuration/src/dependency_groups.rs index f2f9b0e5e..e1540a27d 100644 --- a/crates/uv-configuration/src/dev.rs +++ b/crates/uv-configuration/src/dependency_groups.rs @@ -6,11 +6,11 @@ use uv_normalize::{GroupName, DEV_DEPENDENCIES}; /// /// This is an Arc mostly just to avoid size bloat on things that contain these. #[derive(Debug, Default, Clone)] -pub struct DevGroupsSpecification(Arc); +pub struct DependencyGroups(Arc); /// Manager of all dependency-group decisions and settings history. #[derive(Debug, Default, Clone)] -pub struct DevGroupsSpecificationInner { +pub struct DependencyGroupsInner { /// Groups to include. include: IncludeGroups, /// Groups to exclude (always wins over include). @@ -19,19 +19,19 @@ pub struct DevGroupsSpecificationInner { /// /// If true, users of this API should refrain from looking at packages /// that *aren't* specified by the dependency-groups. This is exposed - /// via [`DevGroupsSpecificationInner::prod`][]. + /// via [`DependencyGroupsInner::prod`][]. only_groups: bool, /// The "raw" flags/settings we were passed for diagnostics. - history: DevGroupsSpecificationHistory, + history: DependencyGroupsHistory, } -impl DevGroupsSpecification { +impl DependencyGroups { /// Create from history. /// /// This is the "real" constructor, it's basically taking raw CLI flags but in /// a way that's a bit nicer for other constructors to use. - fn from_history(history: DevGroupsSpecificationHistory) -> Self { - let DevGroupsSpecificationHistory { + fn from_history(history: DependencyGroupsHistory) -> Self { + let DependencyGroupsHistory { dev_mode, mut group, mut only_group, @@ -69,7 +69,7 @@ impl DevGroupsSpecification { IncludeGroups::Some(group) }; - Self(Arc::new(DevGroupsSpecificationInner { + Self(Arc::new(DependencyGroupsInner { include, exclude: no_group, only_groups, @@ -104,7 +104,7 @@ impl DevGroupsSpecification { None }; - Self::from_history(DevGroupsSpecificationHistory { + Self::from_history(DependencyGroupsHistory { dev_mode, group, only_group, @@ -118,7 +118,7 @@ impl DevGroupsSpecification { /// Helper to make a spec from just a --dev flag pub fn from_dev_mode(dev_mode: DevMode) -> Self { - Self::from_history(DevGroupsSpecificationHistory { + Self::from_history(DependencyGroupsHistory { dev_mode: Some(dev_mode), ..Default::default() }) @@ -126,35 +126,35 @@ impl DevGroupsSpecification { /// Helper to make a spec from just a --group pub fn from_group(group: GroupName) -> Self { - Self::from_history(DevGroupsSpecificationHistory { + Self::from_history(DependencyGroupsHistory { group: vec![group], ..Default::default() }) } - /// Apply defaults to a base [`DevGroupsSpecification`]. + /// Apply defaults to a base [`DependencyGroups`]. /// /// This is appropriate in projects, where the `dev` group is synced by default. - pub fn with_defaults(&self, defaults: Vec) -> DevGroupsManifest { + pub fn with_defaults(&self, defaults: Vec) -> DependencyGroupsWithDefaults { // Explicitly clone the inner history and set the defaults, then remake the result. let mut history = self.0.history.clone(); history.defaults = defaults; - DevGroupsManifest { + DependencyGroupsWithDefaults { cur: Self::from_history(history), prev: self.clone(), } } } -impl std::ops::Deref for DevGroupsSpecification { - type Target = DevGroupsSpecificationInner; +impl std::ops::Deref for DependencyGroups { + type Target = DependencyGroupsInner; fn deref(&self) -> &Self::Target { &self.0 } } -impl DevGroupsSpecificationInner { +impl DependencyGroupsInner { /// Returns `true` if packages other than the ones referenced by these /// dependency-groups should be considered. /// @@ -180,7 +180,7 @@ impl DevGroupsSpecificationInner { /// Iterate over all groups the user explicitly asked for on the CLI pub fn explicit_names(&self) -> impl Iterator { - let DevGroupsSpecificationHistory { + let DependencyGroupsHistory { // Strictly speaking this is an explicit reference to "dev" // but we're currently tolerant of dev not existing when referenced with // these flags, since it kinda implicitly always exists even if @@ -206,14 +206,14 @@ impl DevGroupsSpecificationInner { } /// Get the raw history for diagnostics - pub fn history(&self) -> &DevGroupsSpecificationHistory { + pub fn history(&self) -> &DependencyGroupsHistory { &self.history } } -/// Context about a [`DevGroupsSpecification`][] that we've preserved for diagnostics +/// Context about a [`DependencyGroups`][] that we've preserved for diagnostics #[derive(Debug, Default, Clone)] -pub struct DevGroupsSpecificationHistory { +pub struct DependencyGroupsHistory { pub dev_mode: Option, pub group: Vec, pub only_group: Vec, @@ -223,17 +223,17 @@ pub struct DevGroupsSpecificationHistory { pub defaults: Vec, } -impl DevGroupsSpecificationHistory { +impl DependencyGroupsHistory { /// Returns all the CLI flags that this represents. /// /// If a flag was provided multiple times (e.g. `--group A --group B`) this will /// elide the arguments and just show the flag once (e.g. just yield "--group"). /// /// Conceptually this being an empty list should be equivalent to - /// [`DevGroupsSpecification::is_empty`][] when there aren't any defaults set. + /// [`DependencyGroups::is_empty`][] when there aren't any defaults set. /// When there are defaults the two will disagree, and rightfully so! pub fn as_flags_pretty(&self) -> Vec> { - let DevGroupsSpecificationHistory { + let DependencyGroupsHistory { dev_mode, group, only_group, @@ -273,27 +273,27 @@ impl DevGroupsSpecificationHistory { } } -/// A trivial newtype wrapped around [`DevGroupsSpecification`][] that signifies "defaults applied" +/// A trivial newtype wrapped around [`DependencyGroups`][] that signifies "defaults applied" /// /// It includes a copy of the previous semantics to provide info on if /// the group being a default actually affected it being enabled, because it's obviously "correct". /// (These are Arcs so it's ~free to hold onto the previous semantics) #[derive(Debug, Clone)] -pub struct DevGroupsManifest { +pub struct DependencyGroupsWithDefaults { /// The active semantics - cur: DevGroupsSpecification, + cur: DependencyGroups, /// The semantics before defaults were applied - prev: DevGroupsSpecification, + prev: DependencyGroups, } -impl DevGroupsManifest { +impl DependencyGroupsWithDefaults { /// Returns `true` if the specification was enabled, and *only* because it was a default pub fn contains_because_default(&self, group: &GroupName) -> bool { self.cur.contains(group) && !self.prev.contains(group) } } -impl std::ops::Deref for DevGroupsManifest { - type Target = DevGroupsSpecification; +impl std::ops::Deref for DependencyGroupsWithDefaults { + type Target = DependencyGroups; fn deref(&self) -> &Self::Target { &self.cur } diff --git a/crates/uv-configuration/src/lib.rs b/crates/uv-configuration/src/lib.rs index 3220f33a3..7878693e5 100644 --- a/crates/uv-configuration/src/lib.rs +++ b/crates/uv-configuration/src/lib.rs @@ -3,7 +3,7 @@ pub use build_options::*; pub use concurrency::*; pub use config_settings::*; pub use constraints::*; -pub use dev::*; +pub use dependency_groups::*; pub use dry_run::*; pub use editable::*; pub use export_format::*; @@ -28,7 +28,7 @@ mod build_options; mod concurrency; mod config_settings; mod constraints; -mod dev; +mod dependency_groups; mod dry_run; mod editable; mod export_format; diff --git a/crates/uv-requirements/src/source_tree.rs b/crates/uv-requirements/src/source_tree.rs index b97cfc32e..2b077861a 100644 --- a/crates/uv-requirements/src/source_tree.rs +++ b/crates/uv-requirements/src/source_tree.rs @@ -7,7 +7,7 @@ use futures::stream::FuturesOrdered; use futures::TryStreamExt; use url::Url; -use uv_configuration::{DevGroupsSpecification, ExtrasSpecification}; +use uv_configuration::{DependencyGroups, ExtrasSpecification}; use uv_distribution::{DistributionDatabase, FlatRequiresDist, Reporter, RequiresDist}; use uv_distribution_types::{ BuildableSource, DirectorySourceUrl, HashGeneration, HashPolicy, SourceUrl, VersionId, @@ -37,7 +37,7 @@ pub struct SourceTreeResolver<'a, Context: BuildContext> { /// The extras to include when resolving requirements. extras: &'a ExtrasSpecification, /// The groups to include when resolving requirements. - groups: &'a DevGroupsSpecification, + groups: &'a DependencyGroups, /// The hash policy to enforce. hasher: &'a HashStrategy, /// The in-memory index for resolving dependencies. @@ -50,7 +50,7 @@ impl<'a, Context: BuildContext> SourceTreeResolver<'a, Context> { /// Instantiate a new [`SourceTreeResolver`] for a given set of `source_trees`. pub fn new( extras: &'a ExtrasSpecification, - groups: &'a DevGroupsSpecification, + groups: &'a DependencyGroups, hasher: &'a HashStrategy, index: &'a InMemoryIndex, database: DistributionDatabase<'a, Context>, diff --git a/crates/uv-resolver/src/lock/installable.rs b/crates/uv-resolver/src/lock/installable.rs index 86f80bc87..e13bdedef 100644 --- a/crates/uv-resolver/src/lock/installable.rs +++ b/crates/uv-resolver/src/lock/installable.rs @@ -9,7 +9,9 @@ use itertools::Itertools; use petgraph::Graph; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; -use uv_configuration::{BuildOptions, DevGroupsManifest, ExtrasSpecification, InstallOptions}; +use uv_configuration::{ + BuildOptions, DependencyGroupsWithDefaults, ExtrasSpecification, InstallOptions, +}; use uv_distribution_types::{Edge, Node, Resolution, ResolvedDist}; use uv_normalize::{ExtraName, GroupName, PackageName}; use uv_pep508::MarkerTree; @@ -38,7 +40,7 @@ pub trait Installable<'lock> { marker_env: &ResolverMarkerEnvironment, tags: &Tags, extras: &ExtrasSpecification, - dev: &DevGroupsManifest, + dev: &DependencyGroupsWithDefaults, build_options: &BuildOptions, install_options: &InstallOptions, ) -> Result { diff --git a/crates/uv-resolver/src/lock/requirements_txt.rs b/crates/uv-resolver/src/lock/requirements_txt.rs index db47f6440..a8e86496f 100644 --- a/crates/uv-resolver/src/lock/requirements_txt.rs +++ b/crates/uv-resolver/src/lock/requirements_txt.rs @@ -12,7 +12,9 @@ use petgraph::{Direction, Graph}; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; use url::Url; -use uv_configuration::{DevGroupsManifest, EditableMode, ExtrasSpecification, InstallOptions}; +use uv_configuration::{ + DependencyGroupsWithDefaults, EditableMode, ExtrasSpecification, InstallOptions, +}; use uv_distribution_filename::{DistExtension, SourceDistExtension}; use uv_fs::Simplified; use uv_git_types::GitReference; @@ -38,7 +40,7 @@ impl<'lock> RequirementsTxtExport<'lock> { target: &impl Installable<'lock>, prune: &[PackageName], extras: &ExtrasSpecification, - dev: &DevGroupsManifest, + dev: &DependencyGroupsWithDefaults, editable: EditableMode, hashes: bool, install_options: &'lock InstallOptions, diff --git a/crates/uv-resolver/src/lock/tree.rs b/crates/uv-resolver/src/lock/tree.rs index 8b04e2dc2..3bdd8877d 100644 --- a/crates/uv-resolver/src/lock/tree.rs +++ b/crates/uv-resolver/src/lock/tree.rs @@ -7,7 +7,7 @@ use petgraph::prelude::EdgeRef; use petgraph::Direction; use rustc_hash::{FxBuildHasher, FxHashMap, FxHashSet}; -use uv_configuration::DevGroupsManifest; +use uv_configuration::DependencyGroupsWithDefaults; use uv_normalize::{ExtraName, GroupName, PackageName}; use uv_pep440::Version; use uv_pep508::MarkerTree; @@ -39,7 +39,7 @@ impl<'env> TreeDisplay<'env> { depth: usize, prune: &[PackageName], packages: &[PackageName], - dev: &DevGroupsManifest, + dev: &DependencyGroupsWithDefaults, no_dedupe: bool, invert: bool, ) -> Self { diff --git a/crates/uv/src/commands/pip/compile.rs b/crates/uv/src/commands/pip/compile.rs index b856e6b77..512769bfe 100644 --- a/crates/uv/src/commands/pip/compile.rs +++ b/crates/uv/src/commands/pip/compile.rs @@ -13,9 +13,8 @@ use tracing::debug; use uv_cache::Cache; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - BuildOptions, Concurrency, ConfigSettings, Constraints, DevGroupsSpecification, - ExtrasSpecification, IndexStrategy, NoBinary, NoBuild, PreviewMode, Reinstall, SourceStrategy, - Upgrade, + BuildOptions, Concurrency, ConfigSettings, Constraints, DependencyGroups, ExtrasSpecification, + IndexStrategy, NoBinary, NoBuild, PreviewMode, Reinstall, SourceStrategy, Upgrade, }; use uv_configuration::{KeyringProviderType, TargetTriple}; use uv_dispatch::{BuildDispatch, SharedState}; @@ -60,7 +59,7 @@ pub(crate) async fn pip_compile( build_constraints_from_workspace: Vec, environments: SupportedEnvironments, extras: ExtrasSpecification, - groups: DevGroupsSpecification, + groups: DependencyGroups, output_file: Option<&Path>, resolution_mode: ResolutionMode, prerelease_mode: PrereleaseMode, diff --git a/crates/uv/src/commands/pip/install.rs b/crates/uv/src/commands/pip/install.rs index 2aa78668f..07f6a2c41 100644 --- a/crates/uv/src/commands/pip/install.rs +++ b/crates/uv/src/commands/pip/install.rs @@ -9,7 +9,7 @@ use tracing::{debug, enabled, Level}; use uv_cache::Cache; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - BuildOptions, Concurrency, ConfigSettings, Constraints, DevGroupsSpecification, DryRun, + BuildOptions, Concurrency, ConfigSettings, Constraints, DependencyGroups, DryRun, ExtrasSpecification, HashCheckingMode, IndexStrategy, PreviewMode, Reinstall, SourceStrategy, Upgrade, }; @@ -54,7 +54,7 @@ pub(crate) async fn pip_install( overrides_from_workspace: Vec, build_constraints_from_workspace: Vec, extras: &ExtrasSpecification, - groups: &DevGroupsSpecification, + groups: &DependencyGroups, resolution_mode: ResolutionMode, prerelease_mode: PrereleaseMode, dependency_mode: DependencyMode, diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 192b9437b..2f35af15e 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -13,7 +13,7 @@ use uv_tool::InstalledTools; use uv_cache::Cache; use uv_client::{BaseClientBuilder, RegistryClient}; use uv_configuration::{ - BuildOptions, Concurrency, ConfigSettings, Constraints, DevGroupsSpecification, DryRun, + BuildOptions, Concurrency, ConfigSettings, Constraints, DependencyGroups, DryRun, ExtrasSpecification, Overrides, Reinstall, Upgrade, }; use uv_dispatch::BuildDispatch; @@ -54,7 +54,7 @@ pub(crate) async fn read_requirements( constraints: &[RequirementsSource], overrides: &[RequirementsSource], extras: &ExtrasSpecification, - groups: &DevGroupsSpecification, + groups: &DependencyGroups, client_builder: &BaseClientBuilder<'_>, ) -> Result { // If the user requests `extras` but does not provide a valid source (e.g., a `pyproject.toml`), @@ -114,7 +114,7 @@ pub(crate) async fn resolve( mut project: Option, workspace_members: BTreeSet, extras: &ExtrasSpecification, - groups: &DevGroupsSpecification, + groups: &DependencyGroups, preferences: Vec, installed_packages: InstalledPackages, hasher: &HashStrategy, diff --git a/crates/uv/src/commands/pip/sync.rs b/crates/uv/src/commands/pip/sync.rs index 5d518be92..8c1225264 100644 --- a/crates/uv/src/commands/pip/sync.rs +++ b/crates/uv/src/commands/pip/sync.rs @@ -9,7 +9,7 @@ use tracing::debug; use uv_cache::Cache; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - BuildOptions, Concurrency, ConfigSettings, Constraints, DevGroupsSpecification, DryRun, + BuildOptions, Concurrency, ConfigSettings, Constraints, DependencyGroups, DryRun, ExtrasSpecification, HashCheckingMode, IndexStrategy, PreviewMode, Reinstall, SourceStrategy, Upgrade, }; @@ -87,7 +87,7 @@ pub(crate) async fn pip_sync( // Initialize a few defaults. let overrides = &[]; let extras = ExtrasSpecification::default(); - let groups = DevGroupsSpecification::default(); + let groups = DependencyGroups::default(); let upgrade = Upgrade::default(); let resolution_mode = ResolutionMode::default(); let prerelease_mode = PrereleaseMode::default(); diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index cc353da25..c0f17e79b 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -16,8 +16,8 @@ use uv_cache::Cache; use uv_cache_key::RepositoryUrl; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - Concurrency, Constraints, DevGroupsSpecification, DevMode, DryRun, EditableMode, - ExtrasSpecification, InstallOptions, PreviewMode, SourceStrategy, + Concurrency, Constraints, DependencyGroups, DevMode, DryRun, EditableMode, ExtrasSpecification, + InstallOptions, PreviewMode, SourceStrategy, }; use uv_dispatch::BuildDispatch; use uv_distribution::DistributionDatabase; @@ -820,22 +820,22 @@ async fn lock_and_sync( let (extras, dev) = match dependency_type { DependencyType::Production => { let extras = ExtrasSpecification::None; - let dev = DevGroupsSpecification::from_dev_mode(DevMode::Exclude); + let dev = DependencyGroups::from_dev_mode(DevMode::Exclude); (extras, dev) } DependencyType::Dev => { let extras = ExtrasSpecification::None; - let dev = DevGroupsSpecification::from_dev_mode(DevMode::Include); + let dev = DependencyGroups::from_dev_mode(DevMode::Include); (extras, dev) } DependencyType::Optional(ref extra_name) => { let extras = ExtrasSpecification::Some(vec![extra_name.clone()]); - let dev = DevGroupsSpecification::from_dev_mode(DevMode::Exclude); + let dev = DependencyGroups::from_dev_mode(DevMode::Exclude); (extras, dev) } DependencyType::Group(ref group_name) => { let extras = ExtrasSpecification::None; - let dev = DevGroupsSpecification::from_group(group_name.clone()); + let dev = DependencyGroups::from_group(group_name.clone()); (extras, dev) } }; diff --git a/crates/uv/src/commands/project/export.rs b/crates/uv/src/commands/project/export.rs index 8792405a6..13244f70d 100644 --- a/crates/uv/src/commands/project/export.rs +++ b/crates/uv/src/commands/project/export.rs @@ -8,8 +8,8 @@ use uv_settings::PythonInstallMirrors; use uv_cache::Cache; use uv_configuration::{ - Concurrency, DevGroupsSpecification, EditableMode, ExportFormat, ExtrasSpecification, - InstallOptions, PreviewMode, + Concurrency, DependencyGroups, EditableMode, ExportFormat, ExtrasSpecification, InstallOptions, + PreviewMode, }; use uv_normalize::PackageName; use uv_python::{PythonDownloads, PythonPreference, PythonRequest}; @@ -59,7 +59,7 @@ pub(crate) async fn export( install_options: InstallOptions, output_file: Option, extras: ExtrasSpecification, - dev: DevGroupsSpecification, + dev: DependencyGroups, editable: EditableMode, locked: bool, frozen: bool, diff --git a/crates/uv/src/commands/project/install_target.rs b/crates/uv/src/commands/project/install_target.rs index 205b7d59c..1db8ad2fe 100644 --- a/crates/uv/src/commands/project/install_target.rs +++ b/crates/uv/src/commands/project/install_target.rs @@ -5,7 +5,7 @@ use std::str::FromStr; use itertools::Either; use rustc_hash::FxHashSet; -use uv_configuration::{DevGroupsManifest, ExtrasSpecification}; +use uv_configuration::{DependencyGroupsWithDefaults, ExtrasSpecification}; use uv_distribution_types::Index; use uv_normalize::PackageName; use uv_pypi_types::{LenientRequirement, VerbatimParsedUrl}; @@ -299,7 +299,10 @@ impl<'lock> InstallTarget<'lock> { /// Validate the dependency groups requested by the [`DependencyGroupSpecifier`]. #[allow(clippy::result_large_err)] - pub(crate) fn validate_groups(self, groups: &DevGroupsManifest) -> Result<(), ProjectError> { + pub(crate) fn validate_groups( + self, + groups: &DependencyGroupsWithDefaults, + ) -> Result<(), ProjectError> { // If no groups were specified, short-circuit. if groups.explicit_names().next().is_none() { return Ok(()); diff --git a/crates/uv/src/commands/project/lock.rs b/crates/uv/src/commands/project/lock.rs index 243e808f6..af6933781 100644 --- a/crates/uv/src/commands/project/lock.rs +++ b/crates/uv/src/commands/project/lock.rs @@ -12,7 +12,7 @@ use tracing::debug; use uv_cache::Cache; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - Concurrency, Constraints, DevGroupsSpecification, DryRun, ExtrasSpecification, PreviewMode, + Concurrency, Constraints, DependencyGroups, DryRun, ExtrasSpecification, PreviewMode, Reinstall, Upgrade, }; use uv_dispatch::BuildDispatch; @@ -576,7 +576,7 @@ async fn do_lock( // optional on the downstream APIs. let build_hasher = HashStrategy::default(); let extras = ExtrasSpecification::default(); - let groups = DevGroupsSpecification::default(); + let groups = DependencyGroups::default(); // Resolve the flat indexes from `--find-links`. let flat_index = { diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index 42e02b180..0ecdc6e64 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -12,7 +12,7 @@ use uv_cache::{Cache, CacheBucket}; use uv_cache_key::cache_digest; use uv_client::{BaseClientBuilder, FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - Concurrency, Constraints, DevGroupsManifest, DevGroupsSpecification, DryRun, + Concurrency, Constraints, DependencyGroups, DependencyGroupsWithDefaults, DryRun, ExtrasSpecification, PreviewMode, Reinstall, SourceStrategy, Upgrade, }; use uv_dispatch::{BuildDispatch, SharedState}; @@ -260,8 +260,8 @@ pub(crate) struct ConflictError { pub(crate) set: ConflictSet, /// The items from the set that were enabled, and thus create the conflict. pub(crate) conflicts: Vec, - /// The manifest of enabled dependency groups. - pub(crate) dev: DevGroupsManifest, + /// Enabled dependency groups with defaults applied. + pub(crate) dev: DependencyGroupsWithDefaults, } impl std::fmt::Display for ConflictError { @@ -1714,7 +1714,7 @@ pub(crate) async fn resolve_environment( // TODO(charlie): These are all default values. We should consider whether we want to make them // optional on the downstream APIs. let extras = ExtrasSpecification::default(); - let groups = DevGroupsSpecification::default(); + let groups = DependencyGroups::default(); let hasher = HashStrategy::default(); let build_constraints = Constraints::default(); let build_hasher = HashStrategy::default(); @@ -2084,7 +2084,7 @@ pub(crate) async fn update_environment( let build_constraints = Constraints::default(); let build_hasher = HashStrategy::default(); let extras = ExtrasSpecification::default(); - let groups = DevGroupsSpecification::default(); + let groups = DependencyGroups::default(); let hasher = HashStrategy::default(); let preferences = Vec::default(); @@ -2274,7 +2274,7 @@ pub(crate) fn default_dependency_groups( pub(crate) fn detect_conflicts( lock: &Lock, extras: &ExtrasSpecification, - dev: &DevGroupsManifest, + dev: &DependencyGroupsWithDefaults, ) -> Result<(), ProjectError> { // Note that we need to collect all extras and groups that match in // a particular set, since extras can be declared as conflicting with diff --git a/crates/uv/src/commands/project/remove.rs b/crates/uv/src/commands/project/remove.rs index 39778333f..e217b414f 100644 --- a/crates/uv/src/commands/project/remove.rs +++ b/crates/uv/src/commands/project/remove.rs @@ -9,7 +9,7 @@ use tracing::debug; use uv_cache::Cache; use uv_configuration::{ - Concurrency, DevGroupsSpecification, DryRun, EditableMode, ExtrasSpecification, InstallOptions, + Concurrency, DependencyGroups, DryRun, EditableMode, ExtrasSpecification, InstallOptions, PreviewMode, }; use uv_fs::Simplified; @@ -326,7 +326,7 @@ pub(crate) async fn remove( target, venv, &extras, - &DevGroupsSpecification::default().with_defaults(defaults), + &DependencyGroups::default().with_defaults(defaults), EditableMode::Editable, install_options, Modifications::Exact, diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index 6248634ab..3345e5fd5 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -17,7 +17,7 @@ use uv_cache::Cache; use uv_cli::ExternalCommand; use uv_client::BaseClientBuilder; use uv_configuration::{ - Concurrency, DevGroupsSpecification, DryRun, EditableMode, ExtrasSpecification, InstallOptions, + Concurrency, DependencyGroups, DryRun, EditableMode, ExtrasSpecification, InstallOptions, PreviewMode, }; use uv_fs::which::is_executable; @@ -74,7 +74,7 @@ pub(crate) async fn run( no_project: bool, no_config: bool, extras: ExtrasSpecification, - dev: DevGroupsSpecification, + dev: DependencyGroups, editable: EditableMode, modifications: Modifications, python: Option, diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index add777206..85b91f391 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -10,7 +10,7 @@ use owo_colors::OwoColorize; use uv_cache::Cache; use uv_client::{FlatIndexClient, RegistryClientBuilder}; use uv_configuration::{ - Concurrency, Constraints, DevGroupsManifest, DevGroupsSpecification, DryRun, EditableMode, + Concurrency, Constraints, DependencyGroups, DependencyGroupsWithDefaults, DryRun, EditableMode, ExtrasSpecification, HashCheckingMode, InstallOptions, PreviewMode, }; use uv_dispatch::BuildDispatch; @@ -56,7 +56,7 @@ pub(crate) async fn sync( all_packages: bool, package: Option, extras: ExtrasSpecification, - dev: DevGroupsSpecification, + dev: DependencyGroups, editable: EditableMode, install_options: InstallOptions, modifications: Modifications, @@ -507,7 +507,7 @@ pub(super) async fn do_sync( target: InstallTarget<'_>, venv: &PythonEnvironment, extras: &ExtrasSpecification, - dev: &DevGroupsManifest, + dev: &DependencyGroupsWithDefaults, editable: EditableMode, install_options: InstallOptions, modifications: Modifications, diff --git a/crates/uv/src/commands/project/tree.rs b/crates/uv/src/commands/project/tree.rs index eb6ff4990..54c4e07c3 100644 --- a/crates/uv/src/commands/project/tree.rs +++ b/crates/uv/src/commands/project/tree.rs @@ -7,7 +7,7 @@ use tokio::sync::Semaphore; use uv_cache::{Cache, Refresh}; use uv_cache_info::Timestamp; use uv_client::RegistryClientBuilder; -use uv_configuration::{Concurrency, DevGroupsSpecification, PreviewMode, TargetTriple}; +use uv_configuration::{Concurrency, DependencyGroups, PreviewMode, TargetTriple}; use uv_distribution_types::IndexCapabilities; use uv_pep508::PackageName; use uv_python::{PythonDownloads, PythonPreference, PythonRequest, PythonVersion}; @@ -33,7 +33,7 @@ use crate::settings::{NetworkSettings, ResolverSettings}; #[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn tree( project_dir: &Path, - dev: DevGroupsSpecification, + dev: DependencyGroups, locked: bool, frozen: bool, universal: bool, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 8fe1b2dcc..09441ef83 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -22,7 +22,7 @@ use uv_cli::{ }; use uv_client::Connectivity; use uv_configuration::{ - BuildOptions, Concurrency, ConfigSettings, DevGroupsSpecification, DryRun, EditableMode, + BuildOptions, Concurrency, ConfigSettings, DependencyGroups, DryRun, EditableMode, ExportFormat, ExtrasSpecification, HashCheckingMode, IndexStrategy, InstallOptions, KeyringProviderType, NoBinary, NoBuild, PreviewMode, ProjectBuildBackend, Reinstall, RequiredVersion, SourceStrategy, TargetTriple, TrustedHost, TrustedPublishing, Upgrade, @@ -298,7 +298,7 @@ pub(crate) struct RunSettings { pub(crate) locked: bool, pub(crate) frozen: bool, pub(crate) extras: ExtrasSpecification, - pub(crate) dev: DevGroupsSpecification, + pub(crate) dev: DependencyGroups, pub(crate) editable: EditableMode, pub(crate) modifications: Modifications, pub(crate) with: Vec, @@ -385,7 +385,7 @@ impl RunSettings { no_extra, extra.unwrap_or_default(), ), - dev: DevGroupsSpecification::from_args( + dev: DependencyGroups::from_args( dev, no_dev, only_dev, @@ -989,7 +989,7 @@ pub(crate) struct SyncSettings { pub(crate) script: Option, pub(crate) active: Option, pub(crate) extras: ExtrasSpecification, - pub(crate) dev: DevGroupsSpecification, + pub(crate) dev: DependencyGroups, pub(crate) editable: EditableMode, pub(crate) install_options: InstallOptions, pub(crate) modifications: Modifications, @@ -1058,7 +1058,7 @@ impl SyncSettings { no_extra, extra.unwrap_or_default(), ), - dev: DevGroupsSpecification::from_args( + dev: DependencyGroups::from_args( dev, no_dev, only_dev, @@ -1364,7 +1364,7 @@ impl RemoveSettings { #[allow(clippy::struct_excessive_bools)] #[derive(Debug, Clone)] pub(crate) struct TreeSettings { - pub(crate) dev: DevGroupsSpecification, + pub(crate) dev: DependencyGroups, pub(crate) locked: bool, pub(crate) frozen: bool, pub(crate) universal: bool, @@ -1412,7 +1412,7 @@ impl TreeSettings { .unwrap_or_default(); Self { - dev: DevGroupsSpecification::from_args( + dev: DependencyGroups::from_args( dev, no_dev, only_dev, @@ -1450,7 +1450,7 @@ pub(crate) struct ExportSettings { pub(crate) package: Option, pub(crate) prune: Vec, pub(crate) extras: ExtrasSpecification, - pub(crate) dev: DevGroupsSpecification, + pub(crate) dev: DependencyGroups, pub(crate) editable: EditableMode, pub(crate) hashes: bool, pub(crate) install_options: InstallOptions, @@ -1518,7 +1518,7 @@ impl ExportSettings { no_extra, extra.unwrap_or_default(), ), - dev: DevGroupsSpecification::from_args( + dev: DependencyGroups::from_args( dev, no_dev, only_dev, @@ -2654,7 +2654,7 @@ pub(crate) struct PipSettings { pub(crate) install_mirrors: PythonInstallMirrors, pub(crate) system: bool, pub(crate) extras: ExtrasSpecification, - pub(crate) groups: DevGroupsSpecification, + pub(crate) groups: DependencyGroups, pub(crate) break_system_packages: bool, pub(crate) target: Option, pub(crate) prefix: Option, @@ -2848,7 +2848,7 @@ impl PipSettings { args.no_extra.combine(no_extra).unwrap_or_default(), args.extra.combine(extra).unwrap_or_default(), ), - groups: DevGroupsSpecification::from_args( + groups: DependencyGroups::from_args( false, false, false, diff --git a/crates/uv/tests/it/show_settings.rs b/crates/uv/tests/it/show_settings.rs index be833e708..986dd60e0 100644 --- a/crates/uv/tests/it/show_settings.rs +++ b/crates/uv/tests/it/show_settings.rs @@ -147,14 +147,14 @@ fn resolve_uv_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -321,14 +321,14 @@ fn resolve_uv_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -496,14 +496,14 @@ fn resolve_uv_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -703,14 +703,14 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -849,14 +849,14 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -1034,14 +1034,14 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -1262,14 +1262,14 @@ fn resolve_index_url() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -1498,14 +1498,14 @@ fn resolve_index_url() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -1697,14 +1697,14 @@ fn resolve_find_links() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -1865,14 +1865,14 @@ fn resolve_top_level() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2085,14 +2085,14 @@ fn resolve_top_level() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2288,14 +2288,14 @@ fn resolve_top_level() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2456,14 +2456,14 @@ fn resolve_user_configuration() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2607,14 +2607,14 @@ fn resolve_user_configuration() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2758,14 +2758,14 @@ fn resolve_user_configuration() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -2911,14 +2911,14 @@ fn resolve_user_configuration() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -3244,14 +3244,14 @@ fn resolve_poetry_toml() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -3453,14 +3453,14 @@ fn resolve_both() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -3750,14 +3750,14 @@ fn resolve_config_file() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -3995,14 +3995,14 @@ fn resolve_skip_empty() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -4149,14 +4149,14 @@ fn resolve_skip_empty() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -4322,14 +4322,14 @@ fn allow_insecure_host() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -4548,14 +4548,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -4753,14 +4753,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -4964,14 +4964,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -5170,14 +5170,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -5383,14 +5383,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -5589,14 +5589,14 @@ fn index_priority() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -5748,14 +5748,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -5893,14 +5893,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -6036,14 +6036,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -6181,14 +6181,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -6324,14 +6324,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [], @@ -6468,14 +6468,14 @@ fn verify_hashes() -> anyhow::Result<()> { }, system: false, extras: None, - groups: DevGroupsSpecification( - DevGroupsSpecificationInner { + groups: DependencyGroups( + DependencyGroupsInner { include: Some( [], ), exclude: [], only_groups: false, - history: DevGroupsSpecificationHistory { + history: DependencyGroupsHistory { dev_mode: None, group: [], only_group: [],