mirror of
https://github.com/astral-sh/uv.git
synced 2026-05-06 08:56:53 -04:00
Update Rust to v1.95.0 (#19179)
This PR contains the following updates: | Package | Update | Change | |---|---|---| | [rust](https://redirect.github.com/rust-lang/rust) | minor | `1.94.1` → `1.95.0` | --- ### Release Notes <details> <summary>rust-lang/rust (rust)</summary> ### [`v1.95.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1950-2026-04-16) [Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.94.1...1.95.0) \=========================== <a id="1.95-Language"></a> ## Language - [Stabilize `if let` guards on match arms](https://redirect.github.com/rust-lang/rust/pull/141295) - [`irrefutable_let_patterns` lint no longer lints on let chains](https://redirect.github.com/rust-lang/rust/pull/146832) - [Support importing path-segment keywords with renaming](https://redirect.github.com/rust-lang/rust/pull/146972) - [Stabilize inline assembly for PowerPC and PowerPC64](https://redirect.github.com/rust-lang/rust/pull/147996) - [const-eval: be more consistent in the behavior of padding during typed copies](https://redirect.github.com/rust-lang/rust/pull/148967) - [Const blocks are no longer evaluated to determine if expressions involving fallible operations can implicitly be constant-promoted.](https://redirect.github.com/rust-lang/rust/pull/150557). Expressions whose ability to implicitly be promoted would depend on the result of a const block are no longer implicitly promoted. - [Make operational semantics of pattern matching independent of crate and module](https://redirect.github.com/rust-lang/rust/pull/150681) <a id="1.95-Compiler"></a> ## Compiler - [Stabilize `--remap-path-scope` for controlling the scoping of how paths get remapped in the resulting binary](https://redirect.github.com/rust-lang/rust/pull/147611) - [Apply patches for CVE-2026-6042 and CVE-2026-40200 to vendored musl](https://redirect.github.com/rust-lang/rust/pull/155171) <a id="1.95-Platform-Support"></a> ## Platform Support - [Promote `powerpc64-unknown-linux-musl` to Tier 2 with host tools](https://redirect.github.com/rust-lang/rust/pull/149962) - [Promote `aarch64-apple-tvos` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) - [Promote `aarch64-apple-tvos-sim` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) - [Promote `aarch64-apple-watchos` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) - [Promote `aarch64-apple-watchos-sim` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) - [Promote `aarch64-apple-visionos` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) - [Promote `aarch64-apple-visionos-sim` to Tier 2](https://redirect.github.com/rust-lang/rust/pull/152021) Refer to Rust's [platform support page][platform-support-doc] for more information on Rust's tiered platform support. [platform-support-doc]: https://doc.rust-lang.org/rustc/platform-support.html <a id="1.95-Libraries"></a> ## Libraries - [`thread::scope`: document how join interacts with TLS destructors](https://redirect.github.com/rust-lang/rust/pull/149482) - [Speed up `str::contains` on aarch64 targets with `neon` target feature enabled by default](https://redirect.github.com/rust-lang/rust/pull/152176) <a id="1.95-Stabilized-APIs"></a> ## Stabilized APIs - [`MaybeUninit<[T; N]>: From<[MaybeUninit<T>; N]>`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-From%3CMaybeUninit%3C%5BT;+N%5D%3E%3E-for-%5BMaybeUninit%3CT%3E;+N%5D) - [`MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>; N]>`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsRef%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [`MaybeUninit<[T; N]>: AsRef<[MaybeUninit<T>]>`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsRef%3C%5BMaybeUninit%3CT%3E%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [`MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>; N]>`](https://doc.rust-lang.org/beta/std/mem/union.MaybeUninit.html#impl-AsMut%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [`MaybeUninit<[T; N]>: AsMut<[MaybeUninit<T>]>`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-AsMut%3C%5BMaybeUninit%3CT%3E%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [`[MaybeUninit<T>; N]: From<MaybeUninit<[T; N]>>`](https://doc.rust-lang.org/stable/std/mem/union.MaybeUninit.html#impl-From%3C%5BMaybeUninit%3CT%3E;+N%5D%3E-for-MaybeUninit%3C%5BT;+N%5D%3E) - [`Cell<[T; N]>: AsRef<[Cell<T>; N]>`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E;+N%5D%3E-for-Cell%3C%5BT;+N%5D%3E) - [`Cell<[T; N]>: AsRef<[Cell<T>]>`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E%5D%3E-for-Cell%3C%5BT;+N%5D%3E) - [`Cell<[T]>: AsRef<[Cell<T>]>`](https://doc.rust-lang.org/stable/std/cell/struct.Cell.html#impl-AsRef%3C%5BCell%3CT%3E%5D%3E-for-Cell%3C%5BT%5D%3E) - [`bool: TryFrom<{integer}>`](https://doc.rust-lang.org/stable/std/primitive.bool.html#impl-TryFrom%3Cu128%3E-for-bool) - [`AtomicPtr::update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.update) - [`AtomicPtr::try_update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicPtr.html#method.try_update) - [`AtomicBool::update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicBool.html#method.update) - [`AtomicBool::try_update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicBool.html#method.try_update) - [`AtomicIn::update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicIsize.html#method.update) - [`AtomicIn::try_update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicIsize.html#method.try_update) - [`AtomicUn::update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicUsize.html#method.update) - [`AtomicUn::try_update`](https://doc.rust-lang.org/stable/std/sync/atomic/struct.AtomicUsize.html#method.try_update) - [`cfg_select!`](https://doc.rust-lang.org/stable/std/macro.cfg_select.html) - [`mod core::range`](https://doc.rust-lang.org/stable/core/range/index.html) - [`core::range::RangeInclusive`](https://doc.rust-lang.org/stable/core/range/struct.RangeInclusive.html) - [`core::range::RangeInclusiveIter`](https://doc.rust-lang.org/stable/core/range/struct.RangeInclusiveIter.html) - [`core::hint::cold_path`](https://doc.rust-lang.org/stable/core/hint/fn.cold_path.html) - [`<*const T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked) - [`<*mut T>::as_ref_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_ref_unchecked-1) - [`<*mut T>::as_mut_unchecked`](https://doc.rust-lang.org/stable/std/primitive.pointer.html#method.as_mut_unchecked) - [`Vec::push_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.push_mut) - [`Vec::insert_mut`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#method.insert_mut) - [`VecDeque::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_front_mut) - [`VecDeque::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.push_back_mut) - [`VecDeque::insert_mut`](https://doc.rust-lang.org/stable/std/collections/struct.VecDeque.html#method.insert_mut) - [`LinkedList::push_front_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_front_mut) - [`LinkedList::push_back_mut`](https://doc.rust-lang.org/stable/std/collections/struct.LinkedList.html#method.push_back_mut) - [`Layout::dangling_ptr`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.dangling_ptr) - [`Layout::repeat`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat) - [`Layout::repeat_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.repeat_packed) - [`Layout::extend_packed`](https://doc.rust-lang.org/stable/std/alloc/struct.Layout.html#method.extend_packed) These previously stable APIs are now stable in const contexts: - [`fmt::from_fn`](https://doc.rust-lang.org/stable/std/fmt/fn.from_fn.html) - [`ControlFlow::is_break`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_break) - [`ControlFlow::is_continue`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.is_continue) <a id="1.95-Rustdoc"></a> ## Rustdoc - [In search results, rank unstable items lower](https://redirect.github.com/rust-lang/rust/pull/149460) - [Add new "hide deprecated items" setting in rustdoc](https://redirect.github.com/rust-lang/rust/pull/151091) <a id="1.95-Compatibility-Notes"></a> ## Compatibility Notes - [Array coercions may now result in less inference constraints than before](https://redirect.github.com/rust-lang/rust/pull/140283) - Importing `$crate` without renaming, i.e. `use $crate::{self};`, is now no longer permitted due to stricter error checking for `self` imports. - [const-eval: be more consistent in the behavior of padding during typed copies.](https://redirect.github.com/rust-lang/rust/pull/148967) In very rare cases, this may cause compilation errors due to bytes from parts of a pointer ending up in the padding bytes of a `const` or `static`. - [A future-incompatibility warning lint `ambiguous_glob_imported_traits` is now reported when using an ambiguously glob imported trait](https://redirect.github.com/rust-lang/rust/pull/149058) - [Check lifetime bounds of types mentioning only type parameters](https://redirect.github.com/rust-lang/rust/pull/149389) - [Report more visibility-related ambiguous import errors](https://redirect.github.com/rust-lang/rust/pull/149596) - [Deprecate `Eq::assert_receiver_is_total_eq` and emit future compatibility warnings on manual impls](https://redirect.github.com/rust-lang/rust/pull/149978) - [powerpc64: Use the ELF ABI version set in target spec instead of guessing](https://redirect.github.com/rust-lang/rust/pull/150468) (fixes the ELF ABI used by the OpenBSD target) - Matching on a `#[non_exhaustive]` enum [now reads the discriminant, even if the enum has only one variant](https://redirect.github.com/rust-lang/rust/pull/150681). This can cause closures to capture values that they previously wouldn't. - `mut ref` and `mut ref mut` patterns, part of the unstable [Match Ergonomics 2024 RFC](https://redirect.github.com/rust-lang/rust/issues/123076), were accidentally allowed on stable within struct pattern field shorthand. These patterns are now correctly feature-gated as unstable in this position. - [Add future-compatibility warning for derive helper attributes which conflict with built-in attributes](https://redirect.github.com/rust-lang/rust/pull/151152) - [JSON target specs](https://doc.rust-lang.org/rustc/targets/custom.html) have been destabilized and now require `-Z unstable-options` to use. Previously, they could not be used without the standard library, which has no stable build mechanism. In preparation for the `build-std` project adding that support, JSON target specs are being proactively gated to ensure they remain unstable even if `build-std` is stabilized. Cargo now includes the `-Z json-target-spec` CLI flag to automatically pass `-Z unstable-options` to the compiler when needed. See [#​150151](https://redirect.github.com/rust-lang/rust/pull/150151), [#​151534](https://redirect.github.com/rust-lang/rust/pull/150151), and [rust-lang/cargo#16557](https://redirect.github.com/rust-lang/cargo/pull/16557). - [The arguments of `#[feature]` attributes on invalid targets are now checked](https://redirect.github.com/rust-lang/rust/issues/153764) <a id="1.95-Internal-Changes"></a> ## Internal Changes These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools. - [Update to LLVM 22](https://redirect.github.com/rust-lang/rust/pull/150722) </details> --- ### Configuration 📅 **Schedule**: (UTC) - Branch creation - Between 12:00 AM and 03:59 AM, only on Monday (`* 0-3 * * 1`) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/astral-sh/uv). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4xNDEuMyIsInVwZGF0ZWRJblZlciI6IjQzLjE0MS4zIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJidWlsZDpza2lwLWRvY2tlciIsImJ1aWxkOnNraXAtcmVsZWFzZSIsImludGVybmFsIl19--> --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Zanie Blue <contact@zanie.dev>
This commit is contained in:
@@ -185,9 +185,7 @@ impl CredentialsCache {
|
|||||||
|
|
||||||
// If we only have a username, add a new entry or replace an existing entry if it doesn't have a password
|
// If we only have a username, add a new entry or replace an existing entry if it doesn't have a password
|
||||||
let existing = realms.get(&key);
|
let existing = realms.get(&key);
|
||||||
if existing.is_none()
|
if existing.is_none_or(|credentials| credentials.password().is_none()) {
|
||||||
|| existing.is_some_and(|credentials| credentials.password().is_none())
|
|
||||||
{
|
|
||||||
return realms.insert(key, credentials.clone());
|
return realms.insert(key, credentials.clone());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -168,16 +168,17 @@ pub fn check_direct_build(
|
|||||||
// We can't validate the url.
|
// We can't validate the url.
|
||||||
return Err(DirectBuildIncompatibility::UrlRequirement);
|
return Err(DirectBuildIncompatibility::UrlRequirement);
|
||||||
}
|
}
|
||||||
Some(VersionOrUrl::VersionSpecifier(specifier)) => {
|
Some(VersionOrUrl::VersionSpecifier(specifier))
|
||||||
// If the user doesn't set an upper bound, we don't help them by not using the fast
|
// If the user doesn't set an upper bound, we don't help them by not using the fast
|
||||||
// path, their build may equally fail if the index version of `uv_build`, so we allow
|
// path, their build may equally fail if the index version of `uv_build`, so we allow
|
||||||
// missing upper bounds.
|
// missing upper bounds.
|
||||||
if !compatible.iter().any(|version| specifier.contains(version)) {
|
if !compatible.iter().any(|version| specifier.contains(version)) =>
|
||||||
return Err(DirectBuildIncompatibility::IncompatibleRange(
|
{
|
||||||
specifier.clone(),
|
return Err(DirectBuildIncompatibility::IncompatibleRange(
|
||||||
));
|
specifier.clone(),
|
||||||
}
|
));
|
||||||
}
|
}
|
||||||
|
Some(VersionOrUrl::VersionSpecifier(_)) => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.94.1"
|
channel = "1.95.0"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use quote::{quote, quote_spanned};
|
|||||||
use syn::spanned::Spanned;
|
use syn::spanned::Spanned;
|
||||||
use syn::{Attribute, DeriveInput, ImplItem, ItemImpl, LitStr, parse_macro_input};
|
use syn::{Attribute, DeriveInput, ImplItem, ItemImpl, LitStr, parse_macro_input};
|
||||||
|
|
||||||
#[proc_macro_derive(OptionsMetadata, attributes(option, doc, option_group))]
|
#[proc_macro_derive(OptionsMetadata, attributes(option, option_group))]
|
||||||
pub fn derive_options_metadata(input: TokenStream) -> TokenStream {
|
pub fn derive_options_metadata(input: TokenStream) -> TokenStream {
|
||||||
let input = parse_macro_input!(input as DeriveInput);
|
let input = parse_macro_input!(input as DeriveInput);
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ impl Conflicts {
|
|||||||
graph
|
graph
|
||||||
.node_weight_mut(neighbor_idx)
|
.node_weight_mut(neighbor_idx)
|
||||||
.expect("Graph node should have weight")
|
.expect("Graph node should have weight")
|
||||||
.extend(neighbor_canonical_items.into_iter());
|
.extend(neighbor_canonical_items);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,7 +197,7 @@ impl Conflicts {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
conflict_sets.extend(new_conflict_sets.into_iter());
|
conflict_sets.extend(new_conflict_sets);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add all newly discovered conflict sets (excluding the originals already in self.0)
|
// Add all newly discovered conflict sets (excluding the originals already in self.0)
|
||||||
|
|||||||
@@ -87,12 +87,10 @@ impl<'de> Deserialize<'de> for PypiFile {
|
|||||||
|
|
||||||
while let Some(key) = access.next_key::<Cow<'_, str>>()? {
|
while let Some(key) = access.next_key::<Cow<'_, str>>()? {
|
||||||
match &*key {
|
match &*key {
|
||||||
"core-metadata" | "dist-info-metadata" | "data-dist-info-metadata" => {
|
"core-metadata" | "dist-info-metadata" | "data-dist-info-metadata"
|
||||||
if core_metadata.is_none() {
|
if core_metadata.is_none() =>
|
||||||
core_metadata = access.next_value()?;
|
{
|
||||||
} else {
|
core_metadata = access.next_value()?;
|
||||||
let _: serde::de::IgnoredAny = access.next_value()?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"filename" => filename = Some(access.next_value()?),
|
"filename" => filename = Some(access.next_value()?),
|
||||||
"hashes" => hashes = Some(access.next_value()?),
|
"hashes" => hashes = Some(access.next_value()?),
|
||||||
@@ -190,12 +188,10 @@ impl<'de> Deserialize<'de> for PyxFile {
|
|||||||
|
|
||||||
while let Some(key) = access.next_key::<Cow<'_, str>>()? {
|
while let Some(key) = access.next_key::<Cow<'_, str>>()? {
|
||||||
match &*key {
|
match &*key {
|
||||||
"core-metadata" | "dist-info-metadata" | "data-dist-info-metadata" => {
|
"core-metadata" | "dist-info-metadata" | "data-dist-info-metadata"
|
||||||
if core_metadata.is_none() {
|
if core_metadata.is_none() =>
|
||||||
core_metadata = access.next_value()?;
|
{
|
||||||
} else {
|
core_metadata = access.next_value()?;
|
||||||
let _: serde::de::IgnoredAny = access.next_value()?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
"filename" => filename = Some(access.next_value()?),
|
"filename" => filename = Some(access.next_value()?),
|
||||||
"hashes" => hashes = Some(access.next_value()?),
|
"hashes" => hashes = Some(access.next_value()?),
|
||||||
|
|||||||
@@ -658,7 +658,7 @@ impl RequirementsSpecification {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
spec.excludes.extend(source.excludes.into_iter());
|
spec.excludes.extend(source.excludes);
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(spec)
|
Ok(spec)
|
||||||
|
|||||||
@@ -968,26 +968,23 @@ fn collapse_unavailable_versions(
|
|||||||
other_versions,
|
other_versions,
|
||||||
other_reason,
|
other_reason,
|
||||||
)),
|
)),
|
||||||
) => {
|
) if package == other_package && reason == other_reason => {
|
||||||
// And the package and reason are the same...
|
// Collapse both into a new node, with a union of their ranges
|
||||||
if package == other_package && reason == other_reason {
|
let versions = other_versions.union(versions);
|
||||||
// Collapse both into a new node, with a union of their ranges
|
let mut terms = terms.clone();
|
||||||
let versions = other_versions.union(versions);
|
if let Some(Term::Positive(range)) = terms.get_mut(package) {
|
||||||
let mut terms = terms.clone();
|
*range = versions.clone();
|
||||||
if let Some(Term::Positive(range)) = terms.get_mut(package) {
|
|
||||||
*range = versions.clone();
|
|
||||||
}
|
|
||||||
*tree = DerivationTree::Derived(Derived {
|
|
||||||
terms,
|
|
||||||
shared_id: *shared_id,
|
|
||||||
cause1: cause1.clone(),
|
|
||||||
cause2: Arc::new(DerivationTree::External(External::Custom(
|
|
||||||
package.clone(),
|
|
||||||
versions,
|
|
||||||
reason.clone(),
|
|
||||||
))),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
*tree = DerivationTree::Derived(Derived {
|
||||||
|
terms,
|
||||||
|
shared_id: *shared_id,
|
||||||
|
cause1: cause1.clone(),
|
||||||
|
cause2: Arc::new(DerivationTree::External(External::Custom(
|
||||||
|
package.clone(),
|
||||||
|
versions,
|
||||||
|
reason.clone(),
|
||||||
|
))),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
(
|
(
|
||||||
DerivationTree::External(External::Custom(
|
DerivationTree::External(External::Custom(
|
||||||
@@ -996,26 +993,23 @@ fn collapse_unavailable_versions(
|
|||||||
other_reason,
|
other_reason,
|
||||||
)),
|
)),
|
||||||
_,
|
_,
|
||||||
) => {
|
) if package == other_package && reason == other_reason => {
|
||||||
// And the package and reason are the same...
|
// Collapse both into a new node, with a union of their ranges
|
||||||
if package == other_package && reason == other_reason {
|
let versions = other_versions.union(versions);
|
||||||
// Collapse both into a new node, with a union of their ranges
|
let mut terms = terms.clone();
|
||||||
let versions = other_versions.union(versions);
|
if let Some(Term::Positive(range)) = terms.get_mut(package) {
|
||||||
let mut terms = terms.clone();
|
*range = versions.clone();
|
||||||
if let Some(Term::Positive(range)) = terms.get_mut(package) {
|
|
||||||
*range = versions.clone();
|
|
||||||
}
|
|
||||||
*tree = DerivationTree::Derived(Derived {
|
|
||||||
terms,
|
|
||||||
shared_id: *shared_id,
|
|
||||||
cause1: Arc::new(DerivationTree::External(External::Custom(
|
|
||||||
package.clone(),
|
|
||||||
versions,
|
|
||||||
reason.clone(),
|
|
||||||
))),
|
|
||||||
cause2: cause2.clone(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
*tree = DerivationTree::Derived(Derived {
|
||||||
|
terms,
|
||||||
|
shared_id: *shared_id,
|
||||||
|
cause1: Arc::new(DerivationTree::External(External::Custom(
|
||||||
|
package.clone(),
|
||||||
|
versions,
|
||||||
|
reason.clone(),
|
||||||
|
))),
|
||||||
|
cause2: cause2.clone(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -177,7 +177,7 @@ impl ReportFormatter<PubGrubPackage, Range<Version>, UnavailableReason>
|
|||||||
let mut terms_vec: Vec<_> = terms.iter().collect();
|
let mut terms_vec: Vec<_> = terms.iter().collect();
|
||||||
// We avoid relying on hashmap iteration order here by always sorting
|
// We avoid relying on hashmap iteration order here by always sorting
|
||||||
// by package first.
|
// by package first.
|
||||||
terms_vec.sort_by(|&(pkg1, _), &(pkg2, _)| pkg1.cmp(pkg2));
|
terms_vec.sort_by_key(|&(package, _)| package);
|
||||||
match terms_vec.as_slice() {
|
match terms_vec.as_slice() {
|
||||||
[] => "the requirements are unsatisfiable".into(),
|
[] => "the requirements are unsatisfiable".into(),
|
||||||
[(root, _)] if matches!(&**(*root), PubGrubPackageInner::Root(_)) => {
|
[(root, _)] if matches!(&**(*root), PubGrubPackageInner::Root(_)) => {
|
||||||
@@ -515,7 +515,7 @@ impl PubGrubReportFormatter<'_> {
|
|||||||
let external1 = self.format_external(external1);
|
let external1 = self.format_external(external1);
|
||||||
let external2 = self.format_external(external2);
|
let external2 = self.format_external(external2);
|
||||||
|
|
||||||
format!("{}and {}", padded("", &external1, " "), &external2,)
|
format!("{}and {}", padded("", &external1, " "), &external2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1016,11 +1016,10 @@ impl PubGrubReportFormatter<'_> {
|
|||||||
|
|
||||||
// Add hints due to the package being entirely unavailable.
|
// Add hints due to the package being entirely unavailable.
|
||||||
match unavailable_packages.get(name) {
|
match unavailable_packages.get(name) {
|
||||||
Some(UnavailablePackage::NoIndex) => {
|
Some(UnavailablePackage::NoIndex) if no_find_links => {
|
||||||
if no_find_links {
|
hints.insert(PubGrubHint::NoIndex);
|
||||||
hints.insert(PubGrubHint::NoIndex);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Some(UnavailablePackage::NoIndex) => {}
|
||||||
Some(UnavailablePackage::Offline) => {
|
Some(UnavailablePackage::Offline) => {
|
||||||
hints.insert(PubGrubHint::Offline);
|
hints.insert(PubGrubHint::Offline);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,8 +55,8 @@ impl<'dist> RequirementsTxtDist<'dist> {
|
|||||||
Some(Scheme::File) => {
|
Some(Scheme::File) => {
|
||||||
if path
|
if path
|
||||||
.strip_prefix("//localhost")
|
.strip_prefix("//localhost")
|
||||||
.filter(|path| path.starts_with('/'))
|
.as_ref()
|
||||||
.is_some()
|
.is_some_and(|path| path.starts_with('/'))
|
||||||
{
|
{
|
||||||
// Always absolute; nothing to do.
|
// Always absolute; nothing to do.
|
||||||
None
|
None
|
||||||
|
|||||||
@@ -919,8 +919,8 @@ impl Workspace {
|
|||||||
)?;
|
)?;
|
||||||
|
|
||||||
let dev_dependencies_members = workspace_members
|
let dev_dependencies_members = workspace_members
|
||||||
.iter()
|
.values()
|
||||||
.filter_map(|(_, member)| {
|
.filter_map(|member| {
|
||||||
member
|
member
|
||||||
.pyproject_toml
|
.pyproject_toml
|
||||||
.tool
|
.tool
|
||||||
|
|||||||
@@ -148,10 +148,8 @@ impl LatestClient<'_> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match (latest.as_ref(), best) {
|
match (latest.as_ref(), best) {
|
||||||
(Some(current), Some(best)) => {
|
(Some(current), Some(best)) if best.version() > current.version() => {
|
||||||
if best.version() > current.version() {
|
latest = Some(best);
|
||||||
latest = Some(best);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
(None, Some(best)) => {
|
(None, Some(best)) => {
|
||||||
latest = Some(best);
|
latest = Some(best);
|
||||||
|
|||||||
@@ -462,14 +462,14 @@ async fn init_project(
|
|||||||
if let Some(python_request) = python_pin {
|
if let Some(python_request) = python_pin {
|
||||||
if PythonVersionFile::discover(path, &VersionFileDiscoveryOptions::default())
|
if PythonVersionFile::discover(path, &VersionFileDiscoveryOptions::default())
|
||||||
.await?
|
.await?
|
||||||
.filter(|file| {
|
.as_ref()
|
||||||
|
.is_none_or(|file| !{
|
||||||
file.version()
|
file.version()
|
||||||
.is_some_and(|version| *version == python_request)
|
.is_some_and(|version| *version == python_request)
|
||||||
&& file.path().parent().is_some_and(|parent| {
|
&& file.path().parent().is_some_and(|parent| {
|
||||||
parent == workspace.install_path() || parent == path
|
parent == workspace.install_path() || parent == path
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.is_none()
|
|
||||||
{
|
{
|
||||||
PythonVersionFile::new(path.join(".python-version"))
|
PythonVersionFile::new(path.join(".python-version"))
|
||||||
.with_versions(vec![python_request.clone()])
|
.with_versions(vec![python_request.clone()])
|
||||||
@@ -483,8 +483,8 @@ async fn init_project(
|
|||||||
if PythonVersionFile::discover(path, &VersionFileDiscoveryOptions::default())
|
if PythonVersionFile::discover(path, &VersionFileDiscoveryOptions::default())
|
||||||
.await?
|
.await?
|
||||||
.filter(|file| file.version().is_some())
|
.filter(|file| file.version().is_some())
|
||||||
.filter(|file| file.path().parent().is_some_and(|parent| parent == path))
|
.as_ref()
|
||||||
.is_none()
|
.is_none_or(|file| file.path().parent().is_none_or(|parent| parent != path))
|
||||||
{
|
{
|
||||||
PythonVersionFile::new(path.join(".python-version"))
|
PythonVersionFile::new(path.join(".python-version"))
|
||||||
.with_versions(vec![python_request.clone()])
|
.with_versions(vec![python_request.clone()])
|
||||||
|
|||||||
@@ -145,10 +145,8 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl
|
|||||||
RequirementsSource::SetupCfg(_) => {
|
RequirementsSource::SetupCfg(_) => {
|
||||||
bail!("Adding requirements from a `setup.cfg` is not supported in `uv run`");
|
bail!("Adding requirements from a `setup.cfg` is not supported in `uv run`");
|
||||||
}
|
}
|
||||||
RequirementsSource::Extensionless(path) => {
|
RequirementsSource::Extensionless(path) if path == Path::new("-") => {
|
||||||
if path == Path::new("-") {
|
requirements_from_stdin = true;
|
||||||
requirements_from_stdin = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
@@ -1305,20 +1303,14 @@ hint: If you are running a script with `{}` in the shebang, you may need to incl
|
|||||||
.as_ref()
|
.as_ref()
|
||||||
.map(PythonEnvironment::scripts)
|
.map(PythonEnvironment::scripts)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(
|
.chain(requirements_env.as_ref().map(PythonEnvironment::scripts))
|
||||||
requirements_env
|
|
||||||
.as_ref()
|
|
||||||
.map(PythonEnvironment::scripts)
|
|
||||||
.into_iter(),
|
|
||||||
)
|
|
||||||
.chain(std::iter::once(base_interpreter.scripts()))
|
.chain(std::iter::once(base_interpreter.scripts()))
|
||||||
.chain(
|
.chain(
|
||||||
// On Windows, non-virtual Python distributions put `python.exe` in the top-level
|
// On Windows, non-virtual Python distributions put `python.exe` in the top-level
|
||||||
// directory, rather than in the `Scripts` subdirectory.
|
// directory, rather than in the `Scripts` subdirectory.
|
||||||
cfg!(windows)
|
cfg!(windows)
|
||||||
.then(|| base_interpreter.sys_executable().parent())
|
.then(|| base_interpreter.sys_executable().parent())
|
||||||
.flatten()
|
.flatten(),
|
||||||
.into_iter(),
|
|
||||||
)
|
)
|
||||||
.dedup()
|
.dedup()
|
||||||
.map(PathBuf::from)
|
.map(PathBuf::from)
|
||||||
|
|||||||
@@ -558,7 +558,7 @@ pub(crate) async fn install(
|
|||||||
constraints: constraints
|
constraints: constraints
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.chain(latest.into_iter())
|
.chain(latest)
|
||||||
.map(NameRequirementSpecification::from)
|
.map(NameRequirementSpecification::from)
|
||||||
.collect(),
|
.collect(),
|
||||||
overrides: overrides
|
overrides: overrides
|
||||||
|
|||||||
@@ -1110,7 +1110,7 @@ async fn get_or_create_environment(
|
|||||||
.collect(),
|
.collect(),
|
||||||
constraints: constraints
|
constraints: constraints
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.chain(latest.into_iter())
|
.chain(latest)
|
||||||
.map(NameRequirementSpecification::from)
|
.map(NameRequirementSpecification::from)
|
||||||
.collect(),
|
.collect(),
|
||||||
overrides: overrides
|
overrides: overrides
|
||||||
|
|||||||
@@ -163,17 +163,17 @@ pub(crate) fn resolve_color(args: &GlobalArgs) -> ColorChoice {
|
|||||||
// If `--no-color` is passed explicitly, disable color output.
|
// If `--no-color` is passed explicitly, disable color output.
|
||||||
ColorChoice::Never
|
ColorChoice::Never
|
||||||
} else if std::env::var_os(EnvVars::NO_COLOR)
|
} else if std::env::var_os(EnvVars::NO_COLOR)
|
||||||
.filter(|v| !v.is_empty())
|
.as_ref()
|
||||||
.is_some()
|
.is_some_and(|v| !v.is_empty())
|
||||||
{
|
{
|
||||||
// If the `NO_COLOR` is set, disable color output.
|
// If the `NO_COLOR` is set, disable color output.
|
||||||
ColorChoice::Never
|
ColorChoice::Never
|
||||||
} else if std::env::var_os(EnvVars::FORCE_COLOR)
|
} else if std::env::var_os(EnvVars::FORCE_COLOR)
|
||||||
.filter(|v| !v.is_empty())
|
.as_ref()
|
||||||
.is_some()
|
.is_some_and(|v| !v.is_empty())
|
||||||
|| std::env::var_os(EnvVars::CLICOLOR_FORCE)
|
|| std::env::var_os(EnvVars::CLICOLOR_FORCE)
|
||||||
.filter(|v| !v.is_empty())
|
.as_ref()
|
||||||
.is_some()
|
.is_some_and(|v| !v.is_empty())
|
||||||
{
|
{
|
||||||
// If `FORCE_COLOR` or `CLICOLOR_FORCE` is set, always enable color output.
|
// If `FORCE_COLOR` or `CLICOLOR_FORCE` is set, always enable color output.
|
||||||
ColorChoice::Always
|
ColorChoice::Always
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ async fn time_out_response(
|
|||||||
let (tx, rx) = tokio::sync::mpsc::channel(1);
|
let (tx, rx) = tokio::sync::mpsc::channel(1);
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let _ = tx.send(Ok(Frame::data(Bytes::new()))).await;
|
let _ = tx.send(Ok(Frame::data(Bytes::new()))).await;
|
||||||
tokio::time::sleep(Duration::from_secs(60)).await;
|
tokio::time::sleep(Duration::from_mins(1)).await;
|
||||||
});
|
});
|
||||||
let body = StreamBody::new(ReceiverStream::new(rx)).boxed();
|
let body = StreamBody::new(ReceiverStream::new(rx)).boxed();
|
||||||
Ok(hyper::Response::builder()
|
Ok(hyper::Response::builder()
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.94.1"
|
channel = "1.95.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user