mirror of
https://github.com/astral-sh/uv.git
synced 2025-09-27 12:39:09 +00:00
Upgrade Rust toolchain to 1.84.0 (#10533)
Some checks are pending
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on linux (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86_64 (push) Blocked by required conditions
CI / check system | python3.10 on windows (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on linux (push) Blocked by required conditions
CI / check system | conda3.8 on linux (push) Blocked by required conditions
CI / check system | conda3.11 on macos (push) Blocked by required conditions
CI / check system | conda3.8 on macos (push) Blocked by required conditions
CI / check system | conda3.11 on windows (push) Blocked by required conditions
CI / check system | conda3.8 on windows (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
Some checks are pending
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on linux (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | alpine (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86_64 (push) Blocked by required conditions
CI / check system | python3.10 on windows (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on linux (push) Blocked by required conditions
CI / check system | conda3.8 on linux (push) Blocked by required conditions
CI / check system | conda3.11 on macos (push) Blocked by required conditions
CI / check system | conda3.8 on macos (push) Blocked by required conditions
CI / check system | conda3.11 on windows (push) Blocked by required conditions
CI / check system | conda3.8 on windows (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
## Summary Upgrade the rust toolchain to 1.84.0. This PR does not bump the MSRV.
This commit is contained in:
parent
051aaa5fe5
commit
4d3809cc6b
27 changed files with 65 additions and 64 deletions
|
@ -225,6 +225,9 @@ rc_mutex = "warn"
|
||||||
rest_pat_in_fully_bound_structs = "warn"
|
rest_pat_in_fully_bound_structs = "warn"
|
||||||
if_not_else = "allow"
|
if_not_else = "allow"
|
||||||
|
|
||||||
|
# Diagnostics are not actionable: Enable once https://github.com/rust-lang/rust-clippy/issues/13774 is resolved.
|
||||||
|
large_stack_arrays = "allow"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
strip = true
|
strip = true
|
||||||
lto = "fat"
|
lto = "fat"
|
||||||
|
|
|
@ -741,7 +741,7 @@ mod tests {
|
||||||
let mut netrc_file = NamedTempFile::new()?;
|
let mut netrc_file = NamedTempFile::new()?;
|
||||||
writeln!(
|
writeln!(
|
||||||
netrc_file,
|
netrc_file,
|
||||||
r#"machine {} login {username} password {password}"#,
|
r"machine {} login {username} password {password}",
|
||||||
base_url.host_str().unwrap()
|
base_url.host_str().unwrap()
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
@ -788,7 +788,7 @@ mod tests {
|
||||||
let mut netrc_file = NamedTempFile::new()?;
|
let mut netrc_file = NamedTempFile::new()?;
|
||||||
writeln!(
|
writeln!(
|
||||||
netrc_file,
|
netrc_file,
|
||||||
r#"machine example.com login {username} password {password}"#,
|
r"machine example.com login {username} password {password}",
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
let client = test_client_builder()
|
let client = test_client_builder()
|
||||||
|
@ -829,7 +829,7 @@ mod tests {
|
||||||
let mut netrc_file = NamedTempFile::new()?;
|
let mut netrc_file = NamedTempFile::new()?;
|
||||||
writeln!(
|
writeln!(
|
||||||
netrc_file,
|
netrc_file,
|
||||||
r#"machine {} login {username} password {password}"#,
|
r"machine {} login {username} password {password}",
|
||||||
base_url.host_str().unwrap()
|
base_url.host_str().unwrap()
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
|
|
|
@ -292,7 +292,7 @@ impl DevGroupsSpecification {
|
||||||
|
|
||||||
self.groups
|
self.groups
|
||||||
.as_ref()
|
.as_ref()
|
||||||
.map_or(false, |groups| groups.contains(group))
|
.is_some_and(|groups| groups.contains(group))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,7 +163,7 @@ impl<'a> BuildDispatch<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(refining_impl_trait)]
|
#[allow(refining_impl_trait)]
|
||||||
impl<'a> BuildContext for BuildDispatch<'a> {
|
impl BuildContext for BuildDispatch<'_> {
|
||||||
type SourceDistBuilder = SourceBuild;
|
type SourceDistBuilder = SourceBuild;
|
||||||
|
|
||||||
fn interpreter(&self) -> &Interpreter {
|
fn interpreter(&self) -> &Interpreter {
|
||||||
|
|
|
@ -139,8 +139,8 @@ pub async fn unzip<R: tokio::io::AsyncRead + Unpin>(
|
||||||
/// Unpack the given tar archive into the destination directory.
|
/// Unpack the given tar archive into the destination directory.
|
||||||
///
|
///
|
||||||
/// This is equivalent to `archive.unpack_in(dst)`, but it also preserves the executable bit.
|
/// This is equivalent to `archive.unpack_in(dst)`, but it also preserves the executable bit.
|
||||||
async fn untar_in<'a>(
|
async fn untar_in(
|
||||||
mut archive: tokio_tar::Archive<&'a mut (dyn tokio::io::AsyncRead + Unpin)>,
|
mut archive: tokio_tar::Archive<&'_ mut (dyn tokio::io::AsyncRead + Unpin)>,
|
||||||
dst: &Path,
|
dst: &Path,
|
||||||
) -> std::io::Result<()> {
|
) -> std::io::Result<()> {
|
||||||
let mut entries = archive.entries()?;
|
let mut entries = archive.entries()?;
|
||||||
|
|
|
@ -516,7 +516,7 @@ pub fn is_temporary(path: impl AsRef<Path>) -> bool {
|
||||||
path.as_ref()
|
path.as_ref()
|
||||||
.file_name()
|
.file_name()
|
||||||
.and_then(|name| name.to_str())
|
.and_then(|name| name.to_str())
|
||||||
.map_or(false, |name| name.starts_with(".tmp"))
|
.is_some_and(|name| name.starts_with(".tmp"))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A file lock that is automatically released when dropped.
|
/// A file lock that is automatically released when dropped.
|
||||||
|
@ -588,7 +588,7 @@ impl LockedFile {
|
||||||
|
|
||||||
impl Drop for LockedFile {
|
impl Drop for LockedFile {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
if let Err(err) = self.0.file().unlock() {
|
if let Err(err) = fs2::FileExt::unlock(self.0.file()) {
|
||||||
error!(
|
error!(
|
||||||
"Failed to unlock {}; program may be stuck: {}",
|
"Failed to unlock {}; program may be stuck: {}",
|
||||||
self.0.path().display(),
|
self.0.path().display(),
|
||||||
|
|
|
@ -34,7 +34,7 @@ fn get_script_launcher(entry_point: &Script, shebang: &str) -> String {
|
||||||
let import_name = entry_point.import_name();
|
let import_name = entry_point.import_name();
|
||||||
|
|
||||||
format!(
|
format!(
|
||||||
r##"{shebang}
|
r#"{shebang}
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -42,7 +42,7 @@ from {module} import {import_name}
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
||||||
sys.exit({function}())
|
sys.exit({function}())
|
||||||
"##
|
"#
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -930,12 +930,12 @@ fn parse_pep508_requirement<T: Pep508Url>(
|
||||||
if let Some((pos, char)) = cursor.next().filter(|(_, c)| *c != '#') {
|
if let Some((pos, char)) = cursor.next().filter(|(_, c)| *c != '#') {
|
||||||
let message = if char == '#' {
|
let message = if char == '#' {
|
||||||
format!(
|
format!(
|
||||||
r#"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"#
|
r"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"
|
||||||
)
|
)
|
||||||
} else if marker.is_none() {
|
} else if marker.is_none() {
|
||||||
format!(r#"Expected end of input or `;`, found `{char}`"#)
|
format!(r"Expected end of input or `;`, found `{char}`")
|
||||||
} else {
|
} else {
|
||||||
format!(r#"Expected end of input, found `{char}`"#)
|
format!(r"Expected end of input, found `{char}`")
|
||||||
};
|
};
|
||||||
return Err(Pep508Error {
|
return Err(Pep508Error {
|
||||||
message: Pep508ErrorSource::String(message),
|
message: Pep508ErrorSource::String(message),
|
||||||
|
|
|
@ -176,12 +176,12 @@ fn parse_unnamed_requirement<Url: UnnamedRequirementUrl>(
|
||||||
if let Some((pos, char)) = cursor.next() {
|
if let Some((pos, char)) = cursor.next() {
|
||||||
let message = if char == '#' {
|
let message = if char == '#' {
|
||||||
format!(
|
format!(
|
||||||
r#"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"#
|
r"Expected end of input or `;`, found `{char}`; comments must be preceded by a leading space"
|
||||||
)
|
)
|
||||||
} else if marker.is_none() {
|
} else if marker.is_none() {
|
||||||
format!(r#"Expected end of input or `;`, found `{char}`"#)
|
format!(r"Expected end of input or `;`, found `{char}`")
|
||||||
} else {
|
} else {
|
||||||
format!(r#"Expected end of input, found `{char}`"#)
|
format!(r"Expected end of input, found `{char}`")
|
||||||
};
|
};
|
||||||
return Err(Pep508Error {
|
return Err(Pep508Error {
|
||||||
message: Pep508ErrorSource::String(message),
|
message: Pep508ErrorSource::String(message),
|
||||||
|
|
|
@ -406,7 +406,7 @@ pub fn looks_like_git_repository(url: &Url) -> bool {
|
||||||
.map_or(true, |ext| ext.eq_ignore_ascii_case("git"))
|
.map_or(true, |ext| ext.eq_ignore_ascii_case("git"))
|
||||||
&& url
|
&& url
|
||||||
.path_segments()
|
.path_segments()
|
||||||
.map_or(false, |segments| segments.count() == 2)
|
.is_some_and(|segments| segments.count() == 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Split the fragment from a URL.
|
/// Split the fragment from a URL.
|
||||||
|
|
|
@ -1154,7 +1154,7 @@ pub(crate) fn is_windows_store_shim(path: &Path) -> bool {
|
||||||
component.starts_with("python")
|
component.starts_with("python")
|
||||||
&& std::path::Path::new(component)
|
&& std::path::Path::new(component)
|
||||||
.extension()
|
.extension()
|
||||||
.map_or(false, |ext| ext.eq_ignore_ascii_case("exe"))
|
.is_some_and(|ext| ext.eq_ignore_ascii_case("exe"))
|
||||||
})
|
})
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -78,12 +78,12 @@ impl PythonInstallation {
|
||||||
/// Find or fetch a [`PythonInstallation`].
|
/// Find or fetch a [`PythonInstallation`].
|
||||||
///
|
///
|
||||||
/// Unlike [`PythonInstallation::find`], if the required Python is not installed it will be installed automatically.
|
/// Unlike [`PythonInstallation::find`], if the required Python is not installed it will be installed automatically.
|
||||||
pub async fn find_or_download<'a>(
|
pub async fn find_or_download(
|
||||||
request: Option<&PythonRequest>,
|
request: Option<&PythonRequest>,
|
||||||
environments: EnvironmentPreference,
|
environments: EnvironmentPreference,
|
||||||
preference: PythonPreference,
|
preference: PythonPreference,
|
||||||
python_downloads: PythonDownloads,
|
python_downloads: PythonDownloads,
|
||||||
client_builder: &BaseClientBuilder<'a>,
|
client_builder: &BaseClientBuilder<'_>,
|
||||||
cache: &Cache,
|
cache: &Cache,
|
||||||
reporter: Option<&dyn Reporter>,
|
reporter: Option<&dyn Reporter>,
|
||||||
python_install_mirror: Option<&str>,
|
python_install_mirror: Option<&str>,
|
||||||
|
@ -127,9 +127,9 @@ impl PythonInstallation {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Download and install the requested installation.
|
/// Download and install the requested installation.
|
||||||
pub async fn fetch<'a>(
|
pub async fn fetch(
|
||||||
request: PythonDownloadRequest,
|
request: PythonDownloadRequest,
|
||||||
client_builder: &BaseClientBuilder<'a>,
|
client_builder: &BaseClientBuilder<'_>,
|
||||||
cache: &Cache,
|
cache: &Cache,
|
||||||
reporter: Option<&dyn Reporter>,
|
reporter: Option<&dyn Reporter>,
|
||||||
python_install_mirror: Option<&str>,
|
python_install_mirror: Option<&str>,
|
||||||
|
|
|
@ -894,10 +894,10 @@ mod tests {
|
||||||
|
|
||||||
fs::write(
|
fs::write(
|
||||||
&mocked_interpreter,
|
&mocked_interpreter,
|
||||||
formatdoc! {r##"
|
formatdoc! {r"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo '{json}'
|
echo '{json}'
|
||||||
"##},
|
"},
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@ -913,10 +913,10 @@ mod tests {
|
||||||
);
|
);
|
||||||
fs::write(
|
fs::write(
|
||||||
&mocked_interpreter,
|
&mocked_interpreter,
|
||||||
formatdoc! {r##"
|
formatdoc! {r"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo '{}'
|
echo '{}'
|
||||||
"##, json.replace("3.12", "3.13")},
|
", json.replace("3.12", "3.13")},
|
||||||
)
|
)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let interpreter = Interpreter::query(&mocked_interpreter, &cache).unwrap();
|
let interpreter = Interpreter::query(&mocked_interpreter, &cache).unwrap();
|
||||||
|
|
|
@ -282,10 +282,10 @@ mod tests {
|
||||||
fs_err::create_dir_all(path.parent().unwrap())?;
|
fs_err::create_dir_all(path.parent().unwrap())?;
|
||||||
fs_err::write(
|
fs_err::write(
|
||||||
path,
|
path,
|
||||||
formatdoc! {r##"
|
formatdoc! {r"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo '{json}'
|
echo '{json}'
|
||||||
"##},
|
"},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
|
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
|
||||||
|
@ -304,10 +304,10 @@ mod tests {
|
||||||
|
|
||||||
fs_err::write(
|
fs_err::write(
|
||||||
path,
|
path,
|
||||||
formatdoc! {r##"
|
formatdoc! {r"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo '{output}' 1>&2
|
echo '{output}' 1>&2
|
||||||
"##},
|
"},
|
||||||
)?;
|
)?;
|
||||||
|
|
||||||
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
|
fs_err::set_permissions(path, std::os::unix::fs::PermissionsExt::from_mode(0o770))?;
|
||||||
|
@ -525,10 +525,10 @@ mod tests {
|
||||||
#[cfg(unix)]
|
#[cfg(unix)]
|
||||||
fs_err::write(
|
fs_err::write(
|
||||||
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),
|
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),
|
||||||
formatdoc! {r##"
|
formatdoc! {r"
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
echo 'foo'
|
echo 'foo'
|
||||||
"##},
|
"},
|
||||||
)?;
|
)?;
|
||||||
fs_err::set_permissions(
|
fs_err::set_permissions(
|
||||||
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),
|
children[0].join(format!("python{}", env::consts::EXE_SUFFIX)),
|
||||||
|
|
|
@ -953,7 +953,7 @@ impl Lock {
|
||||||
.ok()
|
.ok()
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(|package| matches!(package.id.source, Source::Virtual(_)));
|
.map(|package| matches!(package.id.source, Source::Virtual(_)));
|
||||||
if actual.map_or(true, |actual| actual != expected) {
|
if actual != Some(expected) {
|
||||||
return Ok(SatisfiesResult::MismatchedSources(name.clone(), expected));
|
return Ok(SatisfiesResult::MismatchedSources(name.clone(), expected));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -973,7 +973,7 @@ impl Lock {
|
||||||
.ok()
|
.ok()
|
||||||
.flatten()
|
.flatten()
|
||||||
.map(|package| &package.id.version);
|
.map(|package| &package.id.version);
|
||||||
if actual.map_or(true, |actual| actual != expected) {
|
if actual != Some(expected) {
|
||||||
return Ok(SatisfiesResult::MismatchedVersion(
|
return Ok(SatisfiesResult::MismatchedVersion(
|
||||||
name.clone(),
|
name.clone(),
|
||||||
expected.clone(),
|
expected.clone(),
|
||||||
|
|
|
@ -145,7 +145,7 @@ impl<'a, Context: BuildContext> DefaultResolverProvider<'a, Context> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a, Context: BuildContext> ResolverProvider for DefaultResolverProvider<'a, Context> {
|
impl<Context: BuildContext> ResolverProvider for DefaultResolverProvider<'_, Context> {
|
||||||
/// Make a "Simple API" request for the package and convert the result to a [`VersionMap`].
|
/// Make a "Simple API" request for the package and convert the result to a [`VersionMap`].
|
||||||
async fn get_package_versions<'io>(
|
async fn get_package_versions<'io>(
|
||||||
&'io self,
|
&'io self,
|
||||||
|
|
|
@ -55,6 +55,6 @@ impl AllowedYanks {
|
||||||
pub fn contains(&self, package_name: &PackageName, version: &Version) -> bool {
|
pub fn contains(&self, package_name: &PackageName, version: &Version) -> bool {
|
||||||
self.0
|
self.0
|
||||||
.get(package_name)
|
.get(package_name)
|
||||||
.map_or(false, |versions| versions.contains(version))
|
.is_some_and(|versions| versions.contains(version))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -205,10 +205,10 @@ impl Pep723Script {
|
||||||
let metadata = serialize_metadata(&default_metadata);
|
let metadata = serialize_metadata(&default_metadata);
|
||||||
|
|
||||||
let script = if let Some(existing_contents) = existing_contents {
|
let script = if let Some(existing_contents) = existing_contents {
|
||||||
indoc::formatdoc! {r#"
|
indoc::formatdoc! {r"
|
||||||
{metadata}
|
{metadata}
|
||||||
{content}
|
{content}
|
||||||
"#,
|
",
|
||||||
content = String::from_utf8(existing_contents).map_err(|err| Pep723Error::Utf8(err.utf8_error()))?}
|
content = String::from_utf8(existing_contents).map_err(|err| Pep723Error::Utf8(err.utf8_error()))?}
|
||||||
} else {
|
} else {
|
||||||
indoc::formatdoc! {r#"
|
indoc::formatdoc! {r#"
|
||||||
|
|
|
@ -268,7 +268,7 @@ pub fn windows_script_launcher(
|
||||||
launcher.extend_from_slice(&payload);
|
launcher.extend_from_slice(&payload);
|
||||||
launcher.extend_from_slice(python_path.as_bytes());
|
launcher.extend_from_slice(python_path.as_bytes());
|
||||||
launcher.extend_from_slice(
|
launcher.extend_from_slice(
|
||||||
&u32::try_from(python_path.as_bytes().len())
|
&u32::try_from(python_path.len())
|
||||||
.expect("file path should be smaller than 4GB")
|
.expect("file path should be smaller than 4GB")
|
||||||
.to_le_bytes(),
|
.to_le_bytes(),
|
||||||
);
|
);
|
||||||
|
@ -300,7 +300,7 @@ pub fn windows_python_launcher(
|
||||||
launcher.extend_from_slice(launcher_bin);
|
launcher.extend_from_slice(launcher_bin);
|
||||||
launcher.extend_from_slice(python_path.as_bytes());
|
launcher.extend_from_slice(python_path.as_bytes());
|
||||||
launcher.extend_from_slice(
|
launcher.extend_from_slice(
|
||||||
&u32::try_from(python_path.as_bytes().len())
|
&u32::try_from(python_path.len())
|
||||||
.expect("file path should be smaller than 4GB")
|
.expect("file path should be smaller than 4GB")
|
||||||
.to_le_bytes(),
|
.to_le_bytes(),
|
||||||
);
|
);
|
||||||
|
@ -377,7 +377,7 @@ mod test {
|
||||||
fn get_script_launcher(shebang: &str, is_gui: bool) -> String {
|
fn get_script_launcher(shebang: &str, is_gui: bool) -> String {
|
||||||
if is_gui {
|
if is_gui {
|
||||||
format!(
|
format!(
|
||||||
r##"{shebang}
|
r#"{shebang}
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -394,11 +394,11 @@ def make_gui() -> None:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
||||||
sys.exit(make_gui())
|
sys.exit(make_gui())
|
||||||
"##
|
"#
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
format!(
|
format!(
|
||||||
r##"{shebang}
|
r#"{shebang}
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
@ -412,7 +412,7 @@ def main_console() -> None:
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
|
||||||
sys.exit(main_console())
|
sys.exit(main_console())
|
||||||
"##
|
"#
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ pub(crate) struct LatestClient<'env> {
|
||||||
pub(crate) requires_python: &'env RequiresPython,
|
pub(crate) requires_python: &'env RequiresPython,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'env> LatestClient<'env> {
|
impl LatestClient<'_> {
|
||||||
/// Find the latest version of a package from an index.
|
/// Find the latest version of a package from an index.
|
||||||
pub(crate) async fn find_latest(
|
pub(crate) async fn find_latest(
|
||||||
&self,
|
&self,
|
||||||
|
|
|
@ -1006,7 +1006,7 @@ fn pyproject_build_backend_prerequisites(
|
||||||
if !build_file.try_exists()? {
|
if !build_file.try_exists()? {
|
||||||
fs_err::write(
|
fs_err::write(
|
||||||
build_file,
|
build_file,
|
||||||
indoc::formatdoc! {r#"
|
indoc::formatdoc! {r"
|
||||||
cmake_minimum_required(VERSION 3.15)
|
cmake_minimum_required(VERSION 3.15)
|
||||||
project(${{SKBUILD_PROJECT_NAME}} LANGUAGES CXX)
|
project(${{SKBUILD_PROJECT_NAME}} LANGUAGES CXX)
|
||||||
|
|
||||||
|
@ -1015,7 +1015,7 @@ fn pyproject_build_backend_prerequisites(
|
||||||
|
|
||||||
pybind11_add_module(_core MODULE src/main.cpp)
|
pybind11_add_module(_core MODULE src/main.cpp)
|
||||||
install(TARGETS _core DESTINATION ${{SKBUILD_PROJECT_NAME}})
|
install(TARGETS _core DESTINATION ${{SKBUILD_PROJECT_NAME}})
|
||||||
"#},
|
"},
|
||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1052,21 +1052,21 @@ fn generate_package_scripts(
|
||||||
|
|
||||||
// Python script for binary-based packaged apps or libs
|
// Python script for binary-based packaged apps or libs
|
||||||
let binary_call_script = if is_lib {
|
let binary_call_script = if is_lib {
|
||||||
indoc::formatdoc! {r#"
|
indoc::formatdoc! {r"
|
||||||
from {module_name}._core import hello_from_bin
|
from {module_name}._core import hello_from_bin
|
||||||
|
|
||||||
|
|
||||||
def hello() -> str:
|
def hello() -> str:
|
||||||
return hello_from_bin()
|
return hello_from_bin()
|
||||||
"#}
|
"}
|
||||||
} else {
|
} else {
|
||||||
indoc::formatdoc! {r#"
|
indoc::formatdoc! {r"
|
||||||
from {module_name}._core import hello_from_bin
|
from {module_name}._core import hello_from_bin
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
print(hello_from_bin())
|
print(hello_from_bin())
|
||||||
"#}
|
"}
|
||||||
};
|
};
|
||||||
|
|
||||||
// .pyi file for binary script
|
// .pyi file for binary script
|
||||||
|
|
|
@ -1117,7 +1117,7 @@ impl<'lock> EnvironmentSpecification<'lock> {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Run dependency resolution for an interpreter, returning the [`ResolverOutput`].
|
/// Run dependency resolution for an interpreter, returning the [`ResolverOutput`].
|
||||||
pub(crate) async fn resolve_environment<'a>(
|
pub(crate) async fn resolve_environment(
|
||||||
spec: EnvironmentSpecification<'_>,
|
spec: EnvironmentSpecification<'_>,
|
||||||
interpreter: &Interpreter,
|
interpreter: &Interpreter,
|
||||||
settings: ResolverSettingsRef<'_>,
|
settings: ResolverSettingsRef<'_>,
|
||||||
|
|
|
@ -1535,8 +1535,8 @@ impl RunCommand {
|
||||||
}
|
}
|
||||||
|
|
||||||
let metadata = target_path.metadata();
|
let metadata = target_path.metadata();
|
||||||
let is_file = metadata.as_ref().map_or(false, std::fs::Metadata::is_file);
|
let is_file = metadata.as_ref().is_ok_and(std::fs::Metadata::is_file);
|
||||||
let is_dir = metadata.as_ref().map_or(false, std::fs::Metadata::is_dir);
|
let is_dir = metadata.as_ref().is_ok_and(std::fs::Metadata::is_dir);
|
||||||
|
|
||||||
if target.eq_ignore_ascii_case("python") {
|
if target.eq_ignore_ascii_case("python") {
|
||||||
Ok(Self::Python(args.to_vec()))
|
Ok(Self::Python(args.to_vec()))
|
||||||
|
@ -1569,9 +1569,7 @@ impl RunCommand {
|
||||||
fn is_python_zipapp(target: &Path) -> bool {
|
fn is_python_zipapp(target: &Path) -> bool {
|
||||||
if let Ok(file) = fs_err::File::open(target) {
|
if let Ok(file) = fs_err::File::open(target) {
|
||||||
if let Ok(mut archive) = zip::ZipArchive::new(file) {
|
if let Ok(mut archive) = zip::ZipArchive::new(file) {
|
||||||
return archive
|
return archive.by_name("__main__.py").is_ok_and(|f| f.is_file());
|
||||||
.by_name("__main__.py")
|
|
||||||
.map_or(false, |f| f.is_file());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
false
|
false
|
||||||
|
|
|
@ -922,7 +922,7 @@ impl TestContext {
|
||||||
|
|
||||||
/// For when we add pypy to the test suite.
|
/// For when we add pypy to the test suite.
|
||||||
#[allow(clippy::unused_self)]
|
#[allow(clippy::unused_self)]
|
||||||
pub fn python_kind(&self) -> &str {
|
pub fn python_kind(&self) -> &'static str {
|
||||||
"python"
|
"python"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6859,10 +6859,10 @@ dependencies = [
|
||||||
|
|
||||||
// Write to a requirements file.
|
// Write to a requirements file.
|
||||||
let requirements_in = context.temp_dir.child("requirements.in");
|
let requirements_in = context.temp_dir.child("requirements.in");
|
||||||
requirements_in.write_str(&indoc::formatdoc! {r#"
|
requirements_in.write_str(&indoc::formatdoc! {r"
|
||||||
-e {}
|
-e {}
|
||||||
-e {}
|
-e {}
|
||||||
"#,
|
",
|
||||||
editable_dir1.path().display(),
|
editable_dir1.path().display(),
|
||||||
editable_dir2.path().display()
|
editable_dir2.path().display()
|
||||||
})?;
|
})?;
|
||||||
|
|
|
@ -7077,10 +7077,10 @@ fn local_index_requirements_txt_absolute() -> Result<()> {
|
||||||
"#, Url::from_directory_path(context.workspace_root.join("scripts/links/")).unwrap().as_str()})?;
|
"#, Url::from_directory_path(context.workspace_root.join("scripts/links/")).unwrap().as_str()})?;
|
||||||
|
|
||||||
let requirements_txt = context.temp_dir.child("requirements.txt");
|
let requirements_txt = context.temp_dir.child("requirements.txt");
|
||||||
requirements_txt.write_str(&indoc::formatdoc! {r#"
|
requirements_txt.write_str(&indoc::formatdoc! {r"
|
||||||
--index-url {}
|
--index-url {}
|
||||||
tqdm
|
tqdm
|
||||||
"#, Url::from_directory_path(root).unwrap().as_str()})?;
|
", Url::from_directory_path(root).unwrap().as_str()})?;
|
||||||
|
|
||||||
uv_snapshot!(context.filters(), context.pip_install()
|
uv_snapshot!(context.filters(), context.pip_install()
|
||||||
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
.env_remove(EnvVars::UV_EXCLUDE_NEWER)
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
[toolchain]
|
[toolchain]
|
||||||
channel = "1.83"
|
channel = "1.84"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue