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 crates/pixi-build-backend/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ async fn build<T: ProtocolInstantiator>(factory: T, manifest_path: &Path) -> mie
eprintln!("Successfully build '{}'", package.output_file.display());
eprintln!("Use following globs to revalidate: ");
for glob in package.input_globs {
eprintln!(" - {}", glob);
eprintln!(" - {glob}");
}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/pixi-build-backend/src/compilers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Display for Language<'_> {
Language::Cxx => write!(f, "cxx"),
Language::Fortran => write!(f, "fortran"),
Language::Rust => write!(f, "rust"),
Language::Other(name) => write!(f, "{}", name),
Language::Other(name) => write!(f, "{name}"),
}
}
}
Expand Down Expand Up @@ -116,7 +116,7 @@ pub fn add_compilers_to_requirements(

if !resolved_build_requirements.contains_key(&PackageName::new_unchecked(language_compiler))
{
let template = format!("${{{{ compiler('{}') }}}}", compiler_str);
let template = format!("${{{{ compiler('{compiler_str}') }}}}");
requirements.push(Item::Value(Value::Template(template)));
}
}
Expand Down Expand Up @@ -151,7 +151,7 @@ pub fn add_stdlib_to_requirements(
}

// If the stdlib key exists, add it to the requirements
let template = format!("${{{{ stdlib('{}') }}}}", stdlib);
let template = format!("${{{{ stdlib('{stdlib}') }}}}");
requirements.push(Item::Value(Value::Template(template)));
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi-build-backend/src/tools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ pub fn output_directory(
[0..placeholder_length - build_dir.join("host_env").as_os_str().len()]
.to_string();

build_dir.join(format!("host_env{}", placeholder))
build_dir.join(format!("host_env{placeholder}"))
};

