Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resolver = "2"

[workspace.package]
edition = "2024"
rust-version = "1.88"
rust-version = "1.89"
homepage = "https://pypi.org/project/uv/"
documentation = "https://pypi.org/project/uv/"
repository = "https://github.com/astral-sh/uv"
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-build-backend/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl PyProjectToml {
PortableGlobParser::Pep639
.parse(license_glob)
.map_err(|err| Error::PortableGlob {
field: license_glob.to_string(),
field: license_glob.to_owned(),
source: err,
})?;
license_globs_parsed.push(pep639_glob);
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-dev/src/generate_options_reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ fn generate_set(output: &mut String, set: Set, parents: &mut Vec<Set>) {
generate_set(
output,
Set::Named {
name: set_name.to_string(),
name: set_name.to_owned(),
set: *sub_set,
},
parents,
Expand Down
8 changes: 4 additions & 4 deletions crates/uv-dev/src/generate_sysconfig_mappings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,27 +99,27 @@ async fn generate() -> Result<String> {
replacements
.entry(sysconfig_cc_entry)
.or_default()
.insert(from_cc.to_string(), "cc".to_string());
.insert(from_cc.to_owned(), "cc".to_string());
}
if let Some(ref from_cc) = targets_config.target_cc {
replacements
.entry(sysconfig_cc_entry)
.or_default()
.insert(from_cc.to_string(), "cc".to_string());
.insert(from_cc.to_owned(), "cc".to_string());
}
}
for sysconfig_cxx_entry in ["CXX", "LDCXXSHARED"] {
if let Some(ref from_cxx) = targets_config.host_cxx {
replacements
.entry(sysconfig_cxx_entry)
.or_default()
.insert(from_cxx.to_string(), "c++".to_string());
.insert(from_cxx.to_owned(), "c++".to_string());
}
if let Some(ref from_cxx) = targets_config.target_cxx {
replacements
.entry(sysconfig_cxx_entry)
.or_default()
.insert(from_cxx.to_string(), "c++".to_string());
.insert(from_cxx.to_owned(), "c++".to_string());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-installer/src/preparer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ impl<'a, Context: BuildContext> Preparer<'a, Context> {
}
Ok(cached.clone())
}
Err(err) => Err(Error::Thread(err.to_string())),
Err(err) => Err(Error::Thread(err.to_owned())),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-metadata/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ pub fn find_flat_dist_info(
.starts_with(filename.name.as_str())
{
return Err(Error::MissingDistInfoPackageName(
dist_info_prefix.to_string(),
dist_info_prefix,
filename.name.to_string(),
));
}
Expand Down
6 changes: 3 additions & 3 deletions crates/uv-python/src/downloads.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ impl ManagedPythonDownload {
let mut extracted = match uv_extract::strip_component(temp_dir.path()) {
Ok(top_level) => top_level,
Err(uv_extract::Error::NonSingularArchive(_)) => temp_dir.keep(),
Err(err) => return Err(Error::ExtractError(filename.to_string(), err)),
Err(err) => return Err(Error::ExtractError(filename, err)),
};

// If the distribution is a `full` archive, the Python installation is in the `install` directory.
Expand Down Expand Up @@ -1266,12 +1266,12 @@ impl ManagedPythonDownload {
let mut reader = ProgressReader::new(&mut hasher, progress_key, reporter);
uv_extract::stream::archive(&mut reader, ext, target)
.await
.map_err(|err| Error::ExtractError(filename.to_string(), err))?;
.map_err(|err| Error::ExtractError(filename.to_owned(), err))?;
reporter.on_request_complete(direction, progress_key);
} else {
uv_extract::stream::archive(&mut hasher, ext, target)
.await
.map_err(|err| Error::ExtractError(filename.to_string(), err))?;
.map_err(|err| Error::ExtractError(filename.to_owned(), err))?;
}
hasher.finish().await.map_err(Error::HashExhaustion)?;

Expand Down
2 changes: 1 addition & 1 deletion crates/uv-resolver/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ fn display_tree_inner(
lines: &mut Vec<String>,
depth: usize,
) {
let prefix = " ".repeat(depth).to_string();
let prefix = " ".repeat(depth);
match error {
DerivationTree::Derived(derived) => {
display_tree_inner(&derived.cause1, lines, depth + 1);
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-resolver/src/lock/export/pylock_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ impl<'lock> PylockToml {
let mut doc = toml_edit::DocumentMut::new();

doc.insert("lock-version", value(self.lock_version.to_string()));
doc.insert("created-by", value(self.created_by.to_string()));
doc.insert("created-by", value(self.created_by.as_str()));
if let Some(ref requires_python) = self.requires_python {
doc.insert("requires-python", value(requires_python.to_string()));
}
Expand Down
20 changes: 8 additions & 12 deletions crates/uv-resolver/src/lock/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3782,19 +3782,15 @@ impl TryFrom<SourceWire> for Source {
Git { git } => {
let url = DisplaySafeUrl::parse(&git)
.map_err(|err| SourceParseError::InvalidUrl {
given: git.to_string(),
given: git.clone(),
err,
})
.map_err(LockErrorKind::InvalidGitSourceUrl)?;

let git_source = GitSource::from_url(&url)
.map_err(|err| match err {
GitSourceError::InvalidSha => SourceParseError::InvalidSha {
given: git.to_string(),
},
GitSourceError::MissingSha => SourceParseError::MissingSha {
given: git.to_string(),
},
GitSourceError::InvalidSha => SourceParseError::InvalidSha { given: git },
GitSourceError::MissingSha => SourceParseError::MissingSha { given: git },
})
.map_err(LockErrorKind::InvalidGitSourceUrl)?;

Expand Down Expand Up @@ -4279,11 +4275,11 @@ impl From<SourceDistWire> for SourceDist {
impl From<GitReference> for GitSourceKind {
fn from(value: GitReference) -> Self {
match value {
GitReference::Branch(branch) => Self::Branch(branch.to_string()),
GitReference::Tag(tag) => Self::Tag(tag.to_string()),
GitReference::BranchOrTag(rev) => Self::Rev(rev.to_string()),
GitReference::BranchOrTagOrCommit(rev) => Self::Rev(rev.to_string()),
GitReference::NamedRef(rev) => Self::Rev(rev.to_string()),
GitReference::Branch(branch) => Self::Branch(branch),
GitReference::Tag(tag) => Self::Tag(tag),
GitReference::BranchOrTag(rev) => Self::Rev(rev),
GitReference::BranchOrTagOrCommit(rev) => Self::Rev(rev),
GitReference::NamedRef(rev) => Self::Rev(rev),
GitReference::DefaultBranch => Self::DefaultBranch,
}
}
Expand Down
32 changes: 16 additions & 16 deletions crates/uv-trampoline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@ LLD and add the `rustup` targets:
```shell
sudo apt install llvm clang lld
cargo install cargo-xwin
rustup toolchain install nightly-2025-03-28
rustup component add rust-src --toolchain nightly-2025-03-28-x86_64-unknown-linux-gnu
rustup target add --toolchain nightly-2025-03-28 i686-pc-windows-msvc
rustup target add --toolchain nightly-2025-03-28 x86_64-pc-windows-msvc
rustup target add --toolchain nightly-2025-03-28 aarch64-pc-windows-msvc
rustup toolchain install nightly-2025-06-23
rustup component add rust-src --toolchain nightly-2025-06-23-x86_64-unknown-linux-gnu
rustup target add --toolchain nightly-2025-06-23 i686-pc-windows-msvc
rustup target add --toolchain nightly-2025-06-23 x86_64-pc-windows-msvc
rustup target add --toolchain nightly-2025-06-23 aarch64-pc-windows-msvc
```

Then, build the trampolines for all supported architectures:

```shell
cargo +nightly-2025-03-28 xwin build --xwin-arch x86 --release --target i686-pc-windows-msvc
cargo +nightly-2025-03-28 xwin build --release --target x86_64-pc-windows-msvc
cargo +nightly-2025-03-28 xwin build --release --target aarch64-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --xwin-arch x86 --release --target i686-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --release --target x86_64-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --release --target aarch64-pc-windows-msvc
```

### Cross-compiling from macOS
Expand All @@ -36,19 +36,19 @@ LLVM and add the `rustup` targets:
```shell
brew install llvm
cargo install cargo-xwin
rustup toolchain install nightly-2025-03-28
rustup component add rust-src --toolchain nightly-2025-03-28-aarch64-apple-darwin
rustup target add --toolchain nightly-2025-03-28 i686-pc-windows-msvc
rustup target add --toolchain nightly-2025-03-28 x86_64-pc-windows-msvc
rustup target add --toolchain nightly-2025-03-28 aarch64-pc-windows-msvc
rustup toolchain install nightly-2025-06-23
rustup component add rust-src --toolchain nightly-2025-06-23-aarch64-apple-darwin
rustup target add --toolchain nightly-2025-06-23 i686-pc-windows-msvc
rustup target add --toolchain nightly-2025-06-23 x86_64-pc-windows-msvc
rustup target add --toolchain nightly-2025-06-23 aarch64-pc-windows-msvc
```

Then, build the trampolines for all supported architectures:

```shell
cargo +nightly-2025-03-28 xwin build --release --target i686-pc-windows-msvc
cargo +nightly-2025-03-28 xwin build --release --target x86_64-pc-windows-msvc
cargo +nightly-2025-03-28 xwin build --release --target aarch64-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --release --target i686-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --release --target x86_64-pc-windows-msvc
cargo +nightly-2025-06-23 xwin build --release --target aarch64-pc-windows-msvc
```

### Updating the prebuilt executables
Expand Down
2 changes: 1 addition & 1 deletion crates/uv-trampoline/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "nightly-2025-03-28"
channel = "nightly-2025-06-23"
4 changes: 2 additions & 2 deletions crates/uv-workspace/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -981,10 +981,10 @@ impl Workspace {
.to_string_lossy()
.to_string();
for member_root in glob(&absolute_glob)
.map_err(|err| WorkspaceError::Pattern(absolute_glob.to_string(), err))?
.map_err(|err| WorkspaceError::Pattern(absolute_glob.clone(), err))?
{
let member_root = member_root
.map_err(|err| WorkspaceError::GlobWalk(absolute_glob.to_string(), err))?;
.map_err(|err| WorkspaceError::GlobWalk(absolute_glob.clone(), err))?;
if !seen.insert(member_root.clone()) {
continue;
}
Expand Down
3 changes: 1 addition & 2 deletions crates/uv/src/commands/project/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -985,8 +985,7 @@ fn pyproject_build_system(package: &PackageName, build_backend: ProjectBuildBack
requires = ["uv_build>={min_version},<{max_version}"]
build-backend = "uv_build"
"#}
}
.to_string(),
},
// Pure-python backends
ProjectBuildBackend::Hatch => indoc::indoc! {r#"
[build-system]
Expand Down
2 changes: 1 addition & 1 deletion crates/uv/tests/it/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@ impl TestContext {
filters.extend(
Self::path_patterns(executable)
.into_iter()
.map(|pattern| (pattern.to_string(), format!("[PYTHON-{version}]"))),
.map(|pattern| (pattern, format!("[PYTHON-{version}]"))),
);

// And for the symlink we created in the test the Python path
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[toolchain]
channel = "1.90"
channel = "1.91"
Loading