diff --git a/src/main.rs b/src/main.rs index 3f4b378a5..a4d8a97e9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -24,6 +24,7 @@ use std::path::PathBuf; version, name = env!("CARGO_PKG_NAME"), display_order = 1, + after_help = "Visit https://maturin.rs to learn more about maturin." )] #[cfg_attr(feature = "cargo-clippy", allow(clippy::large_enum_variant))] /// Build and publish crates with pyo3, rust-cpython and cffi bindings as well diff --git a/src/new_project.rs b/src/new_project.rs index 99745bef9..c13ada339 100644 --- a/src/new_project.rs +++ b/src/new_project.rs @@ -203,8 +203,9 @@ fn generate_project( } else { let selection = Select::with_theme(&ColorfulTheme::default()) .with_prompt(format!( - "🤷 {}", - style("Which kind of bindings to use?").bold() + "🤷 {}\n 📖 {}", + style("Which kind of bindings to use?").bold(), + style("Documentation: https://maturin.rs/bindings.html").dim() )) .items(&bindings_items) .default(0) diff --git a/tests/cli.rs b/tests/cli.rs index c5f412266..43457402e 100644 --- a/tests/cli.rs +++ b/tests/cli.rs @@ -3,9 +3,26 @@ fn cli_tests() { let t = trycmd::TestCases::new(); t.default_bin_name("maturin"); t.case("tests/cmd/*.toml"); + #[cfg(not(feature = "upload"))] { t.skip("tests/cmd/upload.toml"); t.skip("tests/cmd/publish.toml"); } + + #[cfg(not(feature = "zig"))] + { + t.skip("tests/cmd/build.toml"); + } + + #[cfg(not(feature = "scaffolding"))] + { + t.skip("tests/cmd/new.toml"); + t.skip("tests/cmd/init.toml"); + } + + #[cfg(not(all(feature = "upload", feature = "zig", feature = "scaffolding")))] + { + t.skip("tests/cmd/maturin.toml"); + } } diff --git a/tests/cmd/maturin.stderr b/tests/cmd/maturin.stderr new file mode 100644 index 000000000..e69de29bb diff --git a/tests/cmd/maturin.stdout b/tests/cmd/maturin.stdout new file mode 100644 index 000000000..c4822e183 --- /dev/null +++ b/tests/cmd/maturin.stdout @@ -0,0 +1,21 @@ +Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as +python packages + +Usage: maturin[EXE] + +Commands: + build Build the crate into python packages + publish Build and publish the crate as python packages to pypi + list-python Search and list the available python installations + develop Install the crate as module in the current virtualenv + sdist Build only a source distribution (sdist) without compiling + init Create a new cargo project in an existing directory + new Create a new cargo project + upload Upload python packages to pypi + help Print this message or the help of the given subcommand(s) + +Options: + -h, --help Print help information + -V, --version Print version information + +Visit https://maturin.rs to learn more about maturin. diff --git a/tests/cmd/maturin.toml b/tests/cmd/maturin.toml new file mode 100644 index 000000000..c196e1924 --- /dev/null +++ b/tests/cmd/maturin.toml @@ -0,0 +1,2 @@ +bin.name = "maturin" +args = "--help" diff --git a/tests/common/integration.rs b/tests/common/integration.rs index e4355d01d..1aeddeb27 100644 --- a/tests/common/integration.rs +++ b/tests/common/integration.rs @@ -1,5 +1,6 @@ use crate::common::{check_installed, create_virtualenv, maybe_mock_cargo, test_python_path}; use anyhow::{bail, Context, Result}; +#[cfg(feature = "zig")] use cargo_zigbuild::Zig; use clap::Parser; use maturin::{BuildOptions, PythonInterpreter}; @@ -52,7 +53,12 @@ pub fn test_integration( cli.push(target) } - let test_zig = if zig && (env::var("GITHUB_ACTIONS").is_ok() || Zig::find_zig().is_ok()) { + #[cfg(feature = "zig")] + let zig_found = Zig::find_zig().is_ok(); + #[cfg(not(feature = "zig"))] + let zig_found = false; + + let test_zig = if zig && (env::var("GITHUB_ACTIONS").is_ok() || zig_found) { cli.push("--zig"); true } else {