Directories {
Expand Down
4 changes: 2 additions & 2 deletions crates/pixi-build-backend/tests/integration/common/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ pub(crate) fn load_project_model_from_json(filename: &str) -> TestProjectModel {
.join(filename);

let json_content = std::fs::read_to_string(&fixture_path)
.unwrap_or_else(|e| panic!("Failed to read JSON fixture '{}': {}", filename, e));
.unwrap_or_else(|e| panic!("Failed to read JSON fixture '{filename}': {e}"));

serde_json::from_str(&json_content)
.unwrap_or_else(|e| panic!("Failed to parse JSON fixture '{}': {}", filename, e))
.unwrap_or_else(|e| panic!("Failed to parse JSON fixture '{filename}': {e}"))
}

/// Converts a TestProjectModel into a ProjectModelV1
Expand Down
6 changes: 3 additions & 3 deletions crates/pixi-build-mojo/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ mod tests {
// Check for mojo-compiler package (should be present)
let has_mojo_compiler = build_reqs
.iter()
.any(|item| format!("{:?}", item).contains("mojo-compiler"));
.any(|item| format!("{item:?}").contains("mojo-compiler"));
assert!(has_mojo_compiler, "Should have mojo-compiler package");

// Check for additional compiler templates
Expand Down Expand Up @@ -517,7 +517,7 @@ mod tests {
// Check for mojo-compiler package (should be present by default)
let has_mojo_compiler = build_reqs
.iter()
.any(|item| format!("{:?}", item).contains("mojo-compiler"));
.any(|item| format!("{item:?}").contains("mojo-compiler"));
assert!(
has_mojo_compiler,
"Should have mojo-compiler package by default"
Expand Down Expand Up @@ -582,7 +582,7 @@ mod tests {
// Check for mojo-compiler package (should NOT be present)
let has_mojo_compiler = build_reqs
.iter()
.any(|item| format!("{:?}", item).contains("mojo-compiler"));
.any(|item| format!("{item:?}").contains("mojo-compiler"));
assert!(
!has_mojo_compiler,
"Should NOT have mojo-compiler package when user opts out"
Expand Down
2 changes: 1 addition & 1 deletion crates/pixi-build-python/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl GenerateRecipe for PythonGenerator {
// Helper function to get Python requirement spec
let get_python_requirement = || -> miette::Result<recipe::Item<PackageDependency>> {
let python_requirement_str = match pyproject_metadata_provider.requires_python() {
Ok(Some(requires_python)) => format!("python {}", requires_python),
Ok(Some(requires_python)) => format!("python {requires_python}"),
_ => "python".to_string(),
};
python_requirement_str.parse().into_diagnostic()
Expand Down
13 changes: 4 additions & 9 deletions crates/pixi-build-python/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -444,10 +444,7 @@ version = "not.a.valid.version.at.all"
Err(MetadataError::PyProjectToml(_)) => {
// This is expected - invalid version in pyproject.toml
}
other => panic!(
"Expected PyProjectTomlError for invalid version, got: {:?}",
other
),
other => panic!("Expected PyProjectTomlError for invalid version, got: {other:?}"),
}
}

Expand All @@ -466,7 +463,7 @@ version = "1.0.0"
assert!(result.is_err());
match result.unwrap_err() {
MetadataError::PyProjectToml(_) => {}
err => panic!("Expected PyProjectToml, got: {:?}", err),
err => panic!("Expected PyProjectToml, got: {err:?}"),
}
}

Expand Down Expand Up @@ -626,13 +623,11 @@ requires-python = ">=3.13"

assert!(
has_python_constraint_host,
"Host requirements should include 'python >=3.13', found: {:?}",
host_requirements
"Host requirements should include 'python >=3.13', found: {host_requirements:?}"
);
assert!(
has_python_constraint_run,
"Run requirements should include 'python >=3.13', found: {:?}",
run_requirements
"Run requirements should include 'python >=3.13', found: {run_requirements:?}"
);
}
}
3 changes: 1 addition & 2 deletions crates/pixi-build-rattler-build/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1369,8 +1369,7 @@ mod tests {
for extra_glob in &extra_globs {
assert!(
globs.contains(extra_glob),
"Result should contain extra glob: {}",
extra_glob
"Result should contain extra glob: {extra_glob}"
);
}

Expand Down
3 changes: 1 addition & 2 deletions crates/pixi-build-rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,7 @@ mod tests {
for extra_glob in &config.extra_input_globs {
assert!(
result.contains(extra_glob),
"Result should contain extra glob: {}",
extra_glob
"Result should contain extra glob: {extra_glob}"
);
}

Expand Down
32 changes: 10 additions & 22 deletions crates/pixi-build-rust/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,7 @@ mod tests {
// This is expected when workspace inheritance fails due to
// missing workspace
}
_ => panic!(
"Expected MissingInheritedValue or CargoTomlError, got: {:?}",
error
),
_ => panic!("Expected MissingInheritedValue or CargoTomlError, got: {error:?}"),
}
}

Expand All @@ -417,10 +414,7 @@ mod tests {
// This is expected when workspace inheritance fails due to
// missing workspace
}
_ => panic!(
"Expected MissingInheritedValue or CargoTomlError, got: {:?}",
error
),
_ => panic!("Expected MissingInheritedValue or CargoTomlError, got: {error:?}"),
}
}

Expand Down Expand Up @@ -672,8 +666,7 @@ version.workspace = true
assert_eq!(
globs.len(),
1,
"Expected only Cargo.toml glob when workspace is in same file, got: {:?}",
globs
"Expected only Cargo.toml glob when workspace is in same file, got: {globs:?}"
);
}

Expand Down Expand Up @@ -723,8 +716,7 @@ description.workspace = true
// is detected
assert!(
globs.len() >= 2,
"Expected at least 2 globs when workspace is in separate file, got: {:?}",
globs
"Expected at least 2 globs when workspace is in separate file, got: {globs:?}"
);

