mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00

## Summary We now persist the `ResolverInstallerOptions` when writing out a tool receipt. When upgrading, we grab the saved options, and merge with the command-line arguments and user-level filesystem settings (CLI > receipt > filesystem).
20 lines
603 B
Rust
20 lines
603 B
Rust
#[derive(Debug, Default, Clone, Copy, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
|
|
#[serde(rename_all = "kebab-case", deny_unknown_fields)]
|
|
pub enum SourceStrategy {
|
|
/// Use `tool.uv.sources` when resolving dependencies.
|
|
#[default]
|
|
Enabled,
|
|
/// Ignore `tool.uv.sources` when resolving dependencies.
|
|
Disabled,
|
|
}
|
|
|
|
impl SourceStrategy {
|
|
/// Return the [`SourceStrategy`] from the command-line arguments, if any.
|
|
pub fn from_args(no_sources: bool) -> Self {
|
|
if no_sources {
|
|
Self::Disabled
|
|
} else {
|
|
Self::Enabled
|
|
}
|
|
}
|
|
}
|