mirror of https://github.com/astral-sh/uv
Merge branch 'main' into zb/lock-extra-build-dependencies
This commit is contained in:
commit
53d4c66c2a
|
|
@ -4732,6 +4732,7 @@ dependencies = [
|
|||
"uv-pep440",
|
||||
"uv-pep508",
|
||||
"uv-performance-memory-allocator",
|
||||
"uv-platform",
|
||||
"uv-platform-tags",
|
||||
"uv-publish",
|
||||
"uv-pypi-types",
|
||||
|
|
@ -5553,6 +5554,23 @@ dependencies = [
|
|||
"tikv-jemallocator",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uv-platform"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"fs-err",
|
||||
"goblin",
|
||||
"indoc",
|
||||
"procfs",
|
||||
"regex",
|
||||
"target-lexicon",
|
||||
"thiserror 2.0.12",
|
||||
"tracing",
|
||||
"uv-fs",
|
||||
"uv-platform-tags",
|
||||
"uv-static",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uv-platform-tags"
|
||||
version = "0.0.1"
|
||||
|
|
@ -5646,14 +5664,12 @@ dependencies = [
|
|||
"dunce",
|
||||
"fs-err",
|
||||
"futures",
|
||||
"goblin",
|
||||
"indexmap",
|
||||
"indoc",
|
||||
"insta",
|
||||
"itertools 0.14.0",
|
||||
"once_cell",
|
||||
"owo-colors",
|
||||
"procfs",
|
||||
"ref-cast",
|
||||
"regex",
|
||||
"reqwest",
|
||||
|
|
@ -5687,6 +5703,7 @@ dependencies = [
|
|||
"uv-install-wheel",
|
||||
"uv-pep440",
|
||||
"uv-pep508",
|
||||
"uv-platform",
|
||||
"uv-platform-tags",
|
||||
"uv-pypi-types",
|
||||
"uv-redacted",
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@ uv-once-map = { path = "crates/uv-once-map" }
|
|||
uv-options-metadata = { path = "crates/uv-options-metadata" }
|
||||
uv-pep440 = { path = "crates/uv-pep440", features = ["tracing", "rkyv", "version-ranges"] }
|
||||
uv-pep508 = { path = "crates/uv-pep508", features = ["non-pep508-extensions"] }
|
||||
uv-platform = { path = "crates/uv-platform" }
|
||||
uv-platform-tags = { path = "crates/uv-platform-tags" }
|
||||
uv-publish = { path = "crates/uv-publish" }
|
||||
uv-pypi-types = { path = "crates/uv-pypi-types" }
|
||||
|
|
|
|||
|
|
@ -99,8 +99,8 @@ mod resolver {
|
|||
use uv_pypi_types::{Conflicts, ResolverMarkerEnvironment};
|
||||
use uv_python::Interpreter;
|
||||
use uv_resolver::{
|
||||
FlatIndex, InMemoryIndex, Manifest, OptionsBuilder, Preferences, PythonRequirement,
|
||||
Resolver, ResolverEnvironment, ResolverOutput,
|
||||
ExcludeNewer, FlatIndex, InMemoryIndex, Manifest, OptionsBuilder, Preferences,
|
||||
PythonRequirement, Resolver, ResolverEnvironment, ResolverOutput,
|
||||
};
|
||||
use uv_types::{BuildIsolation, EmptyInstalledPackages, HashStrategy};
|
||||
use uv_workspace::WorkspaceCache;
|
||||
|
|
@ -145,7 +145,7 @@ mod resolver {
|
|||
let concurrency = Concurrency::default();
|
||||
let config_settings = ConfigSettings::default();
|
||||
let config_settings_package = PackageConfigSettings::default();
|
||||
let exclude_newer = Some(
|
||||
let exclude_newer = ExcludeNewer::global(
|
||||
jiff::civil::date(2024, 9, 1)
|
||||
.to_zoned(jiff::tz::TimeZone::UTC)
|
||||
.unwrap()
|
||||
|
|
@ -159,7 +159,9 @@ mod resolver {
|
|||
let index = InMemoryIndex::default();
|
||||
let index_locations = IndexLocations::default();
|
||||
let installed_packages = EmptyInstalledPackages;
|
||||
let options = OptionsBuilder::new().exclude_newer(exclude_newer).build();
|
||||
let options = OptionsBuilder::new()
|
||||
.exclude_newer(exclude_newer.clone())
|
||||
.build();
|
||||
let sources = SourceStrategy::default();
|
||||
let dependency_metadata = DependencyMetadata::default();
|
||||
let conflicts = Conflicts::empty();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ use uv_pep508::{MarkerTree, Requirement};
|
|||
use uv_pypi_types::VerbatimParsedUrl;
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_redacted::DisplaySafeUrl;
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, ForkStrategy, PrereleaseMode, ResolutionMode};
|
||||
use uv_resolver::{
|
||||
AnnotationStyle, ExcludeNewerPackageEntry, ExcludeNewerTimestamp, ForkStrategy, PrereleaseMode,
|
||||
ResolutionMode,
|
||||
};
|
||||
use uv_static::EnvVars;
|
||||
use uv_torch::TorchMode;
|
||||
use uv_workspace::pyproject_mut::AddBoundsKind;
|
||||
|
|
@ -2749,7 +2752,16 @@ pub struct VenvArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER)]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
|
||||
/// Limit candidate packages for a specific package to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
|
||||
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
///
|
||||
/// Can be provided multiple times for different packages.
|
||||
#[arg(long)]
|
||||
pub exclude_newer_package: Option<Vec<ExcludeNewerPackageEntry>>,
|
||||
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
|
|
@ -4777,7 +4789,16 @@ pub struct ToolUpgradeArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
|
||||
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
|
||||
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
///
|
||||
/// Can be provided multiple times for different packages.
|
||||
#[arg(long, help_heading = "Resolver options")]
|
||||
pub exclude_newer_package: Option<Vec<ExcludeNewerPackageEntry>>,
|
||||
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
|
|
@ -5572,7 +5593,16 @@ pub struct InstallerArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
|
||||
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
|
||||
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
///
|
||||
/// Can be provided multiple times for different packages.
|
||||
#[arg(long, help_heading = "Resolver options")]
|
||||
pub exclude_newer_package: Option<Vec<ExcludeNewerPackageEntry>>,
|
||||
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
|
|
@ -5773,7 +5803,16 @@ pub struct ResolverArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
|
||||
/// Limit candidate packages for a specific package to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
|
||||
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
///
|
||||
/// Can be provided multiple times for different packages.
|
||||
#[arg(long, help_heading = "Resolver options")]
|
||||
pub exclude_newer_package: Option<Vec<ExcludeNewerPackageEntry>>,
|
||||
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
|
|
@ -5970,7 +6009,16 @@ pub struct ResolverInstallerArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
|
||||
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in the format `PACKAGE=DATE`, where `DATE` is an RFC 3339 timestamp
|
||||
/// (e.g., `2006-12-02T02:07:43Z`) or local date (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
///
|
||||
/// Can be provided multiple times for different packages.
|
||||
#[arg(long, help_heading = "Resolver options")]
|
||||
pub exclude_newer_package: Option<Vec<ExcludeNewerPackageEntry>>,
|
||||
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
|
|
@ -6059,7 +6107,7 @@ pub struct FetchArgs {
|
|||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`) in your system's configured time zone.
|
||||
#[arg(long, env = EnvVars::UV_EXCLUDE_NEWER, help_heading = "Resolver options")]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use anstream::eprintln;
|
|||
|
||||
use uv_cache::Refresh;
|
||||
use uv_configuration::{ConfigSettings, PackageConfigSettings};
|
||||
use uv_resolver::PrereleaseMode;
|
||||
use uv_resolver::{ExcludeNewer, ExcludeNewerPackage, PrereleaseMode};
|
||||
use uv_settings::{Combine, PipOptions, ResolverInstallerOptions, ResolverOptions};
|
||||
use uv_warnings::owo_colors::OwoColorize;
|
||||
|
||||
|
|
@ -69,6 +69,7 @@ impl From<ResolverArgs> for PipOptions {
|
|||
exclude_newer,
|
||||
link_mode,
|
||||
no_sources,
|
||||
exclude_newer_package,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -93,6 +94,7 @@ impl From<ResolverArgs> for PipOptions {
|
|||
no_build_isolation: flag(no_build_isolation, build_isolation, "build-isolation"),
|
||||
no_build_isolation_package: Some(no_build_isolation_package),
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
..PipOptions::from(index_args)
|
||||
|
|
@ -118,6 +120,7 @@ impl From<InstallerArgs> for PipOptions {
|
|||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
exclude_newer_package,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -134,6 +137,7 @@ impl From<InstallerArgs> for PipOptions {
|
|||
}),
|
||||
no_build_isolation: flag(no_build_isolation, build_isolation, "build-isolation"),
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
compile_bytecode: flag(compile_bytecode, no_compile_bytecode, "compile-bytecode"),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
|
|
@ -168,6 +172,7 @@ impl From<ResolverInstallerArgs> for PipOptions {
|
|||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
exclude_newer_package,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -194,6 +199,7 @@ impl From<ResolverInstallerArgs> for PipOptions {
|
|||
no_build_isolation: flag(no_build_isolation, build_isolation, "build-isolation"),
|
||||
no_build_isolation_package: Some(no_build_isolation_package),
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
compile_bytecode: flag(compile_bytecode, no_compile_bytecode, "compile-bytecode"),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
|
|
@ -285,6 +291,7 @@ pub fn resolver_options(
|
|||
exclude_newer,
|
||||
link_mode,
|
||||
no_sources,
|
||||
exclude_newer_package,
|
||||
} = resolver_args;
|
||||
|
||||
let BuildOptionsArgs {
|
||||
|
|
@ -347,7 +354,10 @@ pub fn resolver_options(
|
|||
}),
|
||||
no_build_isolation: flag(no_build_isolation, build_isolation, "build-isolation"),
|
||||
no_build_isolation_package: Some(no_build_isolation_package),
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
exclude_newer,
|
||||
exclude_newer_package.unwrap_or_default(),
|
||||
),
|
||||
link_mode,
|
||||
no_build: flag(no_build, build, "build"),
|
||||
no_build_package: Some(no_build_package),
|
||||
|
|
@ -383,6 +393,7 @@ pub fn resolver_installer_options(
|
|||
no_build_isolation_package,
|
||||
build_isolation,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
link_mode,
|
||||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
|
|
@ -466,6 +477,7 @@ pub fn resolver_installer_options(
|
|||
Some(no_build_isolation_package)
|
||||
},
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
compile_bytecode: flag(compile_bytecode, no_compile_bytecode, "compile-bytecode"),
|
||||
no_build: flag(no_build, build, "build"),
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ pub struct BuildDispatch<'a> {
|
|||
config_settings: &'a ConfigSettings,
|
||||
config_settings_package: &'a PackageConfigSettings,
|
||||
hasher: &'a HashStrategy,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
source_build_context: SourceBuildContext,
|
||||
build_extra_env_vars: FxHashMap<OsString, OsString>,
|
||||
sources: SourceStrategy,
|
||||
|
|
@ -120,7 +120,7 @@ impl<'a> BuildDispatch<'a> {
|
|||
link_mode: uv_install_wheel::LinkMode,
|
||||
build_options: &'a BuildOptions,
|
||||
hasher: &'a HashStrategy,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
sources: SourceStrategy,
|
||||
workspace_cache: WorkspaceCache,
|
||||
concurrency: Concurrency,
|
||||
|
|
@ -236,7 +236,7 @@ impl BuildContext for BuildDispatch<'_> {
|
|||
.with_constraints(self.constraints.clone())
|
||||
.with_preferences(self.preferences.clone()),
|
||||
OptionsBuilder::new()
|
||||
.exclude_newer(self.exclude_newer)
|
||||
.exclude_newer(self.exclude_newer.clone())
|
||||
.index_strategy(self.index_strategy)
|
||||
.build_options(self.build_options.clone())
|
||||
.flexibility(Flexibility::Fixed)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
[package]
|
||||
name = "uv-platform"
|
||||
version = "0.0.1"
|
||||
edition = { workspace = true }
|
||||
rust-version = { workspace = true }
|
||||
homepage = { workspace = true }
|
||||
documentation = { workspace = true }
|
||||
repository = { workspace = true }
|
||||
authors = { workspace = true }
|
||||
license = { workspace = true }
|
||||
|
||||
[lib]
|
||||
doctest = false
|
||||
|
||||
[lints]
|
||||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
uv-static = { workspace = true }
|
||||
uv-fs = { workspace = true }
|
||||
uv-platform-tags = { workspace = true }
|
||||
|
||||
fs-err = { workspace = true }
|
||||
goblin = { workspace = true }
|
||||
regex = { workspace = true }
|
||||
target-lexicon = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
tracing = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
procfs = { workspace = true }
|
||||
|
||||
[dev-dependencies]
|
||||
indoc = { workspace = true }
|
||||
|
|
@ -0,0 +1,249 @@
|
|||
use crate::Error;
|
||||
use std::fmt::Display;
|
||||
use std::str::FromStr;
|
||||
use std::{cmp, fmt};
|
||||
|
||||
/// Architecture variants, e.g., with support for different instruction sets
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash, Ord, PartialOrd)]
|
||||
pub enum ArchVariant {
|
||||
/// Targets 64-bit Intel/AMD CPUs newer than Nehalem (2008).
|
||||
/// Includes SSE3, SSE4 and other post-2003 CPU instructions.
|
||||
V2,
|
||||
/// Targets 64-bit Intel/AMD CPUs newer than Haswell (2013) and Excavator (2015).
|
||||
/// Includes AVX, AVX2, MOVBE and other newer CPU instructions.
|
||||
V3,
|
||||
/// Targets 64-bit Intel/AMD CPUs with AVX-512 instructions (post-2017 Intel CPUs).
|
||||
/// Many post-2017 Intel CPUs do not support AVX-512.
|
||||
V4,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Arch {
|
||||
pub(crate) family: target_lexicon::Architecture,
|
||||
pub(crate) variant: Option<ArchVariant>,
|
||||
}
|
||||
|
||||
impl Ord for Arch {
|
||||
fn cmp(&self, other: &Self) -> cmp::Ordering {
|
||||
if self.family == other.family {
|
||||
return self.variant.cmp(&other.variant);
|
||||
}
|
||||
|
||||
// For the time being, manually make aarch64 windows disfavored
|
||||
// on its own host platform, because most packages don't have wheels for
|
||||
// aarch64 windows, making emulation more useful than native execution!
|
||||
//
|
||||
// The reason we do this in "sorting" and not "supports" is so that we don't
|
||||
// *refuse* to use an aarch64 windows pythons if they happen to be installed
|
||||
// and nothing else is available.
|
||||
//
|
||||
// Similarly if someone manually requests an aarch64 windows install, we
|
||||
// should respect that request (this is the way users should "override"
|
||||
// this behaviour).
|
||||
let preferred = if cfg!(all(windows, target_arch = "aarch64")) {
|
||||
Arch {
|
||||
family: target_lexicon::Architecture::X86_64,
|
||||
variant: None,
|
||||
}
|
||||
} else {
|
||||
// Prefer native architectures
|
||||
Arch::from_env()
|
||||
};
|
||||
|
||||
match (
|
||||
self.family == preferred.family,
|
||||
other.family == preferred.family,
|
||||
) {
|
||||
(true, true) => unreachable!(),
|
||||
(true, false) => cmp::Ordering::Less,
|
||||
(false, true) => cmp::Ordering::Greater,
|
||||
(false, false) => {
|
||||
// Both non-preferred, fallback to lexicographic order
|
||||
self.family.to_string().cmp(&other.family.to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for Arch {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<cmp::Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
impl Arch {
|
||||
pub fn new(family: target_lexicon::Architecture, variant: Option<ArchVariant>) -> Self {
|
||||
Self { family, variant }
|
||||
}
|
||||
|
||||
pub fn from_env() -> Self {
|
||||
Self {
|
||||
family: target_lexicon::HOST.architecture,
|
||||
variant: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Does the current architecture support running the other?
|
||||
///
|
||||
/// When the architecture is equal, this is always true. Otherwise, this is true if the
|
||||
/// architecture is transparently emulated or is a microarchitecture with worse performance
|
||||
/// characteristics.
|
||||
pub fn supports(self, other: Self) -> bool {
|
||||
if self == other {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Implement `variant` support checks
|
||||
|
||||
// Windows ARM64 runs emulated x86_64 binaries transparently
|
||||
// Similarly, macOS aarch64 runs emulated x86_64 binaries transparently if you have Rosetta
|
||||
// installed. We don't try to be clever and check if that's the case here, we just assume
|
||||
// that if x86_64 distributions are available, they're usable.
|
||||
if (cfg!(windows) || cfg!(target_os = "macos"))
|
||||
&& matches!(self.family, target_lexicon::Architecture::Aarch64(_))
|
||||
{
|
||||
return other.family == target_lexicon::Architecture::X86_64;
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn family(&self) -> target_lexicon::Architecture {
|
||||
self.family
|
||||
}
|
||||
|
||||
pub fn is_arm(&self) -> bool {
|
||||
matches!(self.family, target_lexicon::Architecture::Arm(_))
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Arch {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self.family {
|
||||
target_lexicon::Architecture::X86_32(target_lexicon::X86_32Architecture::I686) => {
|
||||
write!(f, "x86")?;
|
||||
}
|
||||
inner => write!(f, "{inner}")?,
|
||||
}
|
||||
if let Some(variant) = self.variant {
|
||||
write!(f, "_{variant}")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Arch {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
fn parse_family(s: &str) -> Result<target_lexicon::Architecture, Error> {
|
||||
let inner = match s {
|
||||
// Allow users to specify "x86" as a shorthand for the "i686" variant, they should not need
|
||||
// to specify the exact architecture and this variant is what we have downloads for.
|
||||
"x86" => {
|
||||
target_lexicon::Architecture::X86_32(target_lexicon::X86_32Architecture::I686)
|
||||
}
|
||||
_ => target_lexicon::Architecture::from_str(s)
|
||||
.map_err(|()| Error::UnknownArch(s.to_string()))?,
|
||||
};
|
||||
if matches!(inner, target_lexicon::Architecture::Unknown) {
|
||||
return Err(Error::UnknownArch(s.to_string()));
|
||||
}
|
||||
Ok(inner)
|
||||
}
|
||||
|
||||
// First check for a variant
|
||||
if let Some((Ok(family), Ok(variant))) = s
|
||||
.rsplit_once('_')
|
||||
.map(|(family, variant)| (parse_family(family), ArchVariant::from_str(variant)))
|
||||
{
|
||||
// We only support variants for `x86_64` right now
|
||||
if !matches!(family, target_lexicon::Architecture::X86_64) {
|
||||
return Err(Error::UnsupportedVariant(
|
||||
variant.to_string(),
|
||||
family.to_string(),
|
||||
));
|
||||
}
|
||||
return Ok(Self {
|
||||
family,
|
||||
variant: Some(variant),
|
||||
});
|
||||
}
|
||||
|
||||
let family = parse_family(s)?;
|
||||
|
||||
Ok(Self {
|
||||
family,
|
||||
variant: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for ArchVariant {
|
||||
type Err = ();
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"v2" => Ok(Self::V2),
|
||||
"v3" => Ok(Self::V3),
|
||||
"v4" => Ok(Self::V4),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for ArchVariant {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::V2 => write!(f, "v2"),
|
||||
Self::V3 => write!(f, "v3"),
|
||||
Self::V4 => write!(f, "v4"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Arch> for Arch {
|
||||
fn from(value: &uv_platform_tags::Arch) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Arch::Aarch64 => Arch::new(
|
||||
target_lexicon::Architecture::Aarch64(target_lexicon::Aarch64Architecture::Aarch64),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::Armv5TEL => Arch::new(
|
||||
target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv5te),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::Armv6L => Arch::new(
|
||||
target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv6),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::Armv7L => Arch::new(
|
||||
target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv7),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::S390X => Arch::new(target_lexicon::Architecture::S390x, None),
|
||||
uv_platform_tags::Arch::Powerpc => {
|
||||
Arch::new(target_lexicon::Architecture::Powerpc, None)
|
||||
}
|
||||
uv_platform_tags::Arch::Powerpc64 => {
|
||||
Arch::new(target_lexicon::Architecture::Powerpc64, None)
|
||||
}
|
||||
uv_platform_tags::Arch::Powerpc64Le => {
|
||||
Arch::new(target_lexicon::Architecture::Powerpc64le, None)
|
||||
}
|
||||
uv_platform_tags::Arch::X86 => Arch::new(
|
||||
target_lexicon::Architecture::X86_32(target_lexicon::X86_32Architecture::I686),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::X86_64 => Arch::new(target_lexicon::Architecture::X86_64, None),
|
||||
uv_platform_tags::Arch::LoongArch64 => {
|
||||
Arch::new(target_lexicon::Architecture::LoongArch64, None)
|
||||
}
|
||||
uv_platform_tags::Arch::Riscv64 => Arch::new(
|
||||
target_lexicon::Architecture::Riscv64(target_lexicon::Riscv64Architecture::Riscv64),
|
||||
None,
|
||||
),
|
||||
uv_platform_tags::Arch::Wasm32 => Arch::new(target_lexicon::Architecture::Wasm32, None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
//! Fetches CPU information.
|
||||
|
||||
use anyhow::Error;
|
||||
use std::io::Error;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
use procfs::{CpuInfo, Current};
|
||||
|
|
@ -14,7 +14,7 @@ use procfs::{CpuInfo, Current};
|
|||
/// More information on this can be found in the [Debian ARM Hard Float Port documentation](https://wiki.debian.org/ArmHardFloatPort#VFP).
|
||||
#[cfg(target_os = "linux")]
|
||||
pub(crate) fn detect_hardware_floating_point_support() -> Result<bool, Error> {
|
||||
let cpu_info = CpuInfo::current()?;
|
||||
let cpu_info = CpuInfo::current().map_err(Error::other)?;
|
||||
if let Some(features) = cpu_info.fields.get("Features") {
|
||||
if features.contains("vfp") {
|
||||
return Ok(true); // "vfp" found: hard-float (gnueabihf) detected
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
//! Platform detection for operating system, architecture, and libc.
|
||||
|
||||
use thiserror::Error;
|
||||
|
||||
pub use crate::arch::{Arch, ArchVariant};
|
||||
pub use crate::libc::{Libc, LibcDetectionError, LibcVersion};
|
||||
pub use crate::os::Os;
|
||||
|
||||
mod arch;
|
||||
mod cpuinfo;
|
||||
mod libc;
|
||||
mod os;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error("Unknown operating system: {0}")]
|
||||
UnknownOs(String),
|
||||
#[error("Unknown architecture: {0}")]
|
||||
UnknownArch(String),
|
||||
#[error("Unknown libc environment: {0}")]
|
||||
UnknownLibc(String),
|
||||
#[error("Unsupported variant `{0}` for architecture `{1}`")]
|
||||
UnsupportedVariant(String, String),
|
||||
#[error(transparent)]
|
||||
LibcDetectionError(#[from] crate::libc::LibcDetectionError),
|
||||
}
|
||||
|
|
@ -3,18 +3,22 @@
|
|||
//! Taken from `glibc_version` (<https://github.com/delta-incubator/glibc-version-rs>),
|
||||
//! which used the Apache 2.0 license (but not the MIT license)
|
||||
|
||||
use crate::cpuinfo::detect_hardware_floating_point_support;
|
||||
use fs_err as fs;
|
||||
use goblin::elf::Elf;
|
||||
use regex::Regex;
|
||||
use std::fmt::Display;
|
||||
use std::io;
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::process::{Command, Stdio};
|
||||
use std::str::FromStr;
|
||||
use std::sync::LazyLock;
|
||||
use thiserror::Error;
|
||||
use std::{env, fmt};
|
||||
use tracing::trace;
|
||||
use uv_fs::Simplified;
|
||||
use uv_static::EnvVars;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
#[derive(Debug, thiserror::Error)]
|
||||
pub enum LibcDetectionError {
|
||||
#[error(
|
||||
"Could not detect either glibc version nor musl libc version, at least one of which is required"
|
||||
|
|
@ -45,11 +49,89 @@ pub enum LibcDetectionError {
|
|||
|
||||
/// We support glibc (manylinux) and musl (musllinux) on linux.
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub(crate) enum LibcVersion {
|
||||
pub enum LibcVersion {
|
||||
Manylinux { major: u32, minor: u32 },
|
||||
Musllinux { major: u32, minor: u32 },
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub enum Libc {
|
||||
Some(target_lexicon::Environment),
|
||||
None,
|
||||
}
|
||||
|
||||
impl Libc {
|
||||
pub fn from_env() -> Result<Self, crate::Error> {
|
||||
match env::consts::OS {
|
||||
"linux" => {
|
||||
if let Ok(libc) = env::var(EnvVars::UV_LIBC) {
|
||||
if !libc.is_empty() {
|
||||
return Self::from_str(&libc);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self::Some(match detect_linux_libc()? {
|
||||
LibcVersion::Manylinux { .. } => match env::consts::ARCH {
|
||||
// Checks if the CPU supports hardware floating-point operations.
|
||||
// Depending on the result, it selects either the `gnueabihf` (hard-float) or `gnueabi` (soft-float) environment.
|
||||
// download-metadata.json only includes armv7.
|
||||
"arm" | "armv5te" | "armv7" => {
|
||||
match detect_hardware_floating_point_support() {
|
||||
Ok(true) => target_lexicon::Environment::Gnueabihf,
|
||||
Ok(false) => target_lexicon::Environment::Gnueabi,
|
||||
Err(_) => target_lexicon::Environment::Gnu,
|
||||
}
|
||||
}
|
||||
_ => target_lexicon::Environment::Gnu,
|
||||
},
|
||||
LibcVersion::Musllinux { .. } => target_lexicon::Environment::Musl,
|
||||
}))
|
||||
}
|
||||
"windows" | "macos" => Ok(Self::None),
|
||||
// Use `None` on platforms without explicit support.
|
||||
_ => Ok(Self::None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_musl(&self) -> bool {
|
||||
matches!(self, Self::Some(target_lexicon::Environment::Musl))
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Libc {
|
||||
type Err = crate::Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"gnu" => Ok(Self::Some(target_lexicon::Environment::Gnu)),
|
||||
"gnueabi" => Ok(Self::Some(target_lexicon::Environment::Gnueabi)),
|
||||
"gnueabihf" => Ok(Self::Some(target_lexicon::Environment::Gnueabihf)),
|
||||
"musl" => Ok(Self::Some(target_lexicon::Environment::Musl)),
|
||||
"none" => Ok(Self::None),
|
||||
_ => Err(crate::Error::UnknownLibc(s.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Libc {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Some(env) => write!(f, "{env}"),
|
||||
Self::None => write!(f, "none"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Os> for Libc {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Os::Manylinux { .. } => Libc::Some(target_lexicon::Environment::Gnu),
|
||||
uv_platform_tags::Os::Musllinux { .. } => Libc::Some(target_lexicon::Environment::Musl),
|
||||
_ => Libc::None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Determine whether we're running glibc or musl and in which version, given we are on linux.
|
||||
///
|
||||
/// Normally, we determine this from the python interpreter, which is more accurate, but when
|
||||
|
|
@ -0,0 +1,88 @@
|
|||
use crate::Error;
|
||||
use std::fmt;
|
||||
use std::fmt::Display;
|
||||
use std::ops::Deref;
|
||||
use std::str::FromStr;
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Os(pub(crate) target_lexicon::OperatingSystem);
|
||||
|
||||
impl Os {
|
||||
pub fn new(os: target_lexicon::OperatingSystem) -> Self {
|
||||
Self(os)
|
||||
}
|
||||
|
||||
pub fn from_env() -> Self {
|
||||
Self(target_lexicon::HOST.operating_system)
|
||||
}
|
||||
|
||||
pub fn is_windows(&self) -> bool {
|
||||
matches!(self.0, target_lexicon::OperatingSystem::Windows)
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Os {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match &**self {
|
||||
target_lexicon::OperatingSystem::Darwin(_) => write!(f, "macos"),
|
||||
inner => write!(f, "{inner}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Os {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let inner = match s {
|
||||
"macos" => target_lexicon::OperatingSystem::Darwin(None),
|
||||
_ => target_lexicon::OperatingSystem::from_str(s)
|
||||
.map_err(|()| Error::UnknownOs(s.to_string()))?,
|
||||
};
|
||||
if matches!(inner, target_lexicon::OperatingSystem::Unknown) {
|
||||
return Err(Error::UnknownOs(s.to_string()));
|
||||
}
|
||||
Ok(Self(inner))
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Os {
|
||||
type Target = target_lexicon::OperatingSystem;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Os> for Os {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Os::Dragonfly { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Dragonfly)
|
||||
}
|
||||
uv_platform_tags::Os::FreeBsd { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Freebsd)
|
||||
}
|
||||
uv_platform_tags::Os::Haiku { .. } => Os::new(target_lexicon::OperatingSystem::Haiku),
|
||||
uv_platform_tags::Os::Illumos { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Illumos)
|
||||
}
|
||||
uv_platform_tags::Os::Macos { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Darwin(None))
|
||||
}
|
||||
uv_platform_tags::Os::Manylinux { .. }
|
||||
| uv_platform_tags::Os::Musllinux { .. }
|
||||
| uv_platform_tags::Os::Android { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Linux)
|
||||
}
|
||||
uv_platform_tags::Os::NetBsd { .. } => Os::new(target_lexicon::OperatingSystem::Netbsd),
|
||||
uv_platform_tags::Os::OpenBsd { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Openbsd)
|
||||
}
|
||||
uv_platform_tags::Os::Windows => Os::new(target_lexicon::OperatingSystem::Windows),
|
||||
uv_platform_tags::Os::Pyodide { .. } => {
|
||||
Os::new(target_lexicon::OperatingSystem::Emscripten)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ uv-fs = { workspace = true }
|
|||
uv-install-wheel = { workspace = true }
|
||||
uv-pep440 = { workspace = true }
|
||||
uv-pep508 = { workspace = true }
|
||||
uv-platform = { workspace = true }
|
||||
uv-platform-tags = { workspace = true }
|
||||
uv-pypi-types = { workspace = true }
|
||||
uv-redacted = { workspace = true }
|
||||
|
|
@ -42,7 +43,6 @@ configparser = { workspace = true }
|
|||
dunce = { workspace = true }
|
||||
fs-err = { workspace = true, features = ["tokio"] }
|
||||
futures = { workspace = true }
|
||||
goblin = { workspace = true, default-features = false }
|
||||
indexmap = { workspace = true }
|
||||
itertools = { workspace = true }
|
||||
owo-colors = { workspace = true }
|
||||
|
|
@ -68,9 +68,6 @@ url = { workspace = true }
|
|||
which = { workspace = true }
|
||||
once_cell = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "linux")'.dependencies]
|
||||
procfs = { workspace = true }
|
||||
|
||||
[target.'cfg(target_os = "windows")'.dependencies]
|
||||
windows-registry = { workspace = true }
|
||||
windows-result = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -3066,8 +3066,8 @@ mod tests {
|
|||
discovery::{PythonRequest, VersionRequest},
|
||||
downloads::{ArchRequest, PythonDownloadRequest},
|
||||
implementation::ImplementationName,
|
||||
platform::{Arch, Libc, Os},
|
||||
};
|
||||
use uv_platform::{Arch, Libc, Os};
|
||||
|
||||
use super::{Error, PythonVariant};
|
||||
|
||||
|
|
@ -3154,11 +3154,11 @@ mod tests {
|
|||
PythonVariant::Default
|
||||
)),
|
||||
implementation: Some(ImplementationName::CPython),
|
||||
arch: Some(ArchRequest::Explicit(Arch {
|
||||
family: Architecture::Aarch64(Aarch64Architecture::Aarch64),
|
||||
variant: None
|
||||
})),
|
||||
os: Some(Os(target_lexicon::OperatingSystem::Darwin(None))),
|
||||
arch: Some(ArchRequest::Explicit(Arch::new(
|
||||
Architecture::Aarch64(Aarch64Architecture::Aarch64),
|
||||
None
|
||||
))),
|
||||
os: Some(Os::new(target_lexicon::OperatingSystem::Darwin(None))),
|
||||
libc: Some(Libc::None),
|
||||
prereleases: None
|
||||
})
|
||||
|
|
@ -3189,10 +3189,10 @@ mod tests {
|
|||
PythonVariant::Default
|
||||
)),
|
||||
implementation: None,
|
||||
arch: Some(ArchRequest::Explicit(Arch {
|
||||
family: Architecture::Aarch64(Aarch64Architecture::Aarch64),
|
||||
variant: None
|
||||
})),
|
||||
arch: Some(ArchRequest::Explicit(Arch::new(
|
||||
Architecture::Aarch64(Aarch64Architecture::Aarch64),
|
||||
None
|
||||
))),
|
||||
os: None,
|
||||
libc: None,
|
||||
prereleases: None
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ use uv_client::{BaseClient, WrappedReqwestError, is_extended_transient_error};
|
|||
use uv_distribution_filename::{ExtensionError, SourceDistExtension};
|
||||
use uv_extract::hash::Hasher;
|
||||
use uv_fs::{Simplified, rename_with_retry};
|
||||
use uv_platform::{self as platform, Arch, Libc, Os};
|
||||
use uv_pypi_types::{HashAlgorithm, HashDigest};
|
||||
use uv_redacted::DisplaySafeUrl;
|
||||
use uv_static::EnvVars;
|
||||
|
|
@ -34,9 +35,7 @@ use crate::implementation::{
|
|||
Error as ImplementationError, ImplementationName, LenientImplementationName,
|
||||
};
|
||||
use crate::installation::PythonInstallationKey;
|
||||
use crate::libc::LibcDetectionError;
|
||||
use crate::managed::ManagedPythonInstallation;
|
||||
use crate::platform::{self, Arch, Libc, Os};
|
||||
use crate::{Interpreter, PythonRequest, PythonVersion, VersionRequest};
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
|
@ -98,7 +97,7 @@ pub enum Error {
|
|||
#[error("A mirror was provided via `{0}`, but the URL does not match the expected format: {0}")]
|
||||
Mirror(&'static str, &'static str),
|
||||
#[error("Failed to determine the libc used on the current platform")]
|
||||
LibcDetection(#[from] LibcDetectionError),
|
||||
LibcDetection(#[from] platform::LibcDetectionError),
|
||||
#[error("Remote Python downloads JSON is not yet supported, please use a local path")]
|
||||
RemoteJSONNotSupported,
|
||||
#[error("The JSON of the python downloads is invalid: {0}")]
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ use uv_cache::Cache;
|
|||
use uv_client::BaseClientBuilder;
|
||||
use uv_configuration::Preview;
|
||||
use uv_pep440::{Prerelease, Version};
|
||||
use uv_platform::{Arch, Libc, Os};
|
||||
|
||||
use crate::discovery::{
|
||||
EnvironmentPreference, PythonRequest, find_best_python_installation, find_python_installation,
|
||||
|
|
@ -17,7 +18,6 @@ use crate::discovery::{
|
|||
use crate::downloads::{DownloadResult, ManagedPythonDownload, PythonDownloadRequest, Reporter};
|
||||
use crate::implementation::LenientImplementationName;
|
||||
use crate::managed::{ManagedPythonInstallation, ManagedPythonInstallations};
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
use crate::{
|
||||
Error, ImplementationName, Interpreter, PythonDownloads, PythonPreference, PythonSource,
|
||||
PythonVariant, PythonVersion, downloads,
|
||||
|
|
|
|||
|
|
@ -21,13 +21,13 @@ use uv_fs::{LockedFile, PythonExt, Simplified, write_atomic_sync};
|
|||
use uv_install_wheel::Layout;
|
||||
use uv_pep440::Version;
|
||||
use uv_pep508::{MarkerEnvironment, StringVersion};
|
||||
use uv_platform::{Arch, Libc, Os};
|
||||
use uv_platform_tags::Platform;
|
||||
use uv_platform_tags::{Tags, TagsError};
|
||||
use uv_pypi_types::{ResolverMarkerEnvironment, Scheme};
|
||||
|
||||
use crate::implementation::LenientImplementationName;
|
||||
use crate::managed::ManagedPythonInstallations;
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
use crate::pointer_size::PointerSize;
|
||||
use crate::{
|
||||
Prefix, PythonInstallationKey, PythonVariant, PythonVersion, Target, VersionRequest,
|
||||
|
|
|
|||
|
|
@ -29,19 +29,16 @@ pub use crate::version_files::{
|
|||
};
|
||||
pub use crate::virtualenv::{Error as VirtualEnvError, PyVenvConfiguration, VirtualEnvironment};
|
||||
|
||||
mod cpuinfo;
|
||||
mod discovery;
|
||||
pub mod downloads;
|
||||
mod environment;
|
||||
mod implementation;
|
||||
mod installation;
|
||||
mod interpreter;
|
||||
mod libc;
|
||||
pub mod macos_dylib;
|
||||
pub mod managed;
|
||||
#[cfg(windows)]
|
||||
mod microsoft_store;
|
||||
pub mod platform;
|
||||
mod pointer_size;
|
||||
mod prefix;
|
||||
mod python_version;
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ use uv_configuration::{Preview, PreviewFeatures};
|
|||
use windows_sys::Win32::Storage::FileSystem::FILE_ATTRIBUTE_REPARSE_POINT;
|
||||
|
||||
use uv_fs::{LockedFile, Simplified, replace_symlink, symlink_or_copy_file};
|
||||
use uv_platform::Error as PlatformError;
|
||||
use uv_platform::{Arch, Libc, LibcDetectionError, Os};
|
||||
use uv_state::{StateBucket, StateStore};
|
||||
use uv_static::EnvVars;
|
||||
use uv_trampoline_builder::{Launcher, windows_python_launcher};
|
||||
|
|
@ -26,9 +28,6 @@ use crate::implementation::{
|
|||
Error as ImplementationError, ImplementationName, LenientImplementationName,
|
||||
};
|
||||
use crate::installation::{self, PythonInstallationKey};
|
||||
use crate::libc::LibcDetectionError;
|
||||
use crate::platform::Error as PlatformError;
|
||||
use crate::platform::{Arch, Libc, Os};
|
||||
use crate::python_version::PythonVersion;
|
||||
use crate::{
|
||||
PythonInstallationMinorVersionKey, PythonRequest, PythonVariant, macos_dylib, sysconfig,
|
||||
|
|
@ -271,7 +270,7 @@ impl ManagedPythonInstallations {
|
|||
&& (arch.supports(installation.key.arch)
|
||||
// TODO(zanieb): Allow inequal variants, as `Arch::supports` does not
|
||||
// implement this yet. See https://github.com/astral-sh/uv/pull/9788
|
||||
|| arch.family == installation.key.arch.family)
|
||||
|| arch.family() == installation.key.arch.family())
|
||||
&& installation.key.libc == libc
|
||||
});
|
||||
|
||||
|
|
@ -545,7 +544,7 @@ impl ManagedPythonInstallation {
|
|||
/// standard `EXTERNALLY-MANAGED` file.
|
||||
pub fn ensure_externally_managed(&self) -> Result<(), Error> {
|
||||
// Construct the path to the `stdlib` directory.
|
||||
let stdlib = if matches!(self.key.os, Os(target_lexicon::OperatingSystem::Windows)) {
|
||||
let stdlib = if self.key.os.is_windows() {
|
||||
self.python_dir().join("Lib")
|
||||
} else {
|
||||
let lib_suffix = self.key.variant.suffix();
|
||||
|
|
|
|||
|
|
@ -1,427 +0,0 @@
|
|||
use crate::cpuinfo::detect_hardware_floating_point_support;
|
||||
use crate::libc::{LibcDetectionError, LibcVersion, detect_linux_libc};
|
||||
use std::fmt::Display;
|
||||
use std::ops::Deref;
|
||||
use std::{fmt, str::FromStr};
|
||||
use thiserror::Error;
|
||||
|
||||
use uv_static::EnvVars;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum Error {
|
||||
#[error("Unknown operating system: {0}")]
|
||||
UnknownOs(String),
|
||||
#[error("Unknown architecture: {0}")]
|
||||
UnknownArch(String),
|
||||
#[error("Unknown libc environment: {0}")]
|
||||
UnknownLibc(String),
|
||||
#[error("Unsupported variant `{0}` for architecture `{1}`")]
|
||||
UnsupportedVariant(String, String),
|
||||
#[error(transparent)]
|
||||
LibcDetectionError(#[from] LibcDetectionError),
|
||||
}
|
||||
|
||||
/// Architecture variants, e.g., with support for different instruction sets
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash, Ord, PartialOrd)]
|
||||
pub enum ArchVariant {
|
||||
/// Targets 64-bit Intel/AMD CPUs newer than Nehalem (2008).
|
||||
/// Includes SSE3, SSE4 and other post-2003 CPU instructions.
|
||||
V2,
|
||||
/// Targets 64-bit Intel/AMD CPUs newer than Haswell (2013) and Excavator (2015).
|
||||
/// Includes AVX, AVX2, MOVBE and other newer CPU instructions.
|
||||
V3,
|
||||
/// Targets 64-bit Intel/AMD CPUs with AVX-512 instructions (post-2017 Intel CPUs).
|
||||
/// Many post-2017 Intel CPUs do not support AVX-512.
|
||||
V4,
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Arch {
|
||||
pub(crate) family: target_lexicon::Architecture,
|
||||
pub(crate) variant: Option<ArchVariant>,
|
||||
}
|
||||
|
||||
impl Ord for Arch {
|
||||
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
|
||||
if self.family == other.family {
|
||||
return self.variant.cmp(&other.variant);
|
||||
}
|
||||
|
||||
// For the time being, manually make aarch64 windows disfavored
|
||||
// on its own host platform, because most packages don't have wheels for
|
||||
// aarch64 windows, making emulation more useful than native execution!
|
||||
//
|
||||
// The reason we do this in "sorting" and not "supports" is so that we don't
|
||||
// *refuse* to use an aarch64 windows pythons if they happen to be installed
|
||||
// and nothing else is available.
|
||||
//
|
||||
// Similarly if someone manually requests an aarch64 windows install, we
|
||||
// should respect that request (this is the way users should "override"
|
||||
// this behaviour).
|
||||
let preferred = if cfg!(all(windows, target_arch = "aarch64")) {
|
||||
Arch {
|
||||
family: target_lexicon::Architecture::X86_64,
|
||||
variant: None,
|
||||
}
|
||||
} else {
|
||||
// Prefer native architectures
|
||||
Arch::from_env()
|
||||
};
|
||||
|
||||
match (
|
||||
self.family == preferred.family,
|
||||
other.family == preferred.family,
|
||||
) {
|
||||
(true, true) => unreachable!(),
|
||||
(true, false) => std::cmp::Ordering::Less,
|
||||
(false, true) => std::cmp::Ordering::Greater,
|
||||
(false, false) => {
|
||||
// Both non-preferred, fallback to lexicographic order
|
||||
self.family.to_string().cmp(&other.family.to_string())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl PartialOrd for Arch {
|
||||
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
|
||||
Some(self.cmp(other))
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub struct Os(pub(crate) target_lexicon::OperatingSystem);
|
||||
|
||||
#[derive(Debug, Eq, PartialEq, Clone, Copy, Hash)]
|
||||
pub enum Libc {
|
||||
Some(target_lexicon::Environment),
|
||||
None,
|
||||
}
|
||||
|
||||
impl Libc {
|
||||
pub(crate) fn from_env() -> Result<Self, Error> {
|
||||
match std::env::consts::OS {
|
||||
"linux" => {
|
||||
if let Ok(libc) = std::env::var(EnvVars::UV_LIBC) {
|
||||
if !libc.is_empty() {
|
||||
return Self::from_str(&libc);
|
||||
}
|
||||
}
|
||||
|
||||
Ok(Self::Some(match detect_linux_libc()? {
|
||||
LibcVersion::Manylinux { .. } => match std::env::consts::ARCH {
|
||||
// Checks if the CPU supports hardware floating-point operations.
|
||||
// Depending on the result, it selects either the `gnueabihf` (hard-float) or `gnueabi` (soft-float) environment.
|
||||
// download-metadata.json only includes armv7.
|
||||
"arm" | "armv5te" | "armv7" => {
|
||||
match detect_hardware_floating_point_support() {
|
||||
Ok(true) => target_lexicon::Environment::Gnueabihf,
|
||||
Ok(false) => target_lexicon::Environment::Gnueabi,
|
||||
Err(_) => target_lexicon::Environment::Gnu,
|
||||
}
|
||||
}
|
||||
_ => target_lexicon::Environment::Gnu,
|
||||
},
|
||||
LibcVersion::Musllinux { .. } => target_lexicon::Environment::Musl,
|
||||
}))
|
||||
}
|
||||
"windows" | "macos" => Ok(Self::None),
|
||||
// Use `None` on platforms without explicit support.
|
||||
_ => Ok(Self::None),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_musl(&self) -> bool {
|
||||
matches!(self, Self::Some(target_lexicon::Environment::Musl))
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Libc {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"gnu" => Ok(Self::Some(target_lexicon::Environment::Gnu)),
|
||||
"gnueabi" => Ok(Self::Some(target_lexicon::Environment::Gnueabi)),
|
||||
"gnueabihf" => Ok(Self::Some(target_lexicon::Environment::Gnueabihf)),
|
||||
"musl" => Ok(Self::Some(target_lexicon::Environment::Musl)),
|
||||
"none" => Ok(Self::None),
|
||||
_ => Err(Error::UnknownLibc(s.to_string())),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Os {
|
||||
pub fn from_env() -> Self {
|
||||
Self(target_lexicon::HOST.operating_system)
|
||||
}
|
||||
}
|
||||
|
||||
impl Arch {
|
||||
pub fn from_env() -> Self {
|
||||
Self {
|
||||
family: target_lexicon::HOST.architecture,
|
||||
variant: None,
|
||||
}
|
||||
}
|
||||
|
||||
/// Does the current architecture support running the other?
|
||||
///
|
||||
/// When the architecture is equal, this is always true. Otherwise, this is true if the
|
||||
/// architecture is transparently emulated or is a microarchitecture with worse performance
|
||||
/// characteristics.
|
||||
pub(crate) fn supports(self, other: Self) -> bool {
|
||||
if self == other {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO: Implement `variant` support checks
|
||||
|
||||
// Windows ARM64 runs emulated x86_64 binaries transparently
|
||||
// Similarly, macOS aarch64 runs emulated x86_64 binaries transparently if you have Rosetta
|
||||
// installed. We don't try to be clever and check if that's the case here, we just assume
|
||||
// that if x86_64 distributions are available, they're usable.
|
||||
if (cfg!(windows) || cfg!(target_os = "macos"))
|
||||
&& matches!(self.family, target_lexicon::Architecture::Aarch64(_))
|
||||
{
|
||||
return other.family == target_lexicon::Architecture::X86_64;
|
||||
}
|
||||
|
||||
false
|
||||
}
|
||||
|
||||
pub fn family(&self) -> target_lexicon::Architecture {
|
||||
self.family
|
||||
}
|
||||
|
||||
pub fn is_arm(&self) -> bool {
|
||||
matches!(self.family, target_lexicon::Architecture::Arm(_))
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Libc {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::Some(env) => write!(f, "{env}"),
|
||||
Self::None => write!(f, "none"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Os {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match &**self {
|
||||
target_lexicon::OperatingSystem::Darwin(_) => write!(f, "macos"),
|
||||
inner => write!(f, "{inner}"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for Arch {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self.family {
|
||||
target_lexicon::Architecture::X86_32(target_lexicon::X86_32Architecture::I686) => {
|
||||
write!(f, "x86")?;
|
||||
}
|
||||
inner => write!(f, "{inner}")?,
|
||||
}
|
||||
if let Some(variant) = self.variant {
|
||||
write!(f, "_{variant}")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Os {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let inner = match s {
|
||||
"macos" => target_lexicon::OperatingSystem::Darwin(None),
|
||||
_ => target_lexicon::OperatingSystem::from_str(s)
|
||||
.map_err(|()| Error::UnknownOs(s.to_string()))?,
|
||||
};
|
||||
if matches!(inner, target_lexicon::OperatingSystem::Unknown) {
|
||||
return Err(Error::UnknownOs(s.to_string()));
|
||||
}
|
||||
Ok(Self(inner))
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for Arch {
|
||||
type Err = Error;
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
fn parse_family(s: &str) -> Result<target_lexicon::Architecture, Error> {
|
||||
let inner = match s {
|
||||
// Allow users to specify "x86" as a shorthand for the "i686" variant, they should not need
|
||||
// to specify the exact architecture and this variant is what we have downloads for.
|
||||
"x86" => {
|
||||
target_lexicon::Architecture::X86_32(target_lexicon::X86_32Architecture::I686)
|
||||
}
|
||||
_ => target_lexicon::Architecture::from_str(s)
|
||||
.map_err(|()| Error::UnknownArch(s.to_string()))?,
|
||||
};
|
||||
if matches!(inner, target_lexicon::Architecture::Unknown) {
|
||||
return Err(Error::UnknownArch(s.to_string()));
|
||||
}
|
||||
Ok(inner)
|
||||
}
|
||||
|
||||
// First check for a variant
|
||||
if let Some((Ok(family), Ok(variant))) = s
|
||||
.rsplit_once('_')
|
||||
.map(|(family, variant)| (parse_family(family), ArchVariant::from_str(variant)))
|
||||
{
|
||||
// We only support variants for `x86_64` right now
|
||||
if !matches!(family, target_lexicon::Architecture::X86_64) {
|
||||
return Err(Error::UnsupportedVariant(
|
||||
variant.to_string(),
|
||||
family.to_string(),
|
||||
));
|
||||
}
|
||||
return Ok(Self {
|
||||
family,
|
||||
variant: Some(variant),
|
||||
});
|
||||
}
|
||||
|
||||
let family = parse_family(s)?;
|
||||
|
||||
Ok(Self {
|
||||
family,
|
||||
variant: None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for ArchVariant {
|
||||
type Err = ();
|
||||
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
match s {
|
||||
"v2" => Ok(Self::V2),
|
||||
"v3" => Ok(Self::V3),
|
||||
"v4" => Ok(Self::V4),
|
||||
_ => Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for ArchVariant {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
match self {
|
||||
Self::V2 => write!(f, "v2"),
|
||||
Self::V3 => write!(f, "v3"),
|
||||
Self::V4 => write!(f, "v4"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for Os {
|
||||
type Target = target_lexicon::OperatingSystem;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Arch> for Arch {
|
||||
fn from(value: &uv_platform_tags::Arch) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Arch::Aarch64 => Self {
|
||||
family: target_lexicon::Architecture::Aarch64(
|
||||
target_lexicon::Aarch64Architecture::Aarch64,
|
||||
),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Armv5TEL => Self {
|
||||
family: target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv5te),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Armv6L => Self {
|
||||
family: target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv6),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Armv7L => Self {
|
||||
family: target_lexicon::Architecture::Arm(target_lexicon::ArmArchitecture::Armv7),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::S390X => Self {
|
||||
family: target_lexicon::Architecture::S390x,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Powerpc => Self {
|
||||
family: target_lexicon::Architecture::Powerpc,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Powerpc64 => Self {
|
||||
family: target_lexicon::Architecture::Powerpc64,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Powerpc64Le => Self {
|
||||
family: target_lexicon::Architecture::Powerpc64le,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::X86 => Self {
|
||||
family: target_lexicon::Architecture::X86_32(
|
||||
target_lexicon::X86_32Architecture::I686,
|
||||
),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::X86_64 => Self {
|
||||
family: target_lexicon::Architecture::X86_64,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::LoongArch64 => Self {
|
||||
family: target_lexicon::Architecture::LoongArch64,
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Riscv64 => Self {
|
||||
family: target_lexicon::Architecture::Riscv64(
|
||||
target_lexicon::Riscv64Architecture::Riscv64,
|
||||
),
|
||||
variant: None,
|
||||
},
|
||||
uv_platform_tags::Arch::Wasm32 => Self {
|
||||
family: target_lexicon::Architecture::Wasm32,
|
||||
variant: None,
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Os> for Libc {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Os::Manylinux { .. } => Self::Some(target_lexicon::Environment::Gnu),
|
||||
uv_platform_tags::Os::Musllinux { .. } => Self::Some(target_lexicon::Environment::Musl),
|
||||
_ => Self::None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<&uv_platform_tags::Os> for Os {
|
||||
fn from(value: &uv_platform_tags::Os) -> Self {
|
||||
match value {
|
||||
uv_platform_tags::Os::Dragonfly { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Dragonfly)
|
||||
}
|
||||
uv_platform_tags::Os::FreeBsd { .. } => Self(target_lexicon::OperatingSystem::Freebsd),
|
||||
uv_platform_tags::Os::Haiku { .. } => Self(target_lexicon::OperatingSystem::Haiku),
|
||||
uv_platform_tags::Os::Illumos { .. } => Self(target_lexicon::OperatingSystem::Illumos),
|
||||
uv_platform_tags::Os::Macos { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Darwin(None))
|
||||
}
|
||||
uv_platform_tags::Os::Manylinux { .. }
|
||||
| uv_platform_tags::Os::Musllinux { .. }
|
||||
| uv_platform_tags::Os::Android { .. } => Self(target_lexicon::OperatingSystem::Linux),
|
||||
uv_platform_tags::Os::NetBsd { .. } => Self(target_lexicon::OperatingSystem::Netbsd),
|
||||
uv_platform_tags::Os::OpenBsd { .. } => Self(target_lexicon::OperatingSystem::Openbsd),
|
||||
uv_platform_tags::Os::Windows => Self(target_lexicon::OperatingSystem::Windows),
|
||||
uv_platform_tags::Os::Pyodide { .. } => {
|
||||
Self(target_lexicon::OperatingSystem::Emscripten)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,7 +1,6 @@
|
|||
//! PEP 514 interactions with the Windows registry.
|
||||
|
||||
use crate::managed::ManagedPythonInstallation;
|
||||
use crate::platform::Arch;
|
||||
use crate::{COMPANY_DISPLAY_NAME, COMPANY_KEY, PythonInstallationKey, PythonVersion};
|
||||
use anyhow::anyhow;
|
||||
use std::cmp::Ordering;
|
||||
|
|
@ -11,6 +10,7 @@ use std::str::FromStr;
|
|||
use target_lexicon::PointerWidth;
|
||||
use thiserror::Error;
|
||||
use tracing::debug;
|
||||
use uv_platform::Arch;
|
||||
use uv_warnings::{warn_user, warn_user_once};
|
||||
use windows_registry::{CURRENT_USER, HSTRING, Key, LOCAL_MACHINE, Value};
|
||||
use windows_result::HRESULT;
|
||||
|
|
|
|||
|
|
@ -1,30 +1,35 @@
|
|||
#[cfg(feature = "schemars")]
|
||||
use std::borrow::Cow;
|
||||
use std::str::FromStr;
|
||||
use std::{
|
||||
ops::{Deref, DerefMut},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use jiff::{Timestamp, ToSpan, tz::TimeZone};
|
||||
use rustc_hash::FxHashMap;
|
||||
use uv_normalize::PackageName;
|
||||
|
||||
/// A timestamp that excludes files newer than it.
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq, serde::Deserialize, serde::Serialize)]
|
||||
pub struct ExcludeNewer(Timestamp);
|
||||
pub struct ExcludeNewerTimestamp(Timestamp);
|
||||
|
||||
impl ExcludeNewer {
|
||||
impl ExcludeNewerTimestamp {
|
||||
/// Returns the timestamp in milliseconds.
|
||||
pub fn timestamp_millis(&self) -> i64 {
|
||||
self.0.as_millisecond()
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Timestamp> for ExcludeNewer {
|
||||
impl From<Timestamp> for ExcludeNewerTimestamp {
|
||||
fn from(timestamp: Timestamp) -> Self {
|
||||
Self(timestamp)
|
||||
}
|
||||
}
|
||||
|
||||
impl FromStr for ExcludeNewer {
|
||||
impl FromStr for ExcludeNewerTimestamp {
|
||||
type Err = String;
|
||||
|
||||
/// Parse an [`ExcludeNewer`] from a string.
|
||||
/// Parse an [`ExcludeNewerTimestamp`] from a string.
|
||||
///
|
||||
/// Accepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same
|
||||
/// format (e.g., `2006-12-02`).
|
||||
|
|
@ -61,16 +66,174 @@ impl FromStr for ExcludeNewer {
|
|||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for ExcludeNewer {
|
||||
impl std::fmt::Display for ExcludeNewerTimestamp {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
self.0.fmt(f)
|
||||
}
|
||||
}
|
||||
|
||||
/// A package-specific exclude-newer entry.
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct ExcludeNewerPackageEntry {
|
||||
pub package: PackageName,
|
||||
pub timestamp: ExcludeNewerTimestamp,
|
||||
}
|
||||
|
||||
impl FromStr for ExcludeNewerPackageEntry {
|
||||
type Err = String;
|
||||
|
||||
/// Parses a [`ExcludeNewerPackageEntry`] from a string in the format `PACKAGE=DATE`.
|
||||
fn from_str(s: &str) -> Result<Self, Self::Err> {
|
||||
let Some((package, date)) = s.split_once('=') else {
|
||||
return Err(format!(
|
||||
"Invalid `exclude-newer-package` value `{s}`: expected format `PACKAGE=DATE`"
|
||||
));
|
||||
};
|
||||
|
||||
let package = PackageName::from_str(package).map_err(|err| {
|
||||
format!("Invalid `exclude-newer-package` package name `{package}`: {err}")
|
||||
})?;
|
||||
let timestamp = ExcludeNewerTimestamp::from_str(date)
|
||||
.map_err(|err| format!("Invalid `exclude-newer-package` timestamp `{date}`: {err}"))?;
|
||||
|
||||
Ok(Self { package, timestamp })
|
||||
}
|
||||
}
|
||||
|
||||
impl From<(PackageName, ExcludeNewerTimestamp)> for ExcludeNewerPackageEntry {
|
||||
fn from((package, timestamp): (PackageName, ExcludeNewerTimestamp)) -> Self {
|
||||
Self { package, timestamp }
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Default, serde::Serialize, serde::Deserialize)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct ExcludeNewerPackage(FxHashMap<PackageName, ExcludeNewerTimestamp>);
|
||||
|
||||
impl Deref for ExcludeNewerPackage {
|
||||
type Target = FxHashMap<PackageName, ExcludeNewerTimestamp>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl DerefMut for ExcludeNewerPackage {
|
||||
fn deref_mut(&mut self) -> &mut Self::Target {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl FromIterator<ExcludeNewerPackageEntry> for ExcludeNewerPackage {
|
||||
fn from_iter<T: IntoIterator<Item = ExcludeNewerPackageEntry>>(iter: T) -> Self {
|
||||
Self(
|
||||
iter.into_iter()
|
||||
.map(|entry| (entry.package, entry.timestamp))
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoIterator for ExcludeNewerPackage {
|
||||
type Item = (PackageName, ExcludeNewerTimestamp);
|
||||
type IntoIter = std::collections::hash_map::IntoIter<PackageName, ExcludeNewerTimestamp>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.0.into_iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> IntoIterator for &'a ExcludeNewerPackage {
|
||||
type Item = (&'a PackageName, &'a ExcludeNewerTimestamp);
|
||||
type IntoIter = std::collections::hash_map::Iter<'a, PackageName, ExcludeNewerTimestamp>;
|
||||
|
||||
fn into_iter(self) -> Self::IntoIter {
|
||||
self.0.iter()
|
||||
}
|
||||
}
|
||||
|
||||
impl ExcludeNewerPackage {
|
||||
/// Convert to the inner `HashMap`.
|
||||
pub fn into_inner(self) -> FxHashMap<PackageName, ExcludeNewerTimestamp> {
|
||||
self.0
|
||||
}
|
||||
}
|
||||
|
||||
/// A setting that excludes files newer than a timestamp, at a global level or per-package.
|
||||
#[derive(Debug, Clone, PartialEq, Eq, serde::Serialize, serde::Deserialize, Default)]
|
||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||
pub struct ExcludeNewer {
|
||||
/// Global timestamp that applies to all packages if no package-specific timestamp is set.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub global: Option<ExcludeNewerTimestamp>,
|
||||
/// Per-package timestamps that override the global timestamp.
|
||||
#[serde(default, skip_serializing_if = "FxHashMap::is_empty")]
|
||||
pub package: ExcludeNewerPackage,
|
||||
}
|
||||
|
||||
impl ExcludeNewer {
|
||||
/// Create a new exclude newer configuration with just a global timestamp.
|
||||
pub fn global(global: ExcludeNewerTimestamp) -> Self {
|
||||
Self {
|
||||
global: Some(global),
|
||||
package: ExcludeNewerPackage::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a new exclude newer configuration.
|
||||
pub fn new(global: Option<ExcludeNewerTimestamp>, package: ExcludeNewerPackage) -> Self {
|
||||
Self { global, package }
|
||||
}
|
||||
|
||||
/// Create from CLI arguments.
|
||||
pub fn from_args(
|
||||
global: Option<ExcludeNewerTimestamp>,
|
||||
package: Vec<ExcludeNewerPackageEntry>,
|
||||
) -> Self {
|
||||
let package: ExcludeNewerPackage = package.into_iter().collect();
|
||||
|
||||
Self { global, package }
|
||||
}
|
||||
|
||||
/// Returns the timestamp for a specific package, falling back to the global timestamp if set.
|
||||
pub fn exclude_newer_package(
|
||||
&self,
|
||||
package_name: &PackageName,
|
||||
) -> Option<ExcludeNewerTimestamp> {
|
||||
self.package.get(package_name).copied().or(self.global)
|
||||
}
|
||||
|
||||
/// Returns true if this has any configuration (global or per-package).
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.global.is_none() && self.package.is_empty()
|
||||
}
|
||||
}
|
||||
|
||||
impl std::fmt::Display for ExcludeNewer {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
if let Some(global) = self.global {
|
||||
write!(f, "global: {global}")?;
|
||||
if !self.package.is_empty() {
|
||||
write!(f, ", ")?;
|
||||
}
|
||||
}
|
||||
let mut first = true;
|
||||
for (name, timestamp) in &self.package {
|
||||
if !first {
|
||||
write!(f, ", ")?;
|
||||
}
|
||||
write!(f, "{name}: {timestamp}")?;
|
||||
first = false;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "schemars")]
|
||||
impl schemars::JsonSchema for ExcludeNewer {
|
||||
impl schemars::JsonSchema for ExcludeNewerTimestamp {
|
||||
fn schema_name() -> Cow<'static, str> {
|
||||
Cow::Borrowed("ExcludeNewer")
|
||||
Cow::Borrowed("ExcludeNewerTimestamp")
|
||||
}
|
||||
|
||||
fn json_schema(_generator: &mut schemars::generate::SchemaGenerator) -> schemars::Schema {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
pub use dependency_mode::DependencyMode;
|
||||
pub use error::{ErrorTree, NoSolutionError, NoSolutionHeader, ResolveError, SentinelRange};
|
||||
pub use exclude_newer::ExcludeNewer;
|
||||
pub use exclude_newer::{
|
||||
ExcludeNewer, ExcludeNewerPackage, ExcludeNewerPackageEntry, ExcludeNewerTimestamp,
|
||||
};
|
||||
pub use exclusions::Exclusions;
|
||||
pub use flat_index::{FlatDistributions, FlatIndex};
|
||||
pub use fork_strategy::ForkStrategy;
|
||||
|
|
|
|||
|
|
@ -60,7 +60,8 @@ pub use crate::lock::tree::TreeDisplay;
|
|||
use crate::resolution::{AnnotatedDist, ResolutionGraphNode};
|
||||
use crate::universal_marker::{ConflictMarker, UniversalMarker};
|
||||
use crate::{
|
||||
ExcludeNewer, InMemoryIndex, MetadataResponse, PrereleaseMode, ResolutionMode, ResolverOutput,
|
||||
ExcludeNewer, ExcludeNewerTimestamp, InMemoryIndex, MetadataResponse, PrereleaseMode,
|
||||
ResolutionMode, ResolverOutput,
|
||||
};
|
||||
|
||||
mod export;
|
||||
|
|
@ -72,7 +73,7 @@ mod tree;
|
|||
pub const VERSION: u32 = 1;
|
||||
|
||||
/// The current revision of the lockfile format.
|
||||
const REVISION: u32 = 2;
|
||||
const REVISION: u32 = 3;
|
||||
|
||||
static LINUX_MARKERS: LazyLock<UniversalMarker> = LazyLock::new(|| {
|
||||
let pep508 = MarkerTree::from_str("os_name == 'posix' and sys_platform == 'linux'").unwrap();
|
||||
|
|
@ -278,11 +279,23 @@ impl Lock {
|
|||
}
|
||||
|
||||
let packages = packages.into_values().collect();
|
||||
let (exclude_newer, exclude_newer_package) = {
|
||||
let exclude_newer = &resolution.options.exclude_newer;
|
||||
let global_exclude_newer = exclude_newer.global;
|
||||
let package_exclude_newer = if exclude_newer.package.is_empty() {
|
||||
None
|
||||
} else {
|
||||
Some(exclude_newer.package.clone().into_inner())
|
||||
};
|
||||
(global_exclude_newer, package_exclude_newer)
|
||||
};
|
||||
|
||||
let options = ResolverOptions {
|
||||
resolution_mode: resolution.options.resolution_mode,
|
||||
prerelease_mode: resolution.options.prerelease_mode,
|
||||
fork_strategy: resolution.options.fork_strategy,
|
||||
exclude_newer: resolution.options.exclude_newer,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
};
|
||||
let lock = Self::new(
|
||||
VERSION,
|
||||
|
|
@ -643,8 +656,8 @@ impl Lock {
|
|||
}
|
||||
|
||||
/// Returns the exclude newer setting used to generate this lock.
|
||||
pub fn exclude_newer(&self) -> Option<ExcludeNewer> {
|
||||
self.options.exclude_newer
|
||||
pub fn exclude_newer(&self) -> ExcludeNewer {
|
||||
self.options.exclude_newer()
|
||||
}
|
||||
|
||||
/// Returns the conflicting groups that were used to generate this lock.
|
||||
|
|
@ -890,8 +903,21 @@ impl Lock {
|
|||
value(self.options.fork_strategy.to_string()),
|
||||
);
|
||||
}
|
||||
if let Some(exclude_newer) = self.options.exclude_newer {
|
||||
options_table.insert("exclude-newer", value(exclude_newer.to_string()));
|
||||
let exclude_newer = &self.options.exclude_newer();
|
||||
if !exclude_newer.is_empty() {
|
||||
// Always serialize global exclude-newer as a string
|
||||
if let Some(global) = exclude_newer.global {
|
||||
options_table.insert("exclude-newer", value(global.to_string()));
|
||||
}
|
||||
|
||||
// Serialize package-specific exclusions as a separate field
|
||||
if !exclude_newer.package.is_empty() {
|
||||
let mut package_table = toml_edit::Table::new();
|
||||
for (name, timestamp) in &exclude_newer.package {
|
||||
package_table.insert(name.as_ref(), value(timestamp.to_string()));
|
||||
}
|
||||
options_table.insert("exclude-newer-package", Item::Table(package_table));
|
||||
}
|
||||
}
|
||||
|
||||
if !options_table.is_empty() {
|
||||
|
|
@ -1870,8 +1896,25 @@ struct ResolverOptions {
|
|||
/// The [`ForkStrategy`] used to generate this lock.
|
||||
#[serde(default)]
|
||||
fork_strategy: ForkStrategy,
|
||||
/// The [`ExcludeNewer`] used to generate this lock.
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
/// The global [`ExcludeNewer`] timestamp.
|
||||
exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
/// Package-specific [`ExcludeNewer`] timestamps.
|
||||
exclude_newer_package: Option<FxHashMap<PackageName, ExcludeNewerTimestamp>>,
|
||||
}
|
||||
|
||||
impl ResolverOptions {
|
||||
/// Get the combined exclude-newer configuration.
|
||||
fn exclude_newer(&self) -> ExcludeNewer {
|
||||
ExcludeNewer::from_args(
|
||||
self.exclude_newer,
|
||||
self.exclude_newer_package
|
||||
.clone()
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(Into::into)
|
||||
.collect(),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Default, serde::Deserialize, PartialEq, Eq)]
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ Ok(
|
|||
prerelease_mode: IfNecessaryOrExplicit,
|
||||
fork_strategy: RequiresPython,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
},
|
||||
packages: [
|
||||
Package {
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pub struct Options {
|
|||
pub prerelease_mode: PrereleaseMode,
|
||||
pub dependency_mode: DependencyMode,
|
||||
pub fork_strategy: ForkStrategy,
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: ExcludeNewer,
|
||||
pub index_strategy: IndexStrategy,
|
||||
pub required_environments: SupportedEnvironments,
|
||||
pub flexibility: Flexibility,
|
||||
|
|
@ -27,7 +27,7 @@ pub struct OptionsBuilder {
|
|||
prerelease_mode: PrereleaseMode,
|
||||
dependency_mode: DependencyMode,
|
||||
fork_strategy: ForkStrategy,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
index_strategy: IndexStrategy,
|
||||
required_environments: SupportedEnvironments,
|
||||
flexibility: Flexibility,
|
||||
|
|
@ -71,7 +71,7 @@ impl OptionsBuilder {
|
|||
|
||||
/// Sets the exclusion date.
|
||||
#[must_use]
|
||||
pub fn exclude_newer(mut self, exclude_newer: Option<ExcludeNewer>) -> Self {
|
||||
pub fn exclude_newer(mut self, exclude_newer: ExcludeNewer) -> Self {
|
||||
self.exclude_newer = exclude_newer;
|
||||
self
|
||||
}
|
||||
|
|
|
|||
|
|
@ -182,7 +182,7 @@ impl<'a, Context: BuildContext, InstalledPackages: InstalledPackagesProvider>
|
|||
python_requirement.target(),
|
||||
AllowedYanks::from_manifest(&manifest, &env, options.dependency_mode),
|
||||
hasher,
|
||||
options.exclude_newer,
|
||||
options.exclude_newer.clone(),
|
||||
build_context.build_options(),
|
||||
build_context.capabilities(),
|
||||
);
|
||||
|
|
@ -366,7 +366,7 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
state.fork_indexes,
|
||||
state.env,
|
||||
self.current_environment.clone(),
|
||||
self.options.exclude_newer,
|
||||
Some(&self.options.exclude_newer),
|
||||
&visited,
|
||||
));
|
||||
}
|
||||
|
|
@ -2537,7 +2537,7 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
fork_indexes: ForkIndexes,
|
||||
env: ResolverEnvironment,
|
||||
current_environment: MarkerEnvironment,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: Option<&ExcludeNewer>,
|
||||
visited: &FxHashSet<PackageName>,
|
||||
) -> ResolveError {
|
||||
err = NoSolutionError::collapse_local_version_segments(NoSolutionError::collapse_proxies(
|
||||
|
|
@ -2596,7 +2596,9 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
|
||||
for (version, dists) in version_map.iter(&Ranges::full()) {
|
||||
// Don't show versions removed by excluded-newer in hints.
|
||||
if let Some(exclude_newer) = exclude_newer {
|
||||
if let Some(exclude_newer) =
|
||||
exclude_newer.and_then(|en| en.exclude_newer_package(name))
|
||||
{
|
||||
let Some(prioritized_dist) = dists.prioritized_dist() else {
|
||||
continue;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ pub struct DefaultResolverProvider<'a, Context: BuildContext> {
|
|||
requires_python: RequiresPython,
|
||||
allowed_yanks: AllowedYanks,
|
||||
hasher: HashStrategy,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
build_options: &'a BuildOptions,
|
||||
capabilities: &'a IndexCapabilities,
|
||||
}
|
||||
|
|
@ -130,7 +130,7 @@ impl<'a, Context: BuildContext> DefaultResolverProvider<'a, Context> {
|
|||
requires_python: &'a RequiresPython,
|
||||
allowed_yanks: AllowedYanks,
|
||||
hasher: &'a HashStrategy,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
build_options: &'a BuildOptions,
|
||||
capabilities: &'a IndexCapabilities,
|
||||
) -> Self {
|
||||
|
|
@ -184,7 +184,7 @@ impl<Context: BuildContext> ResolverProvider for DefaultResolverProvider<'_, Con
|
|||
&self.requires_python,
|
||||
&self.allowed_yanks,
|
||||
&self.hasher,
|
||||
self.exclude_newer.as_ref(),
|
||||
Some(&self.exclude_newer),
|
||||
flat_index
|
||||
.and_then(|flat_index| flat_index.get(package_name))
|
||||
.cloned(),
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ use uv_types::HashStrategy;
|
|||
use uv_warnings::warn_user_once;
|
||||
|
||||
use crate::flat_index::FlatDistributions;
|
||||
use crate::{ExcludeNewer, yanks::AllowedYanks};
|
||||
use crate::{ExcludeNewer, ExcludeNewerTimestamp, yanks::AllowedYanks};
|
||||
|
||||
/// A map from versions to distributions.
|
||||
#[derive(Debug)]
|
||||
|
|
@ -112,7 +112,7 @@ impl VersionMap {
|
|||
allowed_yanks: allowed_yanks.clone(),
|
||||
hasher: hasher.clone(),
|
||||
requires_python: requires_python.clone(),
|
||||
exclude_newer: exclude_newer.copied(),
|
||||
exclude_newer: exclude_newer.and_then(|en| en.exclude_newer_package(package_name)),
|
||||
}),
|
||||
}
|
||||
}
|
||||
|
|
@ -365,7 +365,7 @@ struct VersionMapLazy {
|
|||
/// in the current environment.
|
||||
tags: Option<Tags>,
|
||||
/// Whether files newer than this timestamp should be excluded or not.
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
/// Which yanked versions are allowed
|
||||
allowed_yanks: AllowedYanks,
|
||||
/// The hashes of allowed distributions.
|
||||
|
|
@ -420,7 +420,7 @@ impl VersionMapLazy {
|
|||
for (filename, file) in files.all() {
|
||||
// Support resolving as if it were an earlier timestamp, at least as long files have
|
||||
// upload time information.
|
||||
let (excluded, upload_time) = if let Some(exclude_newer) = self.exclude_newer {
|
||||
let (excluded, upload_time) = if let Some(exclude_newer) = &self.exclude_newer {
|
||||
match file.upload_time_utc_ms.as_ref() {
|
||||
Some(&upload_time) if upload_time >= exclude_newer.timestamp_millis() => {
|
||||
(true, Some(upload_time))
|
||||
|
|
|
|||
|
|
@ -12,7 +12,10 @@ use uv_install_wheel::LinkMode;
|
|||
use uv_pypi_types::{SchemaConflicts, SupportedEnvironments};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_redacted::DisplaySafeUrl;
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, ForkStrategy, PrereleaseMode, ResolutionMode};
|
||||
use uv_resolver::{
|
||||
AnnotationStyle, ExcludeNewer, ExcludeNewerPackage, ExcludeNewerTimestamp, ForkStrategy,
|
||||
PrereleaseMode, ResolutionMode,
|
||||
};
|
||||
use uv_torch::TorchMode;
|
||||
use uv_workspace::pyproject_mut::AddBoundsKind;
|
||||
|
||||
|
|
@ -79,6 +82,7 @@ impl_combine_or!(AddBoundsKind);
|
|||
impl_combine_or!(AnnotationStyle);
|
||||
impl_combine_or!(BuildDependencyStrategy);
|
||||
impl_combine_or!(ExcludeNewer);
|
||||
impl_combine_or!(ExcludeNewerTimestamp);
|
||||
impl_combine_or!(ExportFormat);
|
||||
impl_combine_or!(ForkStrategy);
|
||||
impl_combine_or!(Index);
|
||||
|
|
@ -121,6 +125,22 @@ impl<T> Combine for Option<Vec<T>> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Combine for Option<ExcludeNewerPackage> {
|
||||
/// Combine two [`ExcludeNewerPackage`] instances by merging them, with the values in `self` taking precedence.
|
||||
fn combine(self, other: Option<ExcludeNewerPackage>) -> Option<ExcludeNewerPackage> {
|
||||
match (self, other) {
|
||||
(Some(mut a), Some(b)) => {
|
||||
// Extend with values from b, but a takes precedence (we don't overwrite existing keys)
|
||||
for (key, value) in b {
|
||||
a.entry(key).or_insert(value);
|
||||
}
|
||||
Some(a)
|
||||
}
|
||||
(a, b) => a.or(b),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Combine for Option<ConfigSettings> {
|
||||
/// Combine two maps by merging the map in `self` with the map in `other`, if they're both
|
||||
/// `Some`.
|
||||
|
|
@ -154,3 +174,22 @@ impl Combine for Option<serde::de::IgnoredAny> {
|
|||
self
|
||||
}
|
||||
}
|
||||
|
||||
impl Combine for ExcludeNewer {
|
||||
fn combine(mut self, other: Self) -> Self {
|
||||
self.global = self.global.combine(other.global);
|
||||
|
||||
if !other.package.is_empty() {
|
||||
if self.package.is_empty() {
|
||||
self.package = other.package;
|
||||
} else {
|
||||
// Merge package-specific timestamps, with self taking precedence
|
||||
for (pkg, timestamp) in &other.package {
|
||||
self.package.entry(pkg.clone()).or_insert(*timestamp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -318,6 +318,7 @@ fn warn_uv_toml_masked_fields(options: &Options) {
|
|||
no_build_isolation,
|
||||
no_build_isolation_package,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
link_mode,
|
||||
compile_bytecode,
|
||||
no_sources,
|
||||
|
|
@ -448,6 +449,9 @@ fn warn_uv_toml_masked_fields(options: &Options) {
|
|||
if exclude_newer.is_some() {
|
||||
masked_fields.push("exclude-newer");
|
||||
}
|
||||
if exclude_newer_package.is_some() {
|
||||
masked_fields.push("exclude-newer-package");
|
||||
}
|
||||
if link_mode.is_some() {
|
||||
masked_fields.push("link-mode");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,12 +13,16 @@ use uv_distribution_types::{
|
|||
};
|
||||
use uv_install_wheel::LinkMode;
|
||||
use uv_macros::{CombineOptions, OptionsMetadata};
|
||||
|
||||
use uv_normalize::{ExtraName, PackageName, PipGroupName};
|
||||
use uv_pep508::Requirement;
|
||||
use uv_pypi_types::{SupportedEnvironments, VerbatimParsedUrl};
|
||||
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
|
||||
use uv_redacted::DisplaySafeUrl;
|
||||
use uv_resolver::{AnnotationStyle, ExcludeNewer, ForkStrategy, PrereleaseMode, ResolutionMode};
|
||||
use uv_resolver::{
|
||||
AnnotationStyle, ExcludeNewer, ExcludeNewerPackage, ExcludeNewerTimestamp, ForkStrategy,
|
||||
PrereleaseMode, ResolutionMode,
|
||||
};
|
||||
use uv_static::EnvVars;
|
||||
use uv_torch::TorchMode;
|
||||
use uv_workspace::pyproject_mut::AddBoundsKind;
|
||||
|
|
@ -334,7 +338,7 @@ pub struct InstallerOptions {
|
|||
pub index_strategy: Option<IndexStrategy>,
|
||||
pub keyring_provider: Option<KeyringProviderType>,
|
||||
pub config_settings: Option<ConfigSettings>,
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
pub link_mode: Option<LinkMode>,
|
||||
pub compile_bytecode: Option<bool>,
|
||||
pub reinstall: Option<bool>,
|
||||
|
|
@ -363,7 +367,7 @@ pub struct ResolverOptions {
|
|||
pub dependency_metadata: Option<Vec<StaticMetadata>>,
|
||||
pub config_settings: Option<ConfigSettings>,
|
||||
pub config_settings_package: Option<PackageConfigSettings>,
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: ExcludeNewer,
|
||||
pub link_mode: Option<LinkMode>,
|
||||
pub upgrade: Option<bool>,
|
||||
pub upgrade_package: Option<Vec<Requirement<VerbatimParsedUrl>>>,
|
||||
|
|
@ -657,7 +661,18 @@ pub struct ResolverInstallerOptions {
|
|||
exclude-newer = "2006-12-02T02:07:43Z"
|
||||
"#
|
||||
)]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in a dictionary format.
|
||||
#[option(
|
||||
default = "None",
|
||||
value_type = "dict",
|
||||
example = r#"
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
"#
|
||||
)]
|
||||
pub exclude_newer_package: Option<ExcludeNewerPackage>,
|
||||
/// The method to use when installing packages from the global cache.
|
||||
///
|
||||
/// Defaults to `clone` (also known as Copy-on-Write) on macOS, and `hardlink` on Linux and
|
||||
|
|
@ -1430,7 +1445,18 @@ pub struct PipOptions {
|
|||
exclude-newer = "2006-12-02T02:07:43Z"
|
||||
"#
|
||||
)]
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
/// Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
///
|
||||
/// Accepts package-date pairs in a dictionary format.
|
||||
#[option(
|
||||
default = "None",
|
||||
value_type = "dict",
|
||||
example = r#"
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
"#
|
||||
)]
|
||||
pub exclude_newer_package: Option<ExcludeNewerPackage>,
|
||||
/// Specify a package to omit from the output resolution. Its dependencies will still be
|
||||
/// included in the resolution. Equivalent to pip-compile's `--unsafe-package` option.
|
||||
#[option(
|
||||
|
|
@ -1696,7 +1722,15 @@ impl From<ResolverInstallerOptions> for ResolverOptions {
|
|||
dependency_metadata: value.dependency_metadata,
|
||||
config_settings: value.config_settings,
|
||||
config_settings_package: value.config_settings_package,
|
||||
exclude_newer: value.exclude_newer,
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
value.exclude_newer,
|
||||
value
|
||||
.exclude_newer_package
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(Into::into)
|
||||
.collect(),
|
||||
),
|
||||
link_mode: value.link_mode,
|
||||
upgrade: value.upgrade,
|
||||
upgrade_package: value.upgrade_package,
|
||||
|
|
@ -1723,7 +1757,16 @@ impl From<ResolverInstallerOptions> for InstallerOptions {
|
|||
index_strategy: value.index_strategy,
|
||||
keyring_provider: value.keyring_provider,
|
||||
config_settings: value.config_settings,
|
||||
exclude_newer: value.exclude_newer,
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
value.exclude_newer,
|
||||
value
|
||||
.exclude_newer_package
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(Into::into)
|
||||
.collect(),
|
||||
)
|
||||
.global,
|
||||
link_mode: value.link_mode,
|
||||
compile_bytecode: value.compile_bytecode,
|
||||
reinstall: value.reinstall,
|
||||
|
|
@ -1763,7 +1806,8 @@ pub struct ToolOptions {
|
|||
pub config_settings_package: Option<PackageConfigSettings>,
|
||||
pub no_build_isolation: Option<bool>,
|
||||
pub no_build_isolation_package: Option<Vec<PackageName>>,
|
||||
pub exclude_newer: Option<ExcludeNewer>,
|
||||
pub exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
pub exclude_newer_package: Option<ExcludeNewerPackage>,
|
||||
pub link_mode: Option<LinkMode>,
|
||||
pub compile_bytecode: Option<bool>,
|
||||
pub no_sources: Option<bool>,
|
||||
|
|
@ -1792,6 +1836,7 @@ impl From<ResolverInstallerOptions> for ToolOptions {
|
|||
no_build_isolation: value.no_build_isolation,
|
||||
no_build_isolation_package: value.no_build_isolation_package,
|
||||
exclude_newer: value.exclude_newer,
|
||||
exclude_newer_package: value.exclude_newer_package,
|
||||
link_mode: value.link_mode,
|
||||
compile_bytecode: value.compile_bytecode,
|
||||
no_sources: value.no_sources,
|
||||
|
|
@ -1822,6 +1867,7 @@ impl From<ToolOptions> for ResolverInstallerOptions {
|
|||
no_build_isolation: value.no_build_isolation,
|
||||
no_build_isolation_package: value.no_build_isolation_package,
|
||||
exclude_newer: value.exclude_newer,
|
||||
exclude_newer_package: value.exclude_newer_package,
|
||||
link_mode: value.link_mode,
|
||||
compile_bytecode: value.compile_bytecode,
|
||||
no_sources: value.no_sources,
|
||||
|
|
@ -1875,7 +1921,8 @@ pub struct OptionsWire {
|
|||
config_settings_package: Option<PackageConfigSettings>,
|
||||
no_build_isolation: Option<bool>,
|
||||
no_build_isolation_package: Option<Vec<PackageName>>,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: Option<ExcludeNewerTimestamp>,
|
||||
exclude_newer_package: Option<ExcludeNewerPackage>,
|
||||
link_mode: Option<LinkMode>,
|
||||
compile_bytecode: Option<bool>,
|
||||
no_sources: Option<bool>,
|
||||
|
|
@ -1967,6 +2014,7 @@ impl From<OptionsWire> for Options {
|
|||
no_build_isolation,
|
||||
no_build_isolation_package,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
link_mode,
|
||||
compile_bytecode,
|
||||
no_sources,
|
||||
|
|
@ -2036,6 +2084,7 @@ impl From<OptionsWire> for Options {
|
|||
no_build_isolation,
|
||||
no_build_isolation_package,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
link_mode,
|
||||
compile_bytecode,
|
||||
no_sources,
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ uv-normalize = { workspace = true }
|
|||
uv-pep440 = { workspace = true }
|
||||
uv-pep508 = { workspace = true }
|
||||
uv-performance-memory-allocator = { path = "../uv-performance-memory-allocator", optional = true }
|
||||
uv-platform = { workspace = true }
|
||||
uv-platform-tags = { workspace = true }
|
||||
uv-publish = { workspace = true }
|
||||
uv-pypi-types = { workspace = true }
|
||||
|
|
|
|||
|
|
@ -349,7 +349,7 @@ async fn build_impl(
|
|||
no_build_isolation_package,
|
||||
*index_strategy,
|
||||
*keyring_provider,
|
||||
*exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
*sources,
|
||||
concurrency,
|
||||
build_options,
|
||||
|
|
@ -427,7 +427,7 @@ async fn build_package(
|
|||
no_build_isolation_package: &[PackageName],
|
||||
index_strategy: IndexStrategy,
|
||||
keyring_provider: KeyringProviderType,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
sources: SourceStrategy,
|
||||
concurrency: Concurrency,
|
||||
build_options: &BuildOptions,
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ pub(crate) async fn pip_compile(
|
|||
mut python_version: Option<PythonVersion>,
|
||||
python_platform: Option<TargetTriple>,
|
||||
universal: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
sources: SourceStrategy,
|
||||
annotation_style: AnnotationStyle,
|
||||
link_mode: LinkMode,
|
||||
|
|
@ -485,7 +485,7 @@ pub(crate) async fn pip_compile(
|
|||
link_mode,
|
||||
&build_options,
|
||||
&build_hashes,
|
||||
exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
sources,
|
||||
WorkspaceCache::default(),
|
||||
concurrency,
|
||||
|
|
@ -498,7 +498,7 @@ pub(crate) async fn pip_compile(
|
|||
.prerelease_mode(prerelease_mode)
|
||||
.fork_strategy(fork_strategy)
|
||||
.dependency_mode(dependency_mode)
|
||||
.exclude_newer(exclude_newer)
|
||||
.exclude_newer(exclude_newer.clone())
|
||||
.index_strategy(index_strategy)
|
||||
.torch_backend(torch_backend)
|
||||
.build_options(build_options.clone())
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ pub(crate) async fn pip_install(
|
|||
python_version: Option<PythonVersion>,
|
||||
python_platform: Option<TargetTriple>,
|
||||
strict: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
sources: SourceStrategy,
|
||||
python: Option<String>,
|
||||
system: bool,
|
||||
|
|
@ -429,7 +429,7 @@ pub(crate) async fn pip_install(
|
|||
link_mode,
|
||||
&build_options,
|
||||
&build_hasher,
|
||||
exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
sources,
|
||||
WorkspaceCache::default(),
|
||||
concurrency,
|
||||
|
|
|
|||
|
|
@ -13,12 +13,12 @@ use uv_warnings::warn_user_once;
|
|||
///
|
||||
/// The returned distribution is guaranteed to be compatible with the provided tags and Python
|
||||
/// requirement.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub(crate) struct LatestClient<'env> {
|
||||
pub(crate) client: &'env RegistryClient,
|
||||
pub(crate) capabilities: &'env IndexCapabilities,
|
||||
pub(crate) prerelease: PrereleaseMode,
|
||||
pub(crate) exclude_newer: Option<ExcludeNewer>,
|
||||
pub(crate) exclude_newer: ExcludeNewer,
|
||||
pub(crate) tags: Option<&'env Tags>,
|
||||
pub(crate) requires_python: &'env RequiresPython,
|
||||
}
|
||||
|
|
@ -70,7 +70,7 @@ impl LatestClient<'_> {
|
|||
|
||||
for (filename, file) in files.all() {
|
||||
// Skip distributions uploaded after the cutoff.
|
||||
if let Some(exclude_newer) = self.exclude_newer {
|
||||
if let Some(exclude_newer) = self.exclude_newer.exclude_newer_package(package) {
|
||||
match file.upload_time_utc_ms.as_ref() {
|
||||
Some(&upload_time)
|
||||
if upload_time >= exclude_newer.timestamp_millis() =>
|
||||
|
|
@ -79,8 +79,9 @@ impl LatestClient<'_> {
|
|||
}
|
||||
None => {
|
||||
warn_user_once!(
|
||||
"{} is missing an upload date, but user provided: {exclude_newer}",
|
||||
"{} is missing an upload date, but user provided: {}",
|
||||
file.filename,
|
||||
self.exclude_newer
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ pub(crate) async fn pip_list(
|
|||
network_settings: &NetworkSettings,
|
||||
concurrency: Concurrency,
|
||||
strict: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
python: Option<&str>,
|
||||
system: bool,
|
||||
cache: &Cache,
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ pub(crate) async fn pip_sync(
|
|||
python_version: Option<PythonVersion>,
|
||||
python_platform: Option<TargetTriple>,
|
||||
strict: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
python: Option<String>,
|
||||
system: bool,
|
||||
break_system_packages: bool,
|
||||
|
|
@ -364,7 +364,7 @@ pub(crate) async fn pip_sync(
|
|||
link_mode,
|
||||
&build_options,
|
||||
&build_hasher,
|
||||
exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
sources,
|
||||
WorkspaceCache::default(),
|
||||
concurrency,
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ pub(crate) async fn pip_tree(
|
|||
network_settings: NetworkSettings,
|
||||
concurrency: Concurrency,
|
||||
strict: bool,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
python: Option<&str>,
|
||||
system: bool,
|
||||
cache: &Cache,
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ pub(crate) async fn add(
|
|||
settings.resolver.link_mode,
|
||||
&settings.resolver.build_options,
|
||||
&build_hasher,
|
||||
settings.resolver.exclude_newer,
|
||||
settings.resolver.exclude_newer.clone(),
|
||||
sources,
|
||||
// No workspace caching since `uv add` changes the workspace definition.
|
||||
WorkspaceCache::default(),
|
||||
|
|
@ -1312,6 +1312,7 @@ impl PythonTarget {
|
|||
|
||||
/// Represents the destination where dependencies are added, either to a project or a script.
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
pub(super) enum AddTarget {
|
||||
/// A PEP 723 script, with inline metadata.
|
||||
Script(Pep723Script, Box<Interpreter>),
|
||||
|
|
@ -1420,6 +1421,7 @@ impl AddTarget {
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum AddTargetSnapshot {
|
||||
Script(Pep723Script, Option<Vec<u8>>),
|
||||
Project(VirtualProject, Option<Vec<u8>>),
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@ use crate::printer::Printer;
|
|||
use crate::settings::{NetworkSettings, ResolverSettings};
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum ExportTarget {
|
||||
/// A PEP 723 script, with inline metadata.
|
||||
Script(Pep723Script),
|
||||
|
|
|
|||
|
|
@ -652,7 +652,7 @@ async fn do_lock(
|
|||
.resolution_mode(*resolution)
|
||||
.prerelease_mode(*prerelease)
|
||||
.fork_strategy(*fork_strategy)
|
||||
.exclude_newer(*exclude_newer)
|
||||
.exclude_newer(exclude_newer.clone())
|
||||
.index_strategy(*index_strategy)
|
||||
.build_options(build_options.clone())
|
||||
.required_environments(required_environments.cloned().unwrap_or_default())
|
||||
|
|
@ -711,7 +711,7 @@ async fn do_lock(
|
|||
*link_mode,
|
||||
build_options,
|
||||
&build_hasher,
|
||||
*exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
*sources,
|
||||
workspace_cache.clone(),
|
||||
concurrency,
|
||||
|
|
@ -990,31 +990,37 @@ impl ValidatedLock {
|
|||
);
|
||||
return Ok(Self::Unusable(lock));
|
||||
}
|
||||
match (lock.exclude_newer(), options.exclude_newer) {
|
||||
(None, None) => (),
|
||||
(Some(existing), Some(provided)) if existing == provided => (),
|
||||
(Some(existing), Some(provided)) => {
|
||||
let lock_exclude_newer = lock.exclude_newer();
|
||||
let options_exclude_newer = &options.exclude_newer;
|
||||
|
||||
match (
|
||||
lock_exclude_newer.is_empty(),
|
||||
options_exclude_newer.is_empty(),
|
||||
) {
|
||||
(true, true) => (),
|
||||
(false, false) if lock_exclude_newer == *options_exclude_newer => (),
|
||||
(false, false) => {
|
||||
let _ = writeln!(
|
||||
printer.stderr(),
|
||||
"Ignoring existing lockfile due to change in timestamp cutoff: `{}` vs. `{}`",
|
||||
existing.cyan(),
|
||||
provided.cyan()
|
||||
lock_exclude_newer.cyan(),
|
||||
options_exclude_newer.cyan()
|
||||
);
|
||||
return Ok(Self::Unusable(lock));
|
||||
}
|
||||
(Some(existing), None) => {
|
||||
(false, true) => {
|
||||
let _ = writeln!(
|
||||
printer.stderr(),
|
||||
"Ignoring existing lockfile due to removal of timestamp cutoff: `{}`",
|
||||
existing.cyan(),
|
||||
lock_exclude_newer.cyan(),
|
||||
);
|
||||
return Ok(Self::Unusable(lock));
|
||||
}
|
||||
(None, Some(provided)) => {
|
||||
(true, false) => {
|
||||
let _ = writeln!(
|
||||
printer.stderr(),
|
||||
"Ignoring existing lockfile due to addition of timestamp cutoff: `{}`",
|
||||
provided.cyan()
|
||||
options_exclude_newer.cyan()
|
||||
);
|
||||
return Ok(Self::Unusable(lock));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1757,7 +1757,7 @@ pub(crate) async fn resolve_names(
|
|||
*link_mode,
|
||||
build_options,
|
||||
&build_hasher,
|
||||
*exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
*sources,
|
||||
workspace_cache.clone(),
|
||||
concurrency,
|
||||
|
|
@ -1904,7 +1904,7 @@ pub(crate) async fn resolve_environment(
|
|||
.resolution_mode(*resolution)
|
||||
.prerelease_mode(*prerelease)
|
||||
.fork_strategy(*fork_strategy)
|
||||
.exclude_newer(*exclude_newer)
|
||||
.exclude_newer(exclude_newer.clone())
|
||||
.index_strategy(*index_strategy)
|
||||
.build_options(build_options.clone())
|
||||
.build();
|
||||
|
|
@ -1967,7 +1967,7 @@ pub(crate) async fn resolve_environment(
|
|||
*link_mode,
|
||||
build_options,
|
||||
&build_hasher,
|
||||
*exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
*sources,
|
||||
workspace_cache,
|
||||
concurrency,
|
||||
|
|
@ -2290,7 +2290,7 @@ pub(crate) async fn update_environment(
|
|||
.resolution_mode(*resolution)
|
||||
.prerelease_mode(*prerelease)
|
||||
.fork_strategy(*fork_strategy)
|
||||
.exclude_newer(*exclude_newer)
|
||||
.exclude_newer(exclude_newer.clone())
|
||||
.index_strategy(*index_strategy)
|
||||
.build_options(build_options.clone())
|
||||
.build();
|
||||
|
|
@ -2333,7 +2333,7 @@ pub(crate) async fn update_environment(
|
|||
*link_mode,
|
||||
build_options,
|
||||
&build_hasher,
|
||||
*exclude_newer,
|
||||
exclude_newer.clone(),
|
||||
*sources,
|
||||
workspace_cache,
|
||||
concurrency,
|
||||
|
|
|
|||
|
|
@ -386,6 +386,7 @@ pub(crate) async fn remove(
|
|||
|
||||
/// Represents the destination where dependencies are added, either to a project or a script.
|
||||
#[derive(Debug)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum RemoveTarget {
|
||||
/// A PEP 723 script, with inline metadata.
|
||||
Project(VirtualProject),
|
||||
|
|
|
|||
|
|
@ -495,6 +495,7 @@ fn identify_installation_target<'a>(
|
|||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
#[allow(clippy::large_enum_variant)]
|
||||
enum SyncTarget {
|
||||
/// Sync a project environment.
|
||||
Project(VirtualProject),
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ use tracing::{debug, trace};
|
|||
|
||||
use uv_configuration::{Preview, PreviewFeatures};
|
||||
use uv_fs::Simplified;
|
||||
use uv_platform::{Arch, Libc};
|
||||
use uv_python::downloads::{
|
||||
self, ArchRequest, DownloadResult, ManagedPythonDownload, PythonDownloadRequest,
|
||||
};
|
||||
|
|
@ -23,7 +24,6 @@ use uv_python::managed::{
|
|||
ManagedPythonInstallation, ManagedPythonInstallations, PythonMinorVersionLink,
|
||||
create_link_to_executable, python_executable_dir,
|
||||
};
|
||||
use uv_python::platform::{Arch, Libc};
|
||||
use uv_python::{
|
||||
PythonDownloads, PythonInstallationKey, PythonInstallationMinorVersionKey, PythonRequest,
|
||||
PythonVersionFile, VersionFileDiscoveryOptions, VersionFilePreference, VersionRequest,
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ pub(crate) async fn venv(
|
|||
system_site_packages: bool,
|
||||
seed: bool,
|
||||
on_existing: OnExisting,
|
||||
exclude_newer: Option<ExcludeNewer>,
|
||||
exclude_newer: ExcludeNewer,
|
||||
concurrency: Concurrency,
|
||||
no_config: bool,
|
||||
no_project: bool,
|
||||
|
|
|
|||
|
|
@ -35,7 +35,8 @@ use uv_pypi_types::SupportedEnvironments;
|
|||
use uv_python::{Prefix, PythonDownloads, PythonPreference, PythonVersion, Target};
|
||||
use uv_redacted::DisplaySafeUrl;
|
||||
use uv_resolver::{
|
||||
AnnotationStyle, DependencyMode, ExcludeNewer, ForkStrategy, PrereleaseMode, ResolutionMode,
|
||||
AnnotationStyle, DependencyMode, ExcludeNewer, ExcludeNewerPackage, ForkStrategy,
|
||||
PrereleaseMode, ResolutionMode,
|
||||
};
|
||||
use uv_settings::{
|
||||
Combine, EnvironmentOptions, FilesystemOptions, Options, PipOptions, PublishOptions,
|
||||
|
|
@ -723,6 +724,7 @@ impl ToolUpgradeSettings {
|
|||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
exclude_newer_package,
|
||||
build,
|
||||
} = args;
|
||||
|
||||
|
|
@ -754,6 +756,7 @@ impl ToolUpgradeSettings {
|
|||
no_build_isolation_package,
|
||||
build_isolation,
|
||||
exclude_newer,
|
||||
exclude_newer_package,
|
||||
link_mode,
|
||||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
|
|
@ -2666,6 +2669,7 @@ impl VenvSettings {
|
|||
link_mode,
|
||||
refresh,
|
||||
compat_args: _,
|
||||
exclude_newer_package,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -2685,6 +2689,8 @@ impl VenvSettings {
|
|||
index_strategy,
|
||||
keyring_provider,
|
||||
exclude_newer,
|
||||
exclude_newer_package: exclude_newer_package
|
||||
.map(ExcludeNewerPackage::from_iter),
|
||||
link_mode,
|
||||
..PipOptions::from(index_args)
|
||||
},
|
||||
|
|
@ -2708,7 +2714,7 @@ pub(crate) struct InstallerSettingsRef<'a> {
|
|||
pub(crate) config_settings_package: &'a PackageConfigSettings,
|
||||
pub(crate) no_build_isolation: bool,
|
||||
pub(crate) no_build_isolation_package: &'a [PackageName],
|
||||
pub(crate) exclude_newer: Option<ExcludeNewer>,
|
||||
pub(crate) exclude_newer: ExcludeNewer,
|
||||
pub(crate) link_mode: LinkMode,
|
||||
pub(crate) compile_bytecode: bool,
|
||||
pub(crate) reinstall: &'a Reinstall,
|
||||
|
|
@ -2727,7 +2733,7 @@ pub(crate) struct ResolverSettings {
|
|||
pub(crate) config_setting: ConfigSettings,
|
||||
pub(crate) config_settings_package: PackageConfigSettings,
|
||||
pub(crate) dependency_metadata: DependencyMetadata,
|
||||
pub(crate) exclude_newer: Option<ExcludeNewer>,
|
||||
pub(crate) exclude_newer: ExcludeNewer,
|
||||
pub(crate) fork_strategy: ForkStrategy,
|
||||
pub(crate) index_locations: IndexLocations,
|
||||
pub(crate) index_strategy: IndexStrategy,
|
||||
|
|
@ -2870,7 +2876,15 @@ impl From<ResolverInstallerOptions> for ResolverInstallerSettings {
|
|||
dependency_metadata: DependencyMetadata::from_entries(
|
||||
value.dependency_metadata.into_iter().flatten(),
|
||||
),
|
||||
exclude_newer: value.exclude_newer,
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
value.exclude_newer,
|
||||
value
|
||||
.exclude_newer_package
|
||||
.unwrap_or_default()
|
||||
.into_iter()
|
||||
.map(Into::into)
|
||||
.collect(),
|
||||
),
|
||||
fork_strategy: value.fork_strategy.unwrap_or_default(),
|
||||
index_locations,
|
||||
index_strategy: value.index_strategy.unwrap_or_default(),
|
||||
|
|
@ -2941,7 +2955,7 @@ pub(crate) struct PipSettings {
|
|||
pub(crate) python_version: Option<PythonVersion>,
|
||||
pub(crate) python_platform: Option<TargetTriple>,
|
||||
pub(crate) universal: bool,
|
||||
pub(crate) exclude_newer: Option<ExcludeNewer>,
|
||||
pub(crate) exclude_newer: ExcludeNewer,
|
||||
pub(crate) no_emit_package: Vec<PackageName>,
|
||||
pub(crate) emit_index_url: bool,
|
||||
pub(crate) emit_find_links: bool,
|
||||
|
|
@ -3028,6 +3042,7 @@ impl PipSettings {
|
|||
upgrade_package,
|
||||
reinstall,
|
||||
reinstall_package,
|
||||
exclude_newer_package,
|
||||
} = pip.unwrap_or_default();
|
||||
|
||||
let ResolverInstallerOptions {
|
||||
|
|
@ -3059,6 +3074,7 @@ impl PipSettings {
|
|||
no_binary: top_level_no_binary,
|
||||
no_binary_package: top_level_no_binary_package,
|
||||
build_dependency_strategy: _,
|
||||
exclude_newer_package: top_level_exclude_newer_package,
|
||||
} = top_level;
|
||||
|
||||
// Merge the top-level options (`tool.uv`) with the pip-specific options (`tool.uv.pip`),
|
||||
|
|
@ -3082,7 +3098,15 @@ impl PipSettings {
|
|||
let no_build_isolation = no_build_isolation.combine(top_level_no_build_isolation);
|
||||
let no_build_isolation_package =
|
||||
no_build_isolation_package.combine(top_level_no_build_isolation_package);
|
||||
let exclude_newer = exclude_newer.combine(top_level_exclude_newer);
|
||||
let exclude_newer = args
|
||||
.exclude_newer
|
||||
.combine(exclude_newer)
|
||||
.combine(top_level_exclude_newer);
|
||||
let exclude_newer_package = args
|
||||
.exclude_newer_package
|
||||
.combine(exclude_newer_package)
|
||||
.combine(top_level_exclude_newer_package)
|
||||
.unwrap_or_default();
|
||||
let link_mode = link_mode.combine(top_level_link_mode);
|
||||
let compile_bytecode = compile_bytecode.combine(top_level_compile_bytecode);
|
||||
let no_sources = no_sources.combine(top_level_no_sources);
|
||||
|
|
@ -3189,7 +3213,10 @@ impl PipSettings {
|
|||
python_version: args.python_version.combine(python_version),
|
||||
python_platform: args.python_platform.combine(python_platform),
|
||||
universal: args.universal.combine(universal).unwrap_or_default(),
|
||||
exclude_newer: args.exclude_newer.combine(exclude_newer),
|
||||
exclude_newer: ExcludeNewer::from_args(
|
||||
exclude_newer,
|
||||
exclude_newer_package.into_iter().map(Into::into).collect(),
|
||||
),
|
||||
no_emit_package: args
|
||||
.no_emit_package
|
||||
.combine(no_emit_package)
|
||||
|
|
@ -3281,7 +3308,7 @@ impl<'a> From<&'a ResolverInstallerSettings> for InstallerSettingsRef<'a> {
|
|||
config_settings_package: &settings.resolver.config_settings_package,
|
||||
no_build_isolation: settings.resolver.no_build_isolation,
|
||||
no_build_isolation_package: &settings.resolver.no_build_isolation_package,
|
||||
exclude_newer: settings.resolver.exclude_newer,
|
||||
exclude_newer: settings.resolver.exclude_newer.clone(),
|
||||
link_mode: settings.resolver.link_mode,
|
||||
compile_bytecode: settings.compile_bytecode,
|
||||
reinstall: &settings.reinstall,
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ fn root_package_splits_transitive_too() -> Result<()> {
|
|||
|
||||
assert_snapshot!(context.read("uv.lock"), @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11, <3.13"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12'",
|
||||
|
|
@ -409,7 +409,7 @@ fn root_package_splits_other_dependencies_too() -> Result<()> {
|
|||
|
||||
assert_snapshot!(context.read("uv.lock"), @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11, <3.13"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12'",
|
||||
|
|
@ -572,7 +572,7 @@ fn branching_between_registry_and_direct_url() -> Result<()> {
|
|||
// We have source dist and wheel for the registry, but only the wheel for the direct URL.
|
||||
assert_snapshot!(context.read("uv.lock"), @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11, <3.13"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12'",
|
||||
|
|
@ -659,7 +659,7 @@ fn branching_urls_of_different_sources_disjoint() -> Result<()> {
|
|||
// We have source dist and wheel for the registry, but only the wheel for the direct URL.
|
||||
assert_snapshot!(context.read("uv.lock"), @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11, <3.13"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12'",
|
||||
|
|
@ -789,7 +789,7 @@ fn dont_pre_visit_url_packages() -> Result<()> {
|
|||
|
||||
assert_snapshot!(context.read("uv.lock"), @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11, <3.13"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ fn add_registry() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -230,7 +230,7 @@ fn add_git() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -361,7 +361,7 @@ fn add_git_private_source() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -456,7 +456,7 @@ fn add_git_private_raw() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -739,7 +739,7 @@ fn add_git_raw() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1033,7 +1033,7 @@ fn add_unnamed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1129,7 +1129,7 @@ fn add_remove_dev() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1246,7 +1246,7 @@ fn add_remove_dev() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1336,7 +1336,7 @@ fn add_remove_optional() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1453,7 +1453,7 @@ fn add_remove_optional() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1689,7 +1689,7 @@ fn add_remove_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -1773,7 +1773,7 @@ fn add_remove_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2315,7 +2315,7 @@ fn add_workspace_editable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2447,7 +2447,7 @@ fn add_workspace_path() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2575,7 +2575,7 @@ fn add_path_implicit_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2697,7 +2697,7 @@ fn add_path_no_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2811,7 +2811,7 @@ fn add_path_adjacent_directory() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2986,7 +2986,7 @@ fn update() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -3754,7 +3754,7 @@ fn add_inexact() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -3882,7 +3882,7 @@ fn remove_registry() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4518,7 +4518,7 @@ fn add_lower_bound_optional() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4631,7 +4631,7 @@ fn add_lower_bound_local() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4733,7 +4733,7 @@ fn add_non_project() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -5131,7 +5131,7 @@ fn add_requirements_file_constraints() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -6069,7 +6069,7 @@ fn add_script_settings() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -6612,7 +6612,7 @@ fn add_remove_script_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -6795,7 +6795,7 @@ fn add_remove_script_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -7000,7 +7000,7 @@ fn add_remove_script_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -8629,7 +8629,7 @@ fn add_warn_index_url() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -8731,7 +8731,7 @@ fn add_no_warn_index_url() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -8824,7 +8824,7 @@ fn add_index() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -8910,7 +8910,7 @@ fn add_index() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9022,7 +9022,7 @@ fn add_index() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9142,7 +9142,7 @@ fn add_index() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9271,7 +9271,7 @@ fn add_index() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9407,7 +9407,7 @@ fn add_default_index_url() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9480,7 +9480,7 @@ fn add_default_index_url() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9581,7 +9581,7 @@ fn add_index_credentials() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9677,7 +9677,7 @@ fn existing_index_credentials() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9770,7 +9770,7 @@ fn add_index_with_trailing_slash() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9866,7 +9866,7 @@ fn add_index_without_trailing_slash() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -10142,7 +10142,7 @@ fn add_group_comment() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -10276,7 +10276,7 @@ fn add_index_comments() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -10596,7 +10596,7 @@ fn add_direct_url_subdirectory() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -10726,7 +10726,7 @@ fn add_direct_url_subdirectory_raw() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -11374,7 +11374,7 @@ fn multiple_index_cli() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -11485,7 +11485,7 @@ fn repeated_index_cli_environment_variable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -11591,7 +11591,7 @@ fn repeated_index_cli_environment_variable_newline() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -11701,7 +11701,7 @@ fn repeated_index_cli() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -11811,7 +11811,7 @@ fn repeated_index_cli_reversed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -583,7 +583,7 @@ fn requirements_txt_dependency_conflicting_markers() -> Result<()> {
|
|||
insta::assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -1505,7 +1505,7 @@ fn requirements_txt_non_project_fork() -> Result<()> {
|
|||
insta::assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'win32'",
|
||||
|
|
@ -2477,7 +2477,7 @@ fn requirements_txt_script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'win32'",
|
||||
|
|
@ -2596,7 +2596,7 @@ fn requirements_txt_script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'win32'",
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -91,7 +91,7 @@ fn extra_basic() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "extra1" },
|
||||
|
|
@ -285,7 +285,7 @@ fn extra_basic_three_extras() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "extra1" },
|
||||
|
|
@ -760,7 +760,7 @@ fn extra_multiple_independent() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "extra1" },
|
||||
|
|
@ -910,7 +910,7 @@ fn extra_config_change_ignore_lockfile() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "extra1" },
|
||||
|
|
@ -1787,7 +1787,7 @@ fn extra_depends_on_conflicting_extra_transitive() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "example", extra = "bar" },
|
||||
|
|
@ -1972,7 +1972,7 @@ fn group_basic() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "group1" },
|
||||
|
|
@ -2127,7 +2127,7 @@ fn group_default() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "group1" },
|
||||
|
|
@ -2339,7 +2339,7 @@ fn mixed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "extra1" },
|
||||
|
|
@ -2509,7 +2509,7 @@ fn multiple_sources_index_disjoint_extras() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "cu118" },
|
||||
|
|
@ -2659,7 +2659,7 @@ fn multiple_sources_index_disjoint_groups() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "cu118" },
|
||||
|
|
@ -2808,7 +2808,7 @@ fn multiple_sources_index_disjoint_extras_with_extra() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "cu118" },
|
||||
|
|
@ -2977,7 +2977,7 @@ fn multiple_sources_index_disjoint_extras_with_marker() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"extra != 'extra-7-project-cu118' and extra == 'extra-7-project-cu124'",
|
||||
|
|
@ -3303,7 +3303,7 @@ fn shared_optional_dependency_extra1() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "bar" },
|
||||
|
|
@ -3443,7 +3443,7 @@ fn shared_optional_dependency_group1() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "bar" },
|
||||
|
|
@ -3584,7 +3584,7 @@ fn shared_optional_dependency_mixed1() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "foo" },
|
||||
|
|
@ -3729,7 +3729,7 @@ fn shared_optional_dependency_extra2() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.11.*"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "bar" },
|
||||
|
|
@ -3870,7 +3870,7 @@ fn shared_optional_dependency_group2() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.11.*"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "bar" },
|
||||
|
|
@ -4016,7 +4016,7 @@ fn shared_optional_dependency_mixed2() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.11.*"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "foo" },
|
||||
|
|
@ -4160,7 +4160,7 @@ fn shared_dependency_extra() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "bar" },
|
||||
|
|
@ -4335,7 +4335,7 @@ fn shared_dependency_group() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "bar" },
|
||||
|
|
@ -4511,7 +4511,7 @@ fn shared_dependency_mixed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "foo" },
|
||||
|
|
@ -4729,7 +4729,7 @@ conflicts = [
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.11.*"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "x1" },
|
||||
|
|
@ -4915,7 +4915,7 @@ fn jinja_no_conflict_markers1() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", extra = "cu118" },
|
||||
|
|
@ -5077,7 +5077,7 @@ fn jinja_no_conflict_markers2() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"extra != 'extra-7-project-cu118' and extra == 'extra-7-project-cu124'",
|
||||
|
|
@ -5238,7 +5238,7 @@ fn collision_extra() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "pkg", extra = "bar" },
|
||||
|
|
@ -5467,7 +5467,7 @@ fn extra_inferences() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "pkg", extra = "x1" },
|
||||
|
|
@ -7503,7 +7503,7 @@ fn deduplicate_resolution_markers() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"sys_platform != 'linux' and extra != 'extra-3-pkg-x1' and extra == 'extra-3-pkg-x2'",
|
||||
|
|
@ -7657,7 +7657,7 @@ fn incorrect_extra_simplification_leads_to_multiple_torch_packages() -> Result<(
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12' and sys_platform == 'win32' and extra != 'extra-4-test-chgnet' and extra == 'extra-4-test-m3gnet'",
|
||||
|
|
@ -10432,7 +10432,7 @@ fn duplicate_torch_and_sympy_because_of_wrong_inferences() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12' and sys_platform == 'win32' and extra != 'extra-4-test-alignn' and extra == 'extra-4-test-all' and extra == 'extra-4-test-chgnet' and extra != 'extra-4-test-m3gnet'",
|
||||
|
|
@ -13654,7 +13654,7 @@ fn overlapping_resolution_markers() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.10.*"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'linux' and extra != 'extra-14-ads-mega-model-cpu' and extra == 'extra-14-ads-mega-model-cu118'",
|
||||
|
|
@ -14337,7 +14337,7 @@ fn avoids_exponential_lock_file_growth() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"extra != 'extra-27-resolution-markers-for-days-cpu' and extra == 'extra-27-resolution-markers-for-days-cu124'",
|
||||
|
|
@ -14752,7 +14752,7 @@ fn avoids_exponential_lock_file_growth() -> Result<()> {
|
|||
lock,
|
||||
@r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"extra != 'extra-27-resolution-markers-for-days-cpu' and extra == 'extra-27-resolution-markers-for-days-cu124'",
|
||||
|
|
|
|||
|
|
@ -137,7 +137,7 @@ fn wrong_backtracking_basic() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -319,7 +319,7 @@ fn wrong_backtracking_indirect() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -466,7 +466,7 @@ fn fork_allows_non_conflicting_non_overlapping_dependencies() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -586,7 +586,7 @@ fn fork_allows_non_conflicting_repeated_dependencies() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -688,7 +688,7 @@ fn fork_basic() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -991,7 +991,7 @@ fn fork_filter_sibling_dependencies() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'linux'",
|
||||
|
|
@ -1174,7 +1174,7 @@ fn fork_upgrade() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1299,7 +1299,7 @@ fn fork_incomplete_markers() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.11'",
|
||||
|
|
@ -1456,7 +1456,7 @@ fn fork_marker_accrue() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -1667,7 +1667,7 @@ fn fork_marker_inherit_combined_allowed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"implementation_name == 'pypy' and sys_platform == 'darwin'",
|
||||
|
|
@ -1853,7 +1853,7 @@ fn fork_marker_inherit_combined_disallowed() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"implementation_name == 'pypy' and sys_platform == 'darwin'",
|
||||
|
|
@ -2028,7 +2028,7 @@ fn fork_marker_inherit_combined() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"implementation_name == 'pypy' and sys_platform == 'darwin'",
|
||||
|
|
@ -2194,7 +2194,7 @@ fn fork_marker_inherit_isolated() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -2348,7 +2348,7 @@ fn fork_marker_inherit_transitive() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -2508,7 +2508,7 @@ fn fork_marker_inherit() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -2651,7 +2651,7 @@ fn fork_marker_limited_inherit() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -2811,7 +2811,7 @@ fn fork_marker_selection() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -2974,7 +2974,7 @@ fn fork_marker_track() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'darwin'",
|
||||
|
|
@ -3131,7 +3131,7 @@ fn fork_non_fork_marker_transitive() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3442,7 +3442,7 @@ fn fork_overlapping_markers_basic() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.11'",
|
||||
|
|
@ -3626,7 +3626,7 @@ fn preferences_dependent_forking_bistable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'linux'",
|
||||
|
|
@ -4038,7 +4038,7 @@ fn preferences_dependent_forking_tristable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'linux'",
|
||||
|
|
@ -4332,7 +4332,7 @@ fn preferences_dependent_forking() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"sys_platform == 'linux'",
|
||||
|
|
@ -4512,7 +4512,7 @@ fn fork_remaining_universe_partitioning() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"os_name == 'darwin' and sys_platform == 'illumos'",
|
||||
|
|
@ -4665,7 +4665,7 @@ fn fork_requires_python_full_prerelease() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4750,7 +4750,7 @@ fn fork_requires_python_full() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4839,7 +4839,7 @@ fn fork_requires_python_patch_overlap() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10.1"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -4933,7 +4933,7 @@ fn fork_requires_python() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5014,7 +5014,7 @@ fn requires_python_wheels() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.10"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5113,7 +5113,7 @@ fn unreachable_package() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5218,7 +5218,7 @@ fn unreachable_wheels() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5352,7 +5352,7 @@ fn marker_variants_have_different_extras() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"platform_python_implementation != 'PyPy'",
|
||||
|
|
@ -5494,7 +5494,7 @@ fn virtual_package_extra_priorities() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5618,7 +5618,7 @@ fn specific_architecture() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -3362,7 +3362,7 @@ fn compile_exclude_newer() -> Result<()> {
|
|||
.arg("--exclude-newer")
|
||||
// 4.64.0: 2022-04-04T01:48:46.194635Z1
|
||||
// 4.64.1: 2022-09-03T11:10:27.148080Z
|
||||
.arg("2022-04-04T12:00:00Z"), @r###"
|
||||
.arg("2022-04-04T12:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
|
@ -3373,7 +3373,7 @@ fn compile_exclude_newer() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
Resolved 1 package in [TIME]
|
||||
"###
|
||||
"
|
||||
);
|
||||
|
||||
// Use a date as input instead.
|
||||
|
|
@ -3383,7 +3383,7 @@ fn compile_exclude_newer() -> Result<()> {
|
|||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-04-04"), @r###"
|
||||
.arg("2022-04-04"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
|
@ -3394,7 +3394,7 @@ fn compile_exclude_newer() -> Result<()> {
|
|||
|
||||
----- stderr -----
|
||||
Resolved 1 package in [TIME]
|
||||
"###
|
||||
"
|
||||
);
|
||||
|
||||
// Check the error message for invalid datetime
|
||||
|
|
@ -3438,6 +3438,190 @@ fn compile_exclude_newer() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Test per-package exclude-newer functionality
|
||||
#[test]
|
||||
fn compile_exclude_newer_package() -> Result<()> {
|
||||
let context = TestContext::new("3.12");
|
||||
let requirements_in = context.temp_dir.child("requirements.in");
|
||||
requirements_in.write_str("tqdm\nrequests")?;
|
||||
|
||||
// First, establish baseline with global exclude-newer
|
||||
// tqdm 4.64.0 was released on 2022-04-04, 4.64.1 on 2022-09-03
|
||||
// requests 2.27.1 was released on 2022-01-05, 2.28.0 on 2022-05-29
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-04-04T12:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --exclude-newer 2022-04-04T12:00:00Z
|
||||
certifi==2021.10.8
|
||||
# via requests
|
||||
charset-normalizer==2.0.12
|
||||
# via requests
|
||||
idna==3.3
|
||||
# via requests
|
||||
requests==2.27.1
|
||||
# via -r requirements.in
|
||||
tqdm==4.64.0
|
||||
# via -r requirements.in
|
||||
urllib3==1.26.9
|
||||
# via requests
|
||||
|
||||
----- stderr -----
|
||||
Resolved 6 packages in [TIME]
|
||||
"
|
||||
);
|
||||
|
||||
// Test override: allow tqdm to use newer versions while keeping requests pinned
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-04-04T12:00:00Z")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm=2022-09-04T00:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --exclude-newer 2022-04-04T12:00:00Z --exclude-newer-package tqdm=2022-09-04T00:00:00Z
|
||||
certifi==2021.10.8
|
||||
# via requests
|
||||
charset-normalizer==2.0.12
|
||||
# via requests
|
||||
idna==3.3
|
||||
# via requests
|
||||
requests==2.27.1
|
||||
# via -r requirements.in
|
||||
tqdm==4.64.1
|
||||
# via -r requirements.in
|
||||
urllib3==1.26.9
|
||||
# via requests
|
||||
|
||||
----- stderr -----
|
||||
Resolved 6 packages in [TIME]
|
||||
"
|
||||
);
|
||||
|
||||
// Test multiple package overrides
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-01-01T00:00:00Z")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm=2022-09-04T00:00:00Z")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("requests=2022-06-01T00:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --exclude-newer 2022-01-01T00:00:00Z --exclude-newer-package tqdm=2022-09-04T00:00:00Z --exclude-newer-package requests=2022-06-01T00:00:00Z
|
||||
certifi==2021.10.8
|
||||
# via requests
|
||||
charset-normalizer==2.0.9
|
||||
# via requests
|
||||
idna==3.3
|
||||
# via requests
|
||||
requests==2.27.1
|
||||
# via -r requirements.in
|
||||
tqdm==4.64.1
|
||||
# via -r requirements.in
|
||||
urllib3==1.26.7
|
||||
# via requests
|
||||
|
||||
----- stderr -----
|
||||
Resolved 6 packages in [TIME]
|
||||
"
|
||||
);
|
||||
|
||||
// Test exclude-newer-package without global exclude-newer
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm=2022-04-04T12:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
# This file was autogenerated by uv via the following command:
|
||||
# uv pip compile --cache-dir [CACHE_DIR] requirements.in --exclude-newer-package tqdm=2022-04-04T12:00:00Z
|
||||
certifi==2025.7.14
|
||||
# via requests
|
||||
charset-normalizer==3.4.2
|
||||
# via requests
|
||||
idna==3.10
|
||||
# via requests
|
||||
requests==2.32.4
|
||||
# via -r requirements.in
|
||||
tqdm==4.64.0
|
||||
# via -r requirements.in
|
||||
urllib3==2.5.0
|
||||
# via requests
|
||||
|
||||
----- stderr -----
|
||||
Resolved 6 packages in [TIME]
|
||||
"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Test error handling for malformed --exclude-newer-package
|
||||
#[test]
|
||||
fn compile_exclude_newer_package_errors() -> Result<()> {
|
||||
let context = TestContext::new("3.12");
|
||||
let requirements_in = context.temp_dir.child("requirements.in");
|
||||
requirements_in.write_str("tqdm")?;
|
||||
|
||||
// Test invalid format (missing =)
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm"), @r"
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
error: invalid value 'tqdm' for '--exclude-newer-package <EXCLUDE_NEWER_PACKAGE>': Invalid `exclude-newer-package` value `tqdm`: expected format `PACKAGE=DATE`
|
||||
|
||||
For more information, try '--help'.
|
||||
"
|
||||
);
|
||||
|
||||
// Test invalid date format
|
||||
uv_snapshot!(context
|
||||
.pip_compile()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("requirements.in")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm=invalid-date"), @r#"
|
||||
success: false
|
||||
exit_code: 2
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
error: invalid value 'tqdm=invalid-date' for '--exclude-newer-package <EXCLUDE_NEWER_PACKAGE>': Invalid `exclude-newer-package` timestamp `invalid-date`: `invalid-date` could not be parsed as a valid date: failed to parse year in date "invalid-date": failed to parse "inva" as year (a four digit integer): invalid digit, expected 0-9 but got i
|
||||
|
||||
For more information, try '--help'.
|
||||
"#
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Resolve a local path dependency on a specific wheel.
|
||||
#[test]
|
||||
fn compile_wheel_path_dependency() -> Result<()> {
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use assert_fs::prelude::{FileTouch, PathChild};
|
|||
use assert_fs::{fixture::FileWriteStr, prelude::PathCreateDir};
|
||||
use indoc::indoc;
|
||||
|
||||
use uv_python::platform::{Arch, Os};
|
||||
use uv_platform::{Arch, Os};
|
||||
use uv_static::EnvVars;
|
||||
|
||||
use crate::common::{TestContext, uv_snapshot, venv_bin_path};
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use uv_python::platform::{Arch, Os};
|
||||
use uv_platform::{Arch, Os};
|
||||
use uv_static::EnvVars;
|
||||
|
||||
use crate::common::{TestContext, uv_snapshot};
|
||||
|
|
|
|||
|
|
@ -5,10 +5,8 @@ use anyhow::Result;
|
|||
use assert_cmd::assert::OutputAssertExt;
|
||||
use assert_fs::fixture::{FileWriteStr, PathChild, PathCreateDir};
|
||||
use insta::assert_snapshot;
|
||||
use uv_python::{
|
||||
PYTHON_VERSION_FILENAME, PYTHON_VERSIONS_FILENAME,
|
||||
platform::{Arch, Os},
|
||||
};
|
||||
use uv_platform::{Arch, Os};
|
||||
use uv_python::{PYTHON_VERSION_FILENAME, PYTHON_VERSIONS_FILENAME};
|
||||
|
||||
#[test]
|
||||
fn python_pin() {
|
||||
|
|
|
|||
|
|
@ -888,7 +888,7 @@ fn run_pep723_script_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -997,7 +997,7 @@ fn run_pep723_script_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -2121,7 +2121,7 @@ fn run_locked() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
existing, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -5513,7 +5513,7 @@ fn run_pep723_script_with_constraints_lock() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -213,7 +213,12 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -402,7 +407,12 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -592,7 +602,12 @@ fn resolve_uv_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -814,7 +829,12 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -971,7 +991,12 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -1174,7 +1199,12 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> {
|
|||
X8664UnknownLinuxGnu,
|
||||
),
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -1421,7 +1451,12 @@ fn resolve_index_url() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -1680,7 +1715,12 @@ fn resolve_index_url() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -1894,7 +1934,12 @@ fn resolve_find_links() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -2073,7 +2118,12 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -2312,7 +2362,12 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -2534,7 +2589,12 @@ fn resolve_top_level() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -2712,7 +2772,12 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -2874,7 +2939,12 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -3036,7 +3106,12 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -3200,7 +3275,12 @@ fn resolve_user_configuration() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -3329,6 +3409,7 @@ fn resolve_tool() -> anyhow::Result<()> {
|
|||
no_build_isolation: None,
|
||||
no_build_isolation_package: None,
|
||||
exclude_newer: None,
|
||||
exclude_newer_package: None,
|
||||
link_mode: Some(
|
||||
Clone,
|
||||
),
|
||||
|
|
@ -3358,7 +3439,12 @@ fn resolve_tool() -> anyhow::Result<()> {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -3558,7 +3644,12 @@ fn resolve_poetry_toml() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -3788,7 +3879,12 @@ fn resolve_both() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -4022,7 +4118,12 @@ fn resolve_both_special_fields() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -4335,7 +4436,12 @@ fn resolve_config_file() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -4386,7 +4492,7 @@ fn resolve_config_file() -> anyhow::Result<()> {
|
|||
|
|
||||
1 | [project]
|
||||
| ^^^^^^^
|
||||
unknown field `project`, expected one of `required-version`, `native-tls`, `offline`, `no-cache`, `cache-dir`, `preview`, `python-preference`, `python-downloads`, `concurrent-downloads`, `concurrent-builds`, `concurrent-installs`, `index`, `index-url`, `extra-index-url`, `no-index`, `find-links`, `index-strategy`, `keyring-provider`, `allow-insecure-host`, `resolution`, `prerelease`, `fork-strategy`, `dependency-metadata`, `config-settings`, `config-settings-package`, `no-build-isolation`, `no-build-isolation-package`, `exclude-newer`, `link-mode`, `compile-bytecode`, `no-sources`, `upgrade`, `upgrade-package`, `reinstall`, `reinstall-package`, `no-build`, `no-build-package`, `no-binary`, `no-binary-package`, `build-dependency-strategy`, `python-install-mirror`, `pypy-install-mirror`, `python-downloads-json-url`, `publish-url`, `trusted-publishing`, `check-url`, `add-bounds`, `pip`, `cache-keys`, `override-dependencies`, `constraint-dependencies`, `build-constraint-dependencies`, `environments`, `required-environments`, `conflicts`, `workspace`, `sources`, `managed`, `package`, `default-groups`, `dependency-groups`, `dev-dependencies`, `build-backend`
|
||||
unknown field `project`, expected one of `required-version`, `native-tls`, `offline`, `no-cache`, `cache-dir`, `preview`, `python-preference`, `python-downloads`, `concurrent-downloads`, `concurrent-builds`, `concurrent-installs`, `index`, `index-url`, `extra-index-url`, `no-index`, `find-links`, `index-strategy`, `keyring-provider`, `allow-insecure-host`, `resolution`, `prerelease`, `fork-strategy`, `dependency-metadata`, `config-settings`, `config-settings-package`, `no-build-isolation`, `no-build-isolation-package`, `exclude-newer`, `exclude-newer-package`, `link-mode`, `compile-bytecode`, `no-sources`, `upgrade`, `upgrade-package`, `reinstall`, `reinstall-package`, `no-build`, `no-build-package`, `no-binary`, `no-binary-package`, `build-dependency-strategy`, `python-install-mirror`, `pypy-install-mirror`, `python-downloads-json-url`, `publish-url`, `trusted-publishing`, `check-url`, `add-bounds`, `pip`, `cache-keys`, `override-dependencies`, `constraint-dependencies`, `build-constraint-dependencies`, `environments`, `required-environments`, `conflicts`, `workspace`, `sources`, `managed`, `package`, `default-groups`, `dependency-groups`, `dev-dependencies`, `build-backend`
|
||||
"
|
||||
);
|
||||
|
||||
|
|
@ -4590,7 +4696,12 @@ fn resolve_skip_empty() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -4755,7 +4866,12 @@ fn resolve_skip_empty() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -4939,7 +5055,12 @@ fn allow_insecure_host() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -5184,7 +5305,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -5408,7 +5534,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -5638,7 +5769,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -5863,7 +5999,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6095,7 +6236,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6320,7 +6466,12 @@ fn index_priority() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6489,7 +6640,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6644,7 +6800,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6797,7 +6958,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -6952,7 +7118,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -7105,7 +7276,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -7259,7 +7435,12 @@ fn verify_hashes() -> anyhow::Result<()> {
|
|||
python_version: None,
|
||||
python_platform: None,
|
||||
universal: false,
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
no_emit_package: [],
|
||||
emit_index_url: false,
|
||||
emit_find_links: false,
|
||||
|
|
@ -7376,7 +7557,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -7479,7 +7665,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -7582,7 +7773,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -7685,7 +7881,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -7788,7 +7989,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
@ -7893,7 +8099,12 @@ fn preview_features() {
|
|||
dependency_metadata: DependencyMetadata(
|
||||
{},
|
||||
),
|
||||
exclude_newer: None,
|
||||
exclude_newer: ExcludeNewer {
|
||||
global: None,
|
||||
package: ExcludeNewerPackage(
|
||||
{},
|
||||
),
|
||||
},
|
||||
fork_strategy: RequiresPython,
|
||||
index_locations: IndexLocations {
|
||||
indexes: [],
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.8"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.10' and implementation_name == 'pypy' and sys_platform == 'win32'",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.13'",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12.[X]"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.9.0"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.13' and sys_platform == 'darwin'",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/ecosystem.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = "==3.11.*"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/workflow.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.9.0"
|
||||
resolution-markers = [
|
||||
"python_full_version >= '3.12'",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/workflow.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/workflow.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ source: crates/uv/tests/it/workflow.rs
|
|||
expression: lock
|
||||
---
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -1691,7 +1691,7 @@ fn sync_relative_wheel() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -3246,7 +3246,7 @@ fn sync_group_legacy_non_project_member() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -3357,7 +3357,7 @@ fn sync_group_self() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4367,7 +4367,7 @@ fn convert_to_virtual() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4427,7 +4427,7 @@ fn convert_to_virtual() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4496,7 +4496,7 @@ fn convert_to_package() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -4561,7 +4561,7 @@ fn convert_to_package() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -6456,7 +6456,7 @@ fn sync_dynamic_extra() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -7879,7 +7879,7 @@ fn sync_stale_egg_info() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[options]
|
||||
|
|
@ -7986,7 +7986,7 @@ fn sync_git_repeated_member_static_metadata() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[options]
|
||||
|
|
@ -8080,7 +8080,7 @@ fn sync_git_repeated_member_dynamic_metadata() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[options]
|
||||
|
|
@ -8198,7 +8198,7 @@ fn sync_git_repeated_member_backwards_path() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[options]
|
||||
|
|
@ -8380,7 +8380,7 @@ fn sync_git_path_dependency() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.13"
|
||||
|
||||
[options]
|
||||
|
|
@ -8488,7 +8488,7 @@ fn sync_build_tag() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -9156,7 +9156,7 @@ fn sync_locked_script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -9261,7 +9261,7 @@ fn sync_locked_script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -10027,7 +10027,7 @@ fn locked_version_coherence() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -10131,7 +10131,7 @@ fn sync_build_constraints() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -10635,6 +10635,157 @@ fn sync_url_with_query_parameters() -> Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
/// Test uv sync with --exclude-newer-package
|
||||
#[test]
|
||||
fn sync_exclude_newer_package() -> Result<()> {
|
||||
let context = TestContext::new("3.12").with_filtered_counts();
|
||||
|
||||
let pyproject_toml = context.temp_dir.child("pyproject.toml");
|
||||
pyproject_toml.write_str(
|
||||
r#"
|
||||
[project]
|
||||
name = "project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"tqdm",
|
||||
"requests",
|
||||
]
|
||||
"#,
|
||||
)?;
|
||||
|
||||
// First sync with only the global exclude-newer to show the baseline
|
||||
uv_snapshot!(context.filters(), context
|
||||
.sync()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-04-04T12:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved [N] packages in [TIME]
|
||||
Prepared [N] packages in [TIME]
|
||||
Installed [N] packages in [TIME]
|
||||
+ certifi==2021.10.8
|
||||
+ charset-normalizer==2.0.12
|
||||
+ idna==3.3
|
||||
+ requests==2.27.1
|
||||
+ tqdm==4.64.0
|
||||
+ urllib3==1.26.9
|
||||
"
|
||||
);
|
||||
|
||||
// Now sync with --exclude-newer-package to allow tqdm to use a newer version
|
||||
uv_snapshot!(context.filters(), context
|
||||
.sync()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||
.arg("--exclude-newer")
|
||||
.arg("2022-04-04T12:00:00Z")
|
||||
.arg("--exclude-newer-package")
|
||||
.arg("tqdm=2022-09-04T00:00:00Z"), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Ignoring existing lockfile due to change in timestamp cutoff: `global: 2022-04-04T12:00:00Z` vs. `global: 2022-04-04T12:00:00Z, tqdm: 2022-09-04T00:00:00Z`
|
||||
Resolved [N] packages in [TIME]
|
||||
Prepared [N] packages in [TIME]
|
||||
Uninstalled [N] packages in [TIME]
|
||||
Installed [N] packages in [TIME]
|
||||
- tqdm==4.64.0
|
||||
+ tqdm==4.64.1
|
||||
"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Test exclude-newer-package in pyproject.toml configuration
|
||||
#[test]
|
||||
fn sync_exclude_newer_package_config() -> Result<()> {
|
||||
let context = TestContext::new("3.12").with_filtered_counts();
|
||||
|
||||
let pyproject_toml = context.temp_dir.child("pyproject.toml");
|
||||
pyproject_toml.write_str(
|
||||
r#"
|
||||
[project]
|
||||
name = "project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"tqdm",
|
||||
"requests",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
exclude-newer = "2022-04-04T12:00:00Z"
|
||||
"#,
|
||||
)?;
|
||||
|
||||
// First sync with only the global exclude-newer from the config
|
||||
uv_snapshot!(context.filters(), context
|
||||
.sync()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Resolved [N] packages in [TIME]
|
||||
Prepared [N] packages in [TIME]
|
||||
Installed [N] packages in [TIME]
|
||||
+ certifi==2021.10.8
|
||||
+ charset-normalizer==2.0.12
|
||||
+ idna==3.3
|
||||
+ requests==2.27.1
|
||||
+ tqdm==4.64.0
|
||||
+ urllib3==1.26.9
|
||||
"
|
||||
);
|
||||
|
||||
// Now add the package-specific exclude-newer to the config
|
||||
pyproject_toml.write_str(
|
||||
r#"
|
||||
[project]
|
||||
name = "project"
|
||||
version = "0.1.0"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"tqdm",
|
||||
"requests",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
exclude-newer = "2022-04-04T12:00:00Z"
|
||||
exclude-newer-package = { tqdm = "2022-09-04T00:00:00Z" }
|
||||
"#,
|
||||
)?;
|
||||
|
||||
// Sync again with the package-specific override
|
||||
uv_snapshot!(context.filters(), context
|
||||
.sync()
|
||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER), @r"
|
||||
success: true
|
||||
exit_code: 0
|
||||
----- stdout -----
|
||||
|
||||
----- stderr -----
|
||||
Ignoring existing lockfile due to change in timestamp cutoff: `global: 2022-04-04T12:00:00Z` vs. `global: 2022-04-04T12:00:00Z, tqdm: 2022-09-04T00:00:00Z`
|
||||
Resolved [N] packages in [TIME]
|
||||
Prepared [N] packages in [TIME]
|
||||
Uninstalled [N] packages in [TIME]
|
||||
Installed [N] packages in [TIME]
|
||||
- tqdm==4.64.0
|
||||
+ tqdm==4.64.1
|
||||
"
|
||||
);
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[test]
|
||||
#[cfg(unix)]
|
||||
fn read_only() -> Result<()> {
|
||||
|
|
@ -10803,7 +10954,7 @@ fn conflicting_editable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "bar" },
|
||||
|
|
@ -10969,7 +11120,7 @@ fn undeclared_editable() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
conflicts = [[
|
||||
{ package = "project", group = "bar" },
|
||||
|
|
|
|||
|
|
@ -1250,7 +1250,7 @@ fn script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
@ -1436,7 +1436,7 @@ fn script() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -1962,7 +1962,7 @@ fn version_set_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2022,7 +2022,7 @@ fn version_set_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2149,7 +2149,7 @@ fn version_set_workspace() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2295,7 +2295,7 @@ fn version_set_evil_constraints() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
@ -2381,7 +2381,7 @@ fn version_set_evil_constraints() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -1226,7 +1226,7 @@ fn workspace_inherit_sources() -> Result<()> {
|
|||
assert_snapshot!(
|
||||
lock, @r#"
|
||||
version = 1
|
||||
revision = 2
|
||||
revision = 3
|
||||
requires-python = ">=3.12"
|
||||
|
||||
[options]
|
||||
|
|
|
|||
|
|
@ -97,7 +97,10 @@ uv run [OPTIONS] [COMMAND]
|
|||
<p>When enabled, uv will remove any extraneous packages from the environment. By default, <code>uv run</code> will make the minimum necessary changes to satisfy the requirements.</p>
|
||||
</dd><dt id="uv-run--exclude-newer"><a href="#uv-run--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-run--extra"><a href="#uv-run--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-run--exclude-newer-package"><a href="#uv-run--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-run--extra"><a href="#uv-run--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May be provided more than once.</p>
|
||||
<p>Optional dependencies are defined via <code>project.optional-dependencies</code> in a <code>pyproject.toml</code>.</p>
|
||||
<p>This option is only available when running in a project.</p>
|
||||
|
|
@ -459,7 +462,10 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
|
|||
</dd><dt id="uv-add--editable"><a href="#uv-add--editable"><code>--editable</code></a></dt><dd><p>Add the requirements as editable</p>
|
||||
</dd><dt id="uv-add--exclude-newer"><a href="#uv-add--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-add--extra"><a href="#uv-add--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Extras to enable for the dependency.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-add--exclude-newer-package"><a href="#uv-add--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-add--extra"><a href="#uv-add--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Extras to enable for the dependency.</p>
|
||||
<p>May be provided more than once.</p>
|
||||
<p>To add this dependency to an optional extra instead, see <code>--optional</code>.</p>
|
||||
</dd><dt id="uv-add--extra-index-url"><a href="#uv-add--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
|
|
@ -653,7 +659,10 @@ uv remove [OPTIONS] <PACKAGES>...
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-remove--exclude-newer"><a href="#uv-remove--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-remove--extra-index-url"><a href="#uv-remove--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-remove--exclude-newer-package"><a href="#uv-remove--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-remove--extra-index-url"><a href="#uv-remove--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-remove--find-links"><a href="#uv-remove--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -832,7 +841,10 @@ uv version [OPTIONS] [VALUE]
|
|||
<p>Instead, the version will be displayed.</p>
|
||||
</dd><dt id="uv-version--exclude-newer"><a href="#uv-version--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-version--extra-index-url"><a href="#uv-version--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-version--exclude-newer-package"><a href="#uv-version--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-version--extra-index-url"><a href="#uv-version--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-version--find-links"><a href="#uv-version--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -1017,7 +1029,10 @@ uv sync [OPTIONS]
|
|||
<p>In dry-run mode, uv will resolve the project's dependencies and report on the resulting changes to both the lockfile and the project environment, but will not modify either.</p>
|
||||
</dd><dt id="uv-sync--exclude-newer"><a href="#uv-sync--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-sync--extra"><a href="#uv-sync--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-sync--exclude-newer-package"><a href="#uv-sync--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-sync--extra"><a href="#uv-sync--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May be provided more than once.</p>
|
||||
<p>When multiple extras or groups are specified that appear in <code>tool.uv.conflicts</code>, uv will report an error.</p>
|
||||
<p>Note that all optional dependencies are always included in the resolution; this option only affects the selection of packages to install.</p>
|
||||
|
|
@ -1265,7 +1280,10 @@ uv lock [OPTIONS]
|
|||
<p>In dry-run mode, uv will resolve the project's dependencies and report on the resulting changes, but will not write the lockfile to disk.</p>
|
||||
</dd><dt id="uv-lock--exclude-newer"><a href="#uv-lock--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-lock--extra-index-url"><a href="#uv-lock--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-lock--exclude-newer-package"><a href="#uv-lock--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-lock--extra-index-url"><a href="#uv-lock--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-lock--find-links"><a href="#uv-lock--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -1427,7 +1445,10 @@ uv export [OPTIONS]
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-export--exclude-newer"><a href="#uv-export--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-export--extra"><a href="#uv-export--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-export--exclude-newer-package"><a href="#uv-export--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-export--extra"><a href="#uv-export--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
|
||||
<p>May be provided more than once.</p>
|
||||
</dd><dt id="uv-export--extra-index-url"><a href="#uv-export--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
|
|
@ -1623,7 +1644,10 @@ uv tree [OPTIONS]
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-tree--exclude-newer"><a href="#uv-tree--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tree--extra-index-url"><a href="#uv-tree--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tree--exclude-newer-package"><a href="#uv-tree--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-tree--extra-index-url"><a href="#uv-tree--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-tree--find-links"><a href="#uv-tree--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -1886,7 +1910,10 @@ uv tool run [OPTIONS] [COMMAND]
|
|||
<p>Can be provided multiple times, with subsequent files overriding values defined in previous files.</p>
|
||||
<p>May also be set with the <code>UV_ENV_FILE</code> environment variable.</p></dd><dt id="uv-tool-run--exclude-newer"><a href="#uv-tool-run--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-run--extra-index-url"><a href="#uv-tool-run--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-run--exclude-newer-package"><a href="#uv-tool-run--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-tool-run--extra-index-url"><a href="#uv-tool-run--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-tool-run--find-links"><a href="#uv-tool-run--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -2058,7 +2085,10 @@ uv tool install [OPTIONS] <PACKAGE>
|
|||
</dd><dt id="uv-tool-install--editable"><a href="#uv-tool-install--editable"><code>--editable</code></a>, <code>-e</code></dt><dd><p>Install the target package in editable mode, such that changes in the package's source directory are reflected without reinstallation</p>
|
||||
</dd><dt id="uv-tool-install--exclude-newer"><a href="#uv-tool-install--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-install--extra-index-url"><a href="#uv-tool-install--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-install--exclude-newer-package"><a href="#uv-tool-install--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-tool-install--extra-index-url"><a href="#uv-tool-install--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-tool-install--find-links"><a href="#uv-tool-install--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -2222,7 +2252,10 @@ uv tool upgrade [OPTIONS] <NAME>...
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-tool-upgrade--exclude-newer"><a href="#uv-tool-upgrade--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-upgrade--extra-index-url"><a href="#uv-tool-upgrade--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-tool-upgrade--exclude-newer-package"><a href="#uv-tool-upgrade--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-tool-upgrade--extra-index-url"><a href="#uv-tool-upgrade--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-tool-upgrade--find-links"><a href="#uv-tool-upgrade--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -3377,7 +3410,10 @@ uv pip compile [OPTIONS] <SRC_FILE|--group <GROUP>>
|
|||
</dd><dt id="uv-pip-compile--emit-index-url"><a href="#uv-pip-compile--emit-index-url"><code>--emit-index-url</code></a></dt><dd><p>Include <code>--index-url</code> and <code>--extra-index-url</code> entries in the generated output file</p>
|
||||
</dd><dt id="uv-pip-compile--exclude-newer"><a href="#uv-pip-compile--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-compile--extra"><a href="#uv-pip-compile--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-compile--exclude-newer-package"><a href="#uv-pip-compile--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-pip-compile--extra"><a href="#uv-pip-compile--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>Only applies to <code>pyproject.toml</code>, <code>setup.py</code>, and <code>setup.cfg</code> sources.</p>
|
||||
</dd><dt id="uv-pip-compile--extra-index-url"><a href="#uv-pip-compile--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
|
|
@ -3680,7 +3716,10 @@ uv pip sync [OPTIONS] <SRC_FILE>...
|
|||
</dd><dt id="uv-pip-sync--dry-run"><a href="#uv-pip-sync--dry-run"><code>--dry-run</code></a></dt><dd><p>Perform a dry run, i.e., don't actually install anything but resolve the dependencies and print the resulting plan</p>
|
||||
</dd><dt id="uv-pip-sync--exclude-newer"><a href="#uv-pip-sync--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-sync--extra"><a href="#uv-pip-sync--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-sync--exclude-newer-package"><a href="#uv-pip-sync--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-pip-sync--extra"><a href="#uv-pip-sync--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>Only applies to <code>pylock.toml</code>, <code>pyproject.toml</code>, <code>setup.py</code>, and <code>setup.cfg</code> sources.</p>
|
||||
</dd><dt id="uv-pip-sync--extra-index-url"><a href="#uv-pip-sync--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
|
|
@ -3939,7 +3978,10 @@ uv pip install [OPTIONS] <PACKAGE|--requirements <REQUIREMENTS>|--editable <EDIT
|
|||
<p>By default, installing will make the minimum necessary changes to satisfy the requirements. When enabled, uv will update the environment to exactly match the requirements, removing packages that are not included in the requirements.</p>
|
||||
</dd><dt id="uv-pip-install--exclude-newer"><a href="#uv-pip-install--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-install--extra"><a href="#uv-pip-install--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-pip-install--exclude-newer-package"><a href="#uv-pip-install--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for specific packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-pip-install--extra"><a href="#uv-pip-install--extra"><code>--extra</code></a> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
|
||||
<p>Only applies to <code>pylock.toml</code>, <code>pyproject.toml</code>, <code>setup.py</code>, and <code>setup.cfg</code> sources.</p>
|
||||
</dd><dt id="uv-pip-install--extra-index-url"><a href="#uv-pip-install--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
|
|
@ -4735,7 +4777,10 @@ uv venv [OPTIONS] [PATH]
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-venv--exclude-newer"><a href="#uv-venv--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-venv--extra-index-url"><a href="#uv-venv--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-venv--exclude-newer-package"><a href="#uv-venv--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-venv--extra-index-url"><a href="#uv-venv--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-venv--find-links"><a href="#uv-venv--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
@ -4878,7 +4923,10 @@ uv build [OPTIONS] [SRC]
|
|||
<p>See <code>--project</code> to only change the project root directory.</p>
|
||||
</dd><dt id="uv-build--exclude-newer"><a href="#uv-build--exclude-newer"><code>--exclude-newer</code></a> <i>exclude-newer</i></dt><dd><p>Limit candidate packages to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-build--extra-index-url"><a href="#uv-build--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p></dd><dt id="uv-build--exclude-newer-package"><a href="#uv-build--exclude-newer-package"><code>--exclude-newer-package</code></a> <i>exclude-newer-package</i></dt><dd><p>Limit candidate packages for a specific package to those that were uploaded prior to the given date.</p>
|
||||
<p>Accepts package-date pairs in the format <code>PACKAGE=DATE</code>, where <code>DATE</code> is an RFC 3339 timestamp (e.g., <code>2006-12-02T02:07:43Z</code>) or local date (e.g., <code>2006-12-02</code>) in your system's configured time zone.</p>
|
||||
<p>Can be provided multiple times for different packages.</p>
|
||||
</dd><dt id="uv-build--extra-index-url"><a href="#uv-build--extra-index-url"><code>--extra-index-url</code></a> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
|
||||
<p>Accepts either a repository compliant with PEP 503 (the simple repository API), or a local directory laid out in the same format.</p>
|
||||
<p>All indexes provided via this flag take priority over the index specified by <code>--index-url</code> (which defaults to PyPI). When multiple <code>--extra-index-url</code> flags are provided, earlier values take priority.</p>
|
||||
<p>May also be set with the <code>UV_EXTRA_INDEX_URL</code> environment variable.</p></dd><dt id="uv-build--find-links"><a href="#uv-build--find-links"><code>--find-links</code></a>, <code>-f</code> <i>find-links</i></dt><dd><p>Locations to search for candidate distributions, in addition to those found in the registry indexes.</p>
|
||||
|
|
|
|||
|
|
@ -1137,6 +1137,32 @@ behave consistently across timezones.
|
|||
|
||||
---
|
||||
|
||||
### [`exclude-newer-package`](#exclude-newer-package) {: #exclude-newer-package }
|
||||
|
||||
Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
|
||||
Accepts package-date pairs in a dictionary format.
|
||||
|
||||
**Default value**: `None`
|
||||
|
||||
**Type**: `dict`
|
||||
|
||||
**Example usage**:
|
||||
|
||||
=== "pyproject.toml"
|
||||
|
||||
```toml
|
||||
[tool.uv]
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
```
|
||||
=== "uv.toml"
|
||||
|
||||
```toml
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### [`extra-index-url`](#extra-index-url) {: #extra-index-url }
|
||||
|
||||
Extra URLs of package indexes to use, in addition to `--index-url`.
|
||||
|
|
@ -2570,6 +2596,34 @@ behave consistently across timezones.
|
|||
|
||||
---
|
||||
|
||||
#### [`exclude-newer-package`](#pip_exclude-newer-package) {: #pip_exclude-newer-package }
|
||||
<span id="exclude-newer-package"></span>
|
||||
|
||||
Limit candidate packages for specific packages to those that were uploaded prior to the given date.
|
||||
|
||||
Accepts package-date pairs in a dictionary format.
|
||||
|
||||
**Default value**: `None`
|
||||
|
||||
**Type**: `dict`
|
||||
|
||||
**Example usage**:
|
||||
|
||||
=== "pyproject.toml"
|
||||
|
||||
```toml
|
||||
[tool.uv.pip]
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
```
|
||||
=== "uv.toml"
|
||||
|
||||
```toml
|
||||
[pip]
|
||||
exclude-newer-package = { tqdm = "2022-04-04T00:00:00Z" }
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
#### [`extra`](#pip_extra) {: #pip_extra }
|
||||
<span id="extra"></span>
|
||||
|
||||
|
|
|
|||
|
|
@ -218,7 +218,18 @@
|
|||
"description": "Limit candidate packages to those that were uploaded prior to a given point in time.\n\nAccepts a superset of [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) (e.g.,\n`2006-12-02T02:07:43Z`). A full timestamp is required to ensure that the resolver will\nbehave consistently across timezones.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ExcludeNewer"
|
||||
"$ref": "#/definitions/ExcludeNewerTimestamp"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"exclude-newer-package": {
|
||||
"description": "Limit candidate packages for specific packages to those that were uploaded prior to the given date.\n\nAccepts package-date pairs in a dictionary format.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ExcludeNewerPackage"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
|
@ -876,7 +887,13 @@
|
|||
"type": "string",
|
||||
"format": "uri"
|
||||
},
|
||||
"ExcludeNewer": {
|
||||
"ExcludeNewerPackage": {
|
||||
"type": "object",
|
||||
"additionalProperties": {
|
||||
"$ref": "#/definitions/ExcludeNewerTimestamp"
|
||||
}
|
||||
},
|
||||
"ExcludeNewerTimestamp": {
|
||||
"description": "Exclude distributions uploaded after the given timestamp.\n\nAccepts both RFC 3339 timestamps (e.g., `2006-12-02T02:07:43Z`) and local dates in the same format (e.g., `2006-12-02`).",
|
||||
"type": "string",
|
||||
"pattern": "^\\d{4}-\\d{2}-\\d{2}(T\\d{2}:\\d{2}:\\d{2}(Z|[+-]\\d{2}:\\d{2}))?$"
|
||||
|
|
@ -1295,7 +1312,18 @@
|
|||
"description": "Limit candidate packages to those that were uploaded prior to a given point in time.\n\nAccepts a superset of [RFC 3339](https://www.rfc-editor.org/rfc/rfc3339.html) (e.g.,\n`2006-12-02T02:07:43Z`). A full timestamp is required to ensure that the resolver will\nbehave consistently across timezones.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ExcludeNewer"
|
||||
"$ref": "#/definitions/ExcludeNewerTimestamp"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"exclude-newer-package": {
|
||||
"description": "Limit candidate packages for specific packages to those that were uploaded prior to the given date.\n\nAccepts package-date pairs in a dictionary format.",
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/definitions/ExcludeNewerPackage"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
|
|
|
|||
Loading…
Reference in New Issue