// Check that a workspace-related glob pattern is included
Expand All @@ -733,8 +725,7 @@ description.workspace = true
.any(|glob| glob.contains("../Cargo.toml") && glob != "Cargo.toml");
assert!(
has_workspace_glob,
"Expected workspace glob pattern, got: {:?}",
globs
"Expected workspace glob pattern, got: {globs:?}"
);
}

Expand All @@ -756,8 +747,7 @@ version = "1.0.0"
assert_eq!(
globs.len(),
1,
"Expected exactly 1 glob when no workspace is present, got: {:?}",
globs
"Expected exactly 1 glob when no workspace is present, got: {globs:?}"
);
assert!(globs.contains("Cargo.toml"));

Expand All @@ -767,8 +757,7 @@ version = "1.0.0"
.any(|glob| glob.contains("**/Cargo.toml") && glob != "Cargo.toml");
assert!(
!has_workspace_glob,
"No workspace globs should be present when no workspace inheritance occurs, got: {:?}",
globs
"No workspace globs should be present when no workspace inheritance occurs, got: {globs:?}"
);
}

Expand Down Expand Up @@ -804,8 +793,7 @@ description = "Direct package values"
assert_eq!(
globs.len(),
1,
"Expected exactly 1 glob when workspace exists but no inheritance is used, got: {:?}",
globs
"Expected exactly 1 glob when workspace exists but no inheritance is used, got: {globs:?}"
);
assert!(globs.contains("Cargo.toml"));
}
Expand Down Expand Up @@ -857,7 +845,7 @@ version = "not.a.valid.version.at.all"
Err(MetadataError::ParseVersionError(_)) => {
// This is the expected error case
}
other => panic!("Unexpected result: {:?}", other),
other => panic!("Unexpected result: {other:?}"),
}
}

Expand All @@ -876,7 +864,7 @@ version = "1.0.0"
assert!(result.is_err());
match result.unwrap_err() {
MetadataError::CargoTomlError(_) => {}
err => panic!("Expected CargoTomlError, got: {:?}", err),
err => panic!("Expected CargoTomlError, got: {err:?}"),
}
}
}
2 changes: 1 addition & 1 deletion crates/recipe-stage0/src/matchspec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl PackageDependency {
impl Display for PackageDependency {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
PackageDependency::Binary(spec) => write!(f, "{}", spec),
PackageDependency::Binary(spec) => write!(f, "{spec}"),
PackageDependency::Source(source_spec) => {
let matchspec = SerializableMatchSpec::from(source_spec.spec.clone());
write!(f, "Source(spec: {}, {})", matchspec, source_spec.location)
Expand Down
14 changes: 7 additions & 7 deletions crates/recipe-stage0/src/recipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ pub enum Value<T> {
impl<T: Display> Display for Value<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Value::Concrete(val) => write!(f, "{}", val),
Value::Template(template) => write!(f, "{}", template),
Value::Concrete(val) => write!(f, "{val}"),
Value::Template(template) => write!(f, "{template}"),
}
}
}
Expand Down Expand Up @@ -83,8 +83,8 @@ impl<T> Item<T> {
impl<T: Display> Display for Item<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Item::Value(value) => write!(f, "{}", value),
Item::Conditional(cond) => write!(f, "{}", cond),
Item::Value(value) => write!(f, "{value}"),
Item::Conditional(cond) => write!(f, "{cond}"),
}
}
}
Expand All @@ -104,8 +104,8 @@ impl<T: PartialEq> PartialEq for Item<T> {
impl<T: Debug> Debug for Item<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Item::Value(value) => write!(f, "Value({:?})", value),
Item::Conditional(cond) => write!(f, "Conditional({:?})", cond),
Item::Value(value) => write!(f, "Value({value:?})"),
Item::Conditional(cond) => write!(f, "Conditional({cond:?})"),
}
}
}
Expand Down Expand Up @@ -525,7 +525,7 @@ impl Python {
impl Display for Python {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
for entry_point in &self.entry_points {
write!(f, "{}, ", entry_point)?;
write!(f, "{entry_point}, ")?;
}
Ok(())
}
Expand Down
Loading
Loading