Skip to content

Commit

Permalink
Consistently use eprintln! for warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Nov 10, 2022
1 parent f3d31b7 commit bbc6438
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/auditwheel/audit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub fn auditwheel_rs(
} else if let Some(policy) = highest_policy {
Ok(policy)
} else {
println!(
eprintln!(
"⚠️ Warning: No compatible platform tag found, using the linux tag instead. \
You won't be able to upload those wheels to PyPI."
);
Expand Down
4 changes: 2 additions & 2 deletions src/build_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ impl BuildContext {
InterpreterKind::PyPy => "PyPy".to_string(),
})
.collect();
println!(
eprintln!(
"⚠️ Warning: {} does not yet support abi3 so the build artifacts will be version-specific.",
interp_names.iter().join(", ")
);
Expand Down Expand Up @@ -321,7 +321,7 @@ impl BuildContext {
}
let new_rpath = new_rpaths.join(":");
if let Err(err) = patchelf::set_rpath(&artifact.path, &new_rpath) {
println!(
eprintln!(
"⚠️ Warning: Failed to set rpath for {}: {}",
artifact.path.display(),
err
Expand Down
2 changes: 1 addition & 1 deletion src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,7 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
let pyo3_node = deps[lib];
if !pyo3_node.features.contains(&"extension-module".to_string()) {
let version = cargo_metadata[&pyo3_node.id].version.to_string();
println!(
eprintln!(
"⚠️ Warning: You're building a library without activating {}'s \
`extension-module` feature. \
See https://pyo3.rs/v{}/building_and_distribution.html#linking",
Expand Down
2 changes: 1 addition & 1 deletion src/cargo_toml.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ impl CargoToml {
}
}
if !removed.is_empty() {
println!(
eprintln!(
"⚠️ Warning: the following metadata fields in `package.metadata.maturin` section \
of Cargo.toml are removed since maturin 0.14.0: {}, \
please set them in pyproject.toml as PEP 621 specifies.",
Expand Down
4 changes: 2 additions & 2 deletions src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn compile_target(
&& !artifact.features.contains(&"rustc-dep-of-std".to_string());
if should_warn {
// This is a spurious error I don't really understand
println!(
eprintln!(
"⚠️ Warning: The package {} wasn't listed in `cargo metadata`",
package_id
);
Expand Down Expand Up @@ -551,7 +551,7 @@ pub fn warn_missing_py_init(artifact: &Path, module_name: &str) -> Result<()> {
}

if !found {
println!(
eprintln!(
"⚠️ Warning: Couldn't find the symbol `{}` in the native library. \
Python will fail to import this module. \
If you're using pyo3, check that `#[pymodule]` uses `{}` as module name",
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,7 @@ fn run() -> Result<()> {
#[cfg(feature = "upload")]
Opt::Upload { publish, files } => {
if files.is_empty() {
println!("⚠️ Warning: No files given, exiting.");
eprintln!("⚠️ Warning: No files given, exiting.");
return Ok(());
}

Expand Down
2 changes: 1 addition & 1 deletion src/source_distribution.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ pub fn source_distribution(
};
writer.add_file(root_dir.join(relative_cargo_lock), &cargo_lock_path)?;
} else {
println!(
eprintln!(
"⚠️ Warning: Cargo.lock is not found, it is recommended \
to include it in the source distribution"
);
Expand Down

0 comments on commit bbc6438

Please sign in to comment.