From e44b70dc72e0c094b05ffa4573605c6037b02c88 Mon Sep 17 00:00:00 2001 From: messense Date: Fri, 14 Oct 2022 16:14:25 +0800 Subject: [PATCH] Upgrade to clap 4.0 Bumps MSRV to 1.61.0 --- .github/workflows/test.yml | 2 +- Cargo.lock | 174 ++++++++++++++++++----- Cargo.toml | 19 +-- src/build_options.rs | 64 ++++----- src/main.rs | 104 +++++++------- src/new_project.rs | 8 +- src/upload.rs | 10 +- tests/cmd/build.stdout | 175 +++++++++++------------ tests/cmd/develop.stdout | 116 ++++++++------- tests/cmd/init.stdout | 22 ++- tests/cmd/list-python.stdout | 10 +- tests/cmd/new.stdout | 22 ++- tests/cmd/publish.stdout | 267 +++++++++++++++++------------------ tests/cmd/sdist.stdout | 20 ++- tests/cmd/upload.stdout | 88 ++++++------ 15 files changed, 590 insertions(+), 511 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b55c75970..9c709b7bd 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -407,7 +407,7 @@ jobs: - uses: actions-rs/toolchain@v1 with: profile: minimal - toolchain: '1.59.0' + toolchain: '1.61.0' override: true # Caching - name: Cache cargo build diff --git a/Cargo.lock b/Cargo.lock index d4697b23d..68554aa4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -29,6 +29,15 @@ dependencies = [ "opaque-debug", ] +[[package]] +name = "ahash" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" +dependencies = [ + "const-random", +] + [[package]] name = "ahash" version = "0.7.6" @@ -236,11 +245,11 @@ dependencies = [ [[package]] name = "cargo-options" -version = "0.4.0" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e154133a9bd3d46ad7e4be70b0c5915b62c1ddb57d4f31633146976fbdabe3d" +checksum = "6755badfe5e0224c6e2ae710d82cd7dce5866e8ebcb22e5f3eced8f25fbd1ace" dependencies = [ - "clap", + "clap 4.0.15", ] [[package]] @@ -255,12 +264,11 @@ dependencies = [ [[package]] name = "cargo-xwin" version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ef4ab668680f931f92137a21fa0c70a39039e251c8516de2e86d632e393c965" +source = "git+https://github.com/messense/cargo-xwin.git#2033f5317b40df624e10f0b6d57027b5dbee0da3" dependencies = [ "anyhow", "cargo-options", - "clap", + "clap 4.0.15", "dirs", "fs-err", "indicatif", @@ -272,13 +280,12 @@ dependencies = [ [[package]] name = "cargo-zigbuild" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9686be0aaee69600e8514deaa9ca47b62a571b41355c4eeb21a6c863bbec452" +source = "git+https://github.com/messense/cargo-zigbuild.git#59a2ea4dd57b2ded3ca562ce7598a533eff121a0" dependencies = [ "anyhow", "cargo-options", "cargo_metadata", - "clap", + "clap 4.0.15", "dirs", "fs-err", "path-slash", @@ -354,6 +361,15 @@ dependencies = [ "encoding_rs", ] +[[package]] +name = "chumsky" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d02796e4586c6c41aeb68eae9bfb4558a522c35f1430c14b40136c3706e09e4" +dependencies = [ + "ahash 0.3.8", +] + [[package]] name = "chunked_transfer" version = "1.4.0" @@ -377,8 +393,8 @@ checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", - "clap_derive", - "clap_lex", + "clap_derive 3.2.18", + "clap_lex 0.2.4", "indexmap", "once_cell", "strsim", @@ -387,22 +403,38 @@ dependencies = [ "textwrap", ] +[[package]] +name = "clap" +version = "4.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" +dependencies = [ + "atty", + "bitflags", + "clap_derive 4.0.13", + "clap_lex 0.3.0", + "once_cell", + "strsim", + "termcolor", + "terminal_size 0.2.1", +] + [[package]] name = "clap_complete" -version = "3.2.5" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f7a2e0a962c45ce25afce14220bc24f9dade0a1787f185cecf96bfba7847cd8" +checksum = "11cba7abac9b56dfe2f035098cdb3a43946f276e6db83b72c4e692343f9aab9a" dependencies = [ - "clap", + "clap 4.0.15", ] [[package]] name = "clap_complete_fig" -version = "3.2.4" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed37b4c0c1214673eba6ad8ea31666626bf72be98ffb323067d973c48b4964b9" +checksum = "cf2fc15aa585faf3c59b96c40923b2f4d119c710a84e8a81251eed54ba75335c" dependencies = [ - "clap", + "clap 4.0.15", "clap_complete", ] @@ -419,6 +451,19 @@ dependencies = [ "syn", ] +[[package]] +name = "clap_derive" +version = "4.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "clap_lex" version = "0.2.4" @@ -428,6 +473,15 @@ dependencies = [ "os_str_bytes", ] +[[package]] +name = "clap_lex" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "cli-table" version = "0.4.7" @@ -494,6 +548,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "const-random" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" +dependencies = [ + "const-random-macro", + "proc-macro-hack", +] + +[[package]] +name = "const-random-macro" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" +dependencies = [ + "getrandom", + "lazy_static", + "proc-macro-hack", + "tiny-keccak", +] + [[package]] name = "content_inspector" version = "0.2.4" @@ -580,6 +656,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-common" version = "0.1.6" @@ -1057,7 +1139,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] [[package]] @@ -1251,9 +1333,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.134" +version = "0.2.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" [[package]] name = "linux-raw-sys" @@ -1319,7 +1401,7 @@ dependencies = [ "cargo_metadata", "cbindgen", "cc", - "clap", + "clap 4.0.15", "clap_complete", "clap_complete_fig", "configparser", @@ -1400,9 +1482,9 @@ dependencies = [ [[package]] name = "minijinja" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "450c32bf0055201c231d737143581710b093271cc862dcc273e1c027b4bd384d" +checksum = "9459b63f078d9b7bd7a9deee349f759b8afa3af49d8a8ed1d466ee117a2a3b58" dependencies = [ "serde", ] @@ -1876,6 +1958,12 @@ dependencies = [ "version_check", ] +[[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + [[package]] name = "proc-macro2" version = "1.0.46" @@ -2036,13 +2124,16 @@ dependencies = [ [[package]] name = "rfc2047-decoder" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ecf2ba387f446155e26796aabb727e9ae1427dd13ac9cc21773a3fbda19d77" +checksum = "c2cc5bba09a7d67fd0e4cddea6fad36b4bd7508c293d113bf4e226e79fda2d4b" dependencies = [ "base64", "charset", + "chumsky", + "memchr", "quoted_printable", + "thiserror", ] [[package]] @@ -2062,13 +2153,11 @@ dependencies = [ [[package]] name = "rpassword" -version = "6.0.1" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf099a1888612545b683d2661a1940089f6c2e5a8e38979b2159da876bfd956" +checksum = "26b763cb66df1c928432cc35053f8bd4cec3335d8559fc16010017d16b3c1680" dependencies = [ "libc", - "serde", - "serde_json", "winapi", ] @@ -2260,9 +2349,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ "itoa", "ryu", @@ -2348,9 +2437,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "snapbox" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d199ccf8f606592df2d145db26f2aa45344e23c64b074cc5a4047f1d99b0f7" +checksum = "f98a96656eecd1621c5830831b48eb6903a9f86aaeb61b9f358a9bd462414ddd" dependencies = [ "concolor", "content_inspector", @@ -2547,6 +2636,15 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2660,9 +2758,9 @@ dependencies = [ [[package]] name = "trycmd" -version = "0.13.6" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac9fa73959e252e7c5a4e6260544b952f5bf3989e0b7ad229f4fd6f14671b02" +checksum = "1859507c6593597db93d95d228b324da1f04f39014eb26ea492925c31c36a81f" dependencies = [ "glob", "humantime", @@ -3034,7 +3132,7 @@ dependencies = [ "bytes", "cab", "camino", - "clap", + "clap 3.2.22", "cli-table", "flate2", "indicatif", @@ -3097,9 +3195,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" dependencies = [ "byteorder", "bzip2", diff --git a/Cargo.toml b/Cargo.toml index b8e8a3237..021c54a49 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ anyhow = "1.0.63" base64 = "0.13.0" glob = "0.3.0" cargo_metadata = "0.15.0" -cargo-options = "0.4.0" +cargo-options = "0.5.2" cargo-zigbuild = "0.13.0" cargo-xwin = { version = "0.11.0", default-features = false } cbindgen = { version = "0.24.2", default-features = false } @@ -55,12 +55,12 @@ textwrap = "0.15.1" ignore = "0.4.18" dialoguer = { version = "0.10.2", default-features = false } console = "0.15.2" -minijinja = "0.20.0" +minijinja = "0.23.0" lddtree = "0.3.1" cc = "1.0.72" -clap = { version = "3.2.19", features = ["derive", "env", "wrap_help"] } -clap_complete = "3.1.3" -clap_complete_fig = "3.1.0" +clap = { version = "4.0.0", features = ["derive", "env", "wrap_help"] } +clap_complete = "4.0.2" +clap_complete_fig = "4.0.0" tracing = "0.1.36" tracing-subscriber = { version = "0.3.15", features = ["env-filter"], optional = true } dunce = "1.0.2" @@ -70,8 +70,7 @@ pep440 = "0.2.0" bytesize = { version = "1.0.1", optional = true } configparser = { version = "3.0.0", optional = true } multipart = { version = "0.18.0", features = ["client"], default-features = false, optional = true } -# rpassword 7.0 requires Rust 1.60.0+ -rpassword = { version = "6.0.1", optional = true } +rpassword = { version = "7.0.0", optional = true } ureq = { version = "2.3.1", features = ["gzip", "socks-proxy"], default-features = false, optional = true } native-tls-crate = { package = "native-tls", version = "0.2.8", optional = true } @@ -79,7 +78,7 @@ native-tls-crate = { package = "native-tls", version = "0.2.8", optional = true indoc = "1.0.3" pretty_assertions = "1.3.0" rustversion = "1.0.9" -trycmd = "=0.13.6" +trycmd = "0.14.0" [features] default = ["log", "upload", "rustls", "human-panic"] @@ -99,3 +98,7 @@ opt-level = 3 opt-level = 3 [profile.dev.package.msi] opt-level = 3 + +[patch.crates-io] +cargo-zigbuild = { git = "https://github.com/messense/cargo-zigbuild.git" } +cargo-xwin = { git = "https://github.com/messense/cargo-xwin.git" } diff --git a/src/build_options.rs b/src/build_options.rs index 2e6ee27e3..96cd3cac2 100644 --- a/src/build_options.rs +++ b/src/build_options.rs @@ -41,89 +41,88 @@ fn pyo3_ffi_minimum_python_minor_version(major_version: u64, minor_version: u64) #[serde(default, rename_all = "kebab-case")] pub struct CargoOptions { /// Do not print cargo log messages - #[clap(short = 'q', long)] + #[arg(short = 'q', long)] pub quiet: bool, /// Number of parallel jobs, defaults to # of CPUs - #[clap(short = 'j', long, value_name = "N")] + #[arg(short = 'j', long, value_name = "N")] pub jobs: Option, /// Build artifacts with the specified Cargo profile - #[clap(long, value_name = "PROFILE-NAME")] + #[arg(long, value_name = "PROFILE-NAME")] pub profile: Option, /// Space or comma separated list of features to activate - #[clap(short = 'F', long, action = clap::ArgAction::Append)] + #[arg(short = 'F', long, action = clap::ArgAction::Append)] pub features: Vec, /// Activate all available features - #[clap(long)] + #[arg(long)] pub all_features: bool, /// Do not activate the `default` feature - #[clap(long)] + #[arg(long)] pub no_default_features: bool, /// Build for the target triple - #[clap(long, name = "TRIPLE", env = "CARGO_BUILD_TARGET")] + #[arg(long, value_name = "TRIPLE", env = "CARGO_BUILD_TARGET")] pub target: Option, /// Directory for all generated artifacts - #[clap(long, value_name = "DIRECTORY", value_parser)] + #[arg(long, value_name = "DIRECTORY")] pub target_dir: Option, /// Path to Cargo.toml - #[clap(short = 'm', long, value_name = "PATH", value_parser)] + #[arg(short = 'm', long, value_name = "PATH")] pub manifest_path: Option, /// Ignore `rust-version` specification in packages - #[clap(long)] + #[arg(long)] pub ignore_rust_version: bool, /// Use verbose output (-vv very verbose/build.rs output) - #[clap(short = 'v', long, action = clap::ArgAction::Count)] + #[arg(short = 'v', long, action = clap::ArgAction::Count)] pub verbose: u8, /// Coloring: auto, always, never - #[clap(long, value_name = "WHEN")] + #[arg(long, value_name = "WHEN")] pub color: Option, /// Require Cargo.lock and cache are up to date - #[clap(long)] + #[arg(long)] pub frozen: bool, /// Require Cargo.lock is up to date - #[clap(long)] + #[arg(long)] pub locked: bool, /// Run without accessing the network - #[clap(long)] + #[arg(long)] pub offline: bool, /// Override a configuration value (unstable) - #[clap(long, value_name = "KEY=VALUE", action = clap::ArgAction::Append)] + #[arg(long, value_name = "KEY=VALUE", action = clap::ArgAction::Append)] pub config: Vec, /// Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - #[clap(short = 'Z', value_name = "FLAG", action = clap::ArgAction::Append)] + #[arg(short = 'Z', value_name = "FLAG", action = clap::ArgAction::Append)] pub unstable_flags: Vec, /// Timing output formats (unstable) (comma separated): html, json - #[clap( + #[arg( long, value_name = "FMTS", - min_values = 0, value_delimiter = ',', require_equals = true )] pub timings: Option>, /// Outputs a future incompatibility report at the end of the build (unstable) - #[clap(long)] + #[arg(long)] pub future_incompat_report: bool, /// Rustc flags - #[clap(takes_value = true, multiple_values = true)] + #[arg(num_args = 0.., trailing_var_arg = true)] pub args: Vec, } @@ -144,36 +143,35 @@ pub struct BuildOptions { /// The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched /// /// This option is ignored on all non-linux platforms - #[clap( - name = "compatibility", + #[arg( + id = "compatibility", long = "compatibility", alias = "manylinux", - value_parser, - multiple_values = true, + num_args = 0.., action = clap::ArgAction::Append )] pub platform_tag: Vec, /// The python versions to build wheels for, given as the names of the /// interpreters. - #[clap(short, long, multiple_values = true, action = clap::ArgAction::Append)] + #[arg(short, long, num_args = 0.., action = clap::ArgAction::Append)] pub interpreter: Vec, /// Find interpreters from the host machine - #[clap(short = 'f', long, conflicts_with = "interpreter")] + #[arg(short = 'f', long, conflicts_with = "interpreter")] pub find_interpreter: bool, /// Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin - #[clap(short, long)] + #[arg(short, long)] pub bindings: Option, /// The directory to store the built wheels in. Defaults to a new "wheels" /// directory in the project's target directory - #[clap(short, long, value_parser)] + #[arg(short, long)] pub out: Option, /// Don't check for manylinux compliance - #[clap(long = "skip-auditwheel")] + #[arg(long = "skip-auditwheel")] pub skip_auditwheel: bool, /// For manylinux targets, use zig to ensure compliance for the chosen manylinux version @@ -181,16 +179,16 @@ pub struct BuildOptions { /// Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` /// /// Make sure you installed zig with `pip install maturin[zig]` - #[clap(long)] + #[arg(long)] pub zig: bool, /// Control whether to build universal2 wheel for macOS or not. /// Only applies to macOS targets, do nothing otherwise. - #[clap(long)] + #[arg(long)] pub universal2: bool, /// Cargo build options - #[clap(flatten)] + #[command(flatten)] pub cargo: CargoOptions, } diff --git a/src/main.rs b/src/main.rs index 20e86f3ad..f5b244bf2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,7 @@ use anyhow::{bail, Context, Result}; use cargo_zigbuild::Zig; -use clap::{ArgEnum, IntoApp, Parser, Subcommand}; +use clap::{CommandFactory, Parser, Subcommand, ValueEnum}; use clap_complete::Generator; use maturin::{ develop, init_project, new_project, write_dist_info, BridgeModel, BuildOptions, CargoOptions, @@ -19,80 +19,79 @@ use std::path::PathBuf; use std::str::FromStr; #[derive(Debug, Parser)] -#[clap( +#[command( version, name = env!("CARGO_PKG_NAME"), - global_setting(clap::AppSettings::DeriveDisplayOrder) + display_order = 1, )] #[cfg_attr(feature = "cargo-clippy", allow(clippy::large_enum_variant))] /// Build and publish crates with pyo3, rust-cpython and cffi bindings as well /// as rust binaries as python packages enum Opt { - #[clap(name = "build", alias = "b")] + #[command(name = "build", alias = "b")] /// Build the crate into python packages Build { /// Build artifacts in release mode, with optimizations - #[clap(short = 'r', long)] + #[arg(short = 'r', long)] release: bool, /// Strip the library for minimum file size - #[clap(long)] + #[arg(long)] strip: bool, /// Build a source distribution - #[clap(long)] + #[arg(long)] sdist: bool, - #[clap(flatten)] + #[command(flatten)] build: BuildOptions, }, #[cfg(feature = "upload")] - #[clap(name = "publish")] + #[command(name = "publish")] /// Build and publish the crate as python packages to pypi Publish { /// Do not pass --release to cargo - #[clap(long)] + #[arg(long)] debug: bool, /// Do not strip the library for minimum file size - #[clap(long = "no-strip")] + #[arg(long = "no-strip")] no_strip: bool, /// Don't build a source distribution - #[clap(long = "no-sdist")] + #[arg(long = "no-sdist")] no_sdist: bool, - #[clap(flatten)] + #[command(flatten)] publish: PublishOpt, - #[clap(flatten)] + #[command(flatten)] build: BuildOptions, }, - #[clap(name = "list-python")] + #[command(name = "list-python")] /// Search and list the available python installations ListPython { - #[clap(long)] + #[arg(long)] target: Option, }, - #[clap(name = "develop", alias = "dev")] + #[command(name = "develop", alias = "dev")] /// Install the crate as module in the current virtualenv /// /// Note that this command doesn't create entrypoints Develop { /// Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin - #[clap(short = 'b', long = "bindings", alias = "binding-crate")] + #[arg(short = 'b', long = "bindings", alias = "binding-crate")] bindings: Option, /// Pass --release to cargo - #[clap(short = 'r', long)] + #[arg(short = 'r', long)] release: bool, /// Strip the library for minimum file size - #[clap(long)] + #[arg(long)] strip: bool, /// Install extra requires aka. optional dependencies /// /// Use as `--extras=extra1,extra2` - #[clap( + #[arg( short = 'E', long, - use_value_delimiter = true, - multiple_values = false, + value_delimiter = ',', action = clap::ArgAction::Append )] extras: Vec, - #[clap(flatten)] + #[command(flatten)] cargo_options: CargoOptions, }, /// Build only a source distribution (sdist) without compiling. @@ -100,30 +99,30 @@ enum Opt { /// Building a source distribution requires a pyproject.toml with a `[build-system]` table. /// /// This command is a workaround for [pypa/pip#6041](https://github.com/pypa/pip/issues/6041) - #[clap(name = "sdist")] + #[command(name = "sdist")] SDist { - #[clap(short = 'm', long = "manifest-path", value_parser)] + #[arg(short = 'm', long = "manifest-path")] /// The path to the Cargo.toml manifest_path: Option, /// The directory to store the built wheels in. Defaults to a new "wheels" /// directory in the project's target directory - #[clap(short, long, value_parser)] + #[arg(short, long)] out: Option, }, /// Create a new cargo project in an existing directory - #[clap(name = "init")] + #[command(name = "init")] InitProject { /// Project path path: Option, - #[clap(flatten)] + #[command(flatten)] options: GenerateProjectOptions, }, /// Create a new cargo project - #[clap(name = "new")] + #[command(name = "new")] NewProject { /// Project path path: String, - #[clap(flatten)] + #[command(flatten)] options: GenerateProjectOptions, }, /// Upload python packages to pypi @@ -131,27 +130,27 @@ enum Opt { /// It is mostly similar to `twine upload`, but can only upload python wheels /// and source distributions. #[cfg(feature = "upload")] - #[clap(name = "upload")] + #[command(name = "upload")] Upload { - #[clap(flatten)] + #[command(flatten)] publish: PublishOpt, /// The python packages to upload - #[clap(name = "FILE", value_parser)] + #[arg(value_name = "FILE")] files: Vec, }, /// Backend for the PEP 517 integration. Not for human consumption /// /// The commands are meant to be called from the python PEP 517 - #[clap(subcommand)] + #[command(subcommand)] Pep517(Pep517Command), /// Generate shell completions - #[clap(name = "completions", hide = true)] + #[command(name = "completions", hide = true)] Completions { - #[clap(name = "SHELL", value_parser)] + #[arg(value_name = "SHELL")] shell: Shell, }, /// Zig linker wrapper - #[clap(subcommand, hide = true)] + #[command(subcommand, hide = true)] Zig(Zig), } @@ -159,53 +158,52 @@ enum Opt { /// /// The commands are meant to be called from the python PEP 517 #[derive(Debug, Subcommand)] -#[clap(name = "pep517", hide = true)] +#[command(name = "pep517", hide = true)] enum Pep517Command { /// The implementation of prepare_metadata_for_build_wheel - #[clap(name = "write-dist-info")] + #[command(name = "write-dist-info")] WriteDistInfo { - #[clap(flatten)] + #[command(flatten)] build_options: BuildOptions, /// The metadata_directory argument to prepare_metadata_for_build_wheel - #[clap(long = "metadata-directory", value_parser)] + #[arg(long = "metadata-directory")] metadata_directory: PathBuf, /// Strip the library for minimum file size - #[clap(long)] + #[arg(long)] strip: bool, }, - #[clap(name = "build-wheel")] + #[command(name = "build-wheel")] /// Implementation of build_wheel /// /// --release and --strip are currently unused by the PEP 517 implementation BuildWheel { - #[clap(flatten)] + #[command(flatten)] build_options: BuildOptions, /// Strip the library for minimum file size - #[clap(long)] + #[arg(long)] strip: bool, /// Build editable wheels - #[clap(long)] + #[arg(long)] editable: bool, }, /// The implementation of build_sdist - #[clap(name = "write-sdist")] + #[command(name = "write-sdist")] WriteSDist { /// The sdist_directory argument to build_sdist - #[clap(long = "sdist-directory", value_parser)] + #[arg(long = "sdist-directory")] sdist_directory: PathBuf, - #[clap( + #[arg( short = 'm', long = "manifest-path", - value_parser, default_value = "Cargo.toml", - name = "PATH" + value_name = "PATH" )] /// The path to the Cargo.toml manifest_path: PathBuf, }, } -#[derive(Debug, Clone, Copy, ArgEnum)] +#[derive(Debug, Clone, Copy, ValueEnum)] #[allow(clippy::enum_variant_names)] enum Shell { Bash, diff --git a/src/new_project.rs b/src/new_project.rs index dba1b8824..60660caa1 100644 --- a/src/new_project.rs +++ b/src/new_project.rs @@ -120,16 +120,16 @@ impl<'a> ProjectGenerator<'a> { #[derive(Debug, clap::Parser)] pub struct GenerateProjectOptions { /// Set the resulting package name, defaults to the directory name - #[clap(long)] + #[arg(long)] name: Option, /// Use mixed Rust/Python project layout - #[clap(long)] + #[arg(long)] mixed: bool, /// Use Python first src layout for mixed Rust/Python project - #[clap(long)] + #[arg(long)] src: bool, /// Which kind of bindings to use - #[clap(short, long, value_parser = ["pyo3", "rust-cpython", "cffi", "bin"])] + #[arg(short, long, value_parser = ["pyo3", "rust-cpython", "cffi", "bin"])] bindings: Option, } diff --git a/src/upload.rs b/src/upload.rs index 0f80d571f..d480398f4 100644 --- a/src/upload.rs +++ b/src/upload.rs @@ -20,12 +20,12 @@ pub struct PublishOpt { /// The repository (package index) to upload the package to. Should be a section in the config file. /// /// Can also be set via MATURIN_REPOSITORY environment variable. - #[clap(short = 'r', long, env = "MATURIN_REPOSITORY", default_value = "pypi")] + #[arg(short = 'r', long, env = "MATURIN_REPOSITORY", default_value = "pypi")] repository: String, /// The URL of the registry where the wheels are uploaded to. This overrides --repository. /// /// Can also be set via MATURIN_REPOSITORY_URL environment variable. - #[clap( + #[arg( long = "repository-url", env = "MATURIN_REPOSITORY_URL", overrides_with = "repository" @@ -36,16 +36,16 @@ pub struct PublishOpt { /// Can also be set via MATURIN_USERNAME environment variable. /// /// Set MATURIN_PYPI_TOKEN variable to use token-based authentication instead - #[clap(short, long, env = "MATURIN_USERNAME")] + #[arg(short, long, env = "MATURIN_USERNAME")] username: Option, /// Password for pypi or your custom registry. /// /// Can also be set via MATURIN_PASSWORD environment variable. - #[clap(short, long)] + #[arg(short, long)] password: Option, /// Continue uploading files if one already exists. /// (Only valid when uploading to PyPI. Other implementations may not support this.) - #[clap(long = "skip-existing")] + #[arg(long = "skip-existing")] skip_existing: bool, } diff --git a/tests/cmd/build.stdout b/tests/cmd/build.stdout index cccaef87a..c61af7d1c 100644 --- a/tests/cmd/build.stdout +++ b/tests/cmd/build.stdout @@ -1,123 +1,120 @@ -maturin[EXE]-build Build the crate into python packages -USAGE: - maturin[EXE] build [OPTIONS] [--] [ARGS]... +Usage: maturin[EXE] build [OPTIONS] [ARGS]... -ARGS: - ... - Rustc flags +Arguments: + [ARGS]... + Rustc flags -OPTIONS: - -r, --release - Build artifacts in release mode, with optimizations +Options: + -r, --release + Build artifacts in release mode, with optimizations - --strip - Strip the library for minimum file size + --strip + Strip the library for minimum file size - --sdist - Build a source distribution + --sdist + Build a source distribution - --compatibility ... - Control the platform tag on linux. - - Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or - `musllinux` tags (for example `musllinux_1_2`) and `linux` for the native linux tag. - - Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels - with the native `linux` tag will be rejected by pypi, unless they are separately - validated by `auditwheel`. - - The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing - matched - - This option is ignored on all non-linux platforms + --compatibility [...] + Control the platform tag on linux. + + Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or `musllinux` + tags (for example `musllinux_1_2`) and `linux` for the native linux tag. + + Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels + with the native `linux` tag will be rejected by pypi, unless they are separately validated + by `auditwheel`. + + The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched + + This option is ignored on all non-linux platforms - -i, --interpreter ... - The python versions to build wheels for, given as the names of the interpreters + -i, --interpreter [...] + The python versions to build wheels for, given as the names of the interpreters - -f, --find-interpreter - Find interpreters from the host machine + -f, --find-interpreter + Find interpreters from the host machine - -b, --bindings - Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin + -b, --bindings + Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin - -o, --out - The directory to store the built wheels in. Defaults to a new "wheels" directory in the - project's target directory + -o, --out + The directory to store the built wheels in. Defaults to a new "wheels" directory in the + project's target directory - --skip-auditwheel - Don't check for manylinux compliance + --skip-auditwheel + Don't check for manylinux compliance - --zig - For manylinux targets, use zig to ensure compliance for the chosen manylinux version - - Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` - - Make sure you installed zig with `pip install maturin[zig]` + --zig + For manylinux targets, use zig to ensure compliance for the chosen manylinux version + + Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` + + Make sure you installed zig with `pip install maturin[zig]` - --universal2 - Control whether to build universal2 wheel for macOS or not. Only applies to macOS - targets, do nothing otherwise + --universal2 + Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets, + do nothing otherwise - -q, --quiet - Do not print cargo log messages + -q, --quiet + Do not print cargo log messages - -j, --jobs - Number of parallel jobs, defaults to # of CPUs + -j, --jobs + Number of parallel jobs, defaults to # of CPUs - --profile - Build artifacts with the specified Cargo profile + --profile + Build artifacts with the specified Cargo profile - -F, --features - Space or comma separated list of features to activate + -F, --features + Space or comma separated list of features to activate - --all-features - Activate all available features + --all-features + Activate all available features - --no-default-features - Do not activate the `default` feature + --no-default-features + Do not activate the `default` feature - --target - Build for the target triple - - [env: CARGO_BUILD_TARGET=] + --target + Build for the target triple + + [env: CARGO_BUILD_TARGET=] - --target-dir - Directory for all generated artifacts + --target-dir + Directory for all generated artifacts - -m, --manifest-path - Path to Cargo.toml + -m, --manifest-path + Path to Cargo.toml - --ignore-rust-version - Ignore `rust-version` specification in packages + --ignore-rust-version + Ignore `rust-version` specification in packages - -v, --verbose - Use verbose output (-vv very verbose/build.rs output) + -v, --verbose... + Use verbose output (-vv very verbose/build.rs output) - --color - Coloring: auto, always, never + --color + Coloring: auto, always, never - --frozen - Require Cargo.lock and cache are up to date + --frozen + Require Cargo.lock and cache are up to date - --locked - Require Cargo.lock is up to date + --locked + Require Cargo.lock is up to date - --offline - Run without accessing the network + --offline + Run without accessing the network - --config - Override a configuration value (unstable) + --config + Override a configuration value (unstable) - -Z - Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -Z + Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - --timings[=...] - Timing output formats (unstable) (comma separated): html, json + --timings= + Timing output formats (unstable) (comma separated): html, json - --future-incompat-report - Outputs a future incompatibility report at the end of the build (unstable) + --future-incompat-report + Outputs a future incompatibility report at the end of the build (unstable) - -h, --help - Print help information + -h, --help + Print help information (use `-h` for a summary) diff --git a/tests/cmd/develop.stdout b/tests/cmd/develop.stdout index b5045f8fc..fed40fc95 100644 --- a/tests/cmd/develop.stdout +++ b/tests/cmd/develop.stdout @@ -1,88 +1,86 @@ -maturin[EXE]-develop Install the crate as module in the current virtualenv Note that this command doesn't create entrypoints -USAGE: - maturin[EXE] develop [OPTIONS] [--] [ARGS]... +Usage: maturin[EXE] develop [OPTIONS] [ARGS]... -ARGS: - ... - Rustc flags +Arguments: + [ARGS]... + Rustc flags -OPTIONS: - -b, --bindings - Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin +Options: + -b, --bindings + Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin - -r, --release - Pass --release to cargo + -r, --release + Pass --release to cargo - --strip - Strip the library for minimum file size + --strip + Strip the library for minimum file size - -E, --extras - Install extra requires aka. optional dependencies - - Use as `--extras=extra1,extra2` + -E, --extras + Install extra requires aka. optional dependencies + + Use as `--extras=extra1,extra2` - -q, --quiet - Do not print cargo log messages + -q, --quiet + Do not print cargo log messages - -j, --jobs - Number of parallel jobs, defaults to # of CPUs + -j, --jobs + Number of parallel jobs, defaults to # of CPUs - --profile - Build artifacts with the specified Cargo profile + --profile + Build artifacts with the specified Cargo profile - -F, --features - Space or comma separated list of features to activate + -F, --features + Space or comma separated list of features to activate - --all-features - Activate all available features + --all-features + Activate all available features - --no-default-features - Do not activate the `default` feature + --no-default-features + Do not activate the `default` feature - --target - Build for the target triple - - [env: CARGO_BUILD_TARGET=] + --target + Build for the target triple + + [env: CARGO_BUILD_TARGET=] - --target-dir - Directory for all generated artifacts + --target-dir + Directory for all generated artifacts - -m, --manifest-path - Path to Cargo.toml + -m, --manifest-path + Path to Cargo.toml - --ignore-rust-version - Ignore `rust-version` specification in packages + --ignore-rust-version + Ignore `rust-version` specification in packages - -v, --verbose - Use verbose output (-vv very verbose/build.rs output) + -v, --verbose... + Use verbose output (-vv very verbose/build.rs output) - --color - Coloring: auto, always, never + --color + Coloring: auto, always, never - --frozen - Require Cargo.lock and cache are up to date + --frozen + Require Cargo.lock and cache are up to date - --locked - Require Cargo.lock is up to date + --locked + Require Cargo.lock is up to date - --offline - Run without accessing the network + --offline + Run without accessing the network - --config - Override a configuration value (unstable) + --config + Override a configuration value (unstable) - -Z - Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + -Z + Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details - --timings[=...] - Timing output formats (unstable) (comma separated): html, json + --timings= + Timing output formats (unstable) (comma separated): html, json - --future-incompat-report - Outputs a future incompatibility report at the end of the build (unstable) + --future-incompat-report + Outputs a future incompatibility report at the end of the build (unstable) - -h, --help - Print help information + -h, --help + Print help information (use `-h` for a summary) diff --git a/tests/cmd/init.stdout b/tests/cmd/init.stdout index bfc4f824d..e0fa28900 100644 --- a/tests/cmd/init.stdout +++ b/tests/cmd/init.stdout @@ -1,16 +1,14 @@ -maturin[EXE]-init Create a new cargo project in an existing directory -USAGE: - maturin[EXE] init [OPTIONS] [PATH] +Usage: maturin[EXE] init [OPTIONS] [PATH] -ARGS: - Project path +Arguments: + [PATH] Project path -OPTIONS: - --name Set the resulting package name, defaults to the directory name - --mixed Use mixed Rust/Python project layout - --src Use Python first src layout for mixed Rust/Python project - -b, --bindings Which kind of bindings to use [possible values: pyo3, rust-cpython, - cffi, bin] - -h, --help Print help information +Options: + --name Set the resulting package name, defaults to the directory name + --mixed Use mixed Rust/Python project layout + --src Use Python first src layout for mixed Rust/Python project + -b, --bindings Which kind of bindings to use [possible values: pyo3, rust-cpython, + cffi, bin] + -h, --help Print help information diff --git a/tests/cmd/list-python.stdout b/tests/cmd/list-python.stdout index 29065be8b..53e486c4b 100644 --- a/tests/cmd/list-python.stdout +++ b/tests/cmd/list-python.stdout @@ -1,9 +1,7 @@ -maturin[EXE]-list-python Search and list the available python installations -USAGE: - maturin[EXE] list-python [OPTIONS] +Usage: maturin[EXE] list-python [OPTIONS] -OPTIONS: - --target - -h, --help Print help information +Options: + --target + -h, --help Print help information diff --git a/tests/cmd/new.stdout b/tests/cmd/new.stdout index d9c8e372c..9da448bb2 100644 --- a/tests/cmd/new.stdout +++ b/tests/cmd/new.stdout @@ -1,16 +1,14 @@ -maturin[EXE]-new Create a new cargo project -USAGE: - maturin[EXE] new [OPTIONS] +Usage: maturin[EXE] new [OPTIONS] -ARGS: - Project path +Arguments: + Project path -OPTIONS: - --name Set the resulting package name, defaults to the directory name - --mixed Use mixed Rust/Python project layout - --src Use Python first src layout for mixed Rust/Python project - -b, --bindings Which kind of bindings to use [possible values: pyo3, rust-cpython, - cffi, bin] - -h, --help Print help information +Options: + --name Set the resulting package name, defaults to the directory name + --mixed Use mixed Rust/Python project layout + --src Use Python first src layout for mixed Rust/Python project + -b, --bindings Which kind of bindings to use [possible values: pyo3, rust-cpython, + cffi, bin] + -h, --help Print help information diff --git a/tests/cmd/publish.stdout b/tests/cmd/publish.stdout index a356b80e5..c6e6e2363 100644 --- a/tests/cmd/publish.stdout +++ b/tests/cmd/publish.stdout @@ -1,157 +1,154 @@ -maturin[EXE]-publish Build and publish the crate as python packages to pypi -USAGE: - maturin[EXE] publish [OPTIONS] [--] [ARGS]... - -ARGS: - ... - Rustc flags - -OPTIONS: - --debug - Do not pass --release to cargo - - --no-strip - Do not strip the library for minimum file size - - --no-sdist - Don't build a source distribution - - -r, --repository - The repository (package index) to upload the package to. Should be a section in the - config file. - - Can also be set via MATURIN_REPOSITORY environment variable. - - [env: MATURIN_REPOSITORY=] - [default: pypi] - - --repository-url - The URL of the registry where the wheels are uploaded to. This overrides --repository. - - Can also be set via MATURIN_REPOSITORY_URL environment variable. - - [env: MATURIN_REPOSITORY_URL=] - - -u, --username - Username for pypi or your custom registry. - - Can also be set via MATURIN_USERNAME environment variable. - - Set MATURIN_PYPI_TOKEN variable to use token-based authentication instead - - [env: MATURIN_USERNAME=] - - -p, --password - Password for pypi or your custom registry. - - Can also be set via MATURIN_PASSWORD environment variable. - - --skip-existing - Continue uploading files if one already exists. (Only valid when uploading to PyPI. - Other implementations may not support this.) - - --compatibility ... - Control the platform tag on linux. - - Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or - `musllinux` tags (for example `musllinux_1_2`) and `linux` for the native linux tag. - - Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels - with the native `linux` tag will be rejected by pypi, unless they are separately - validated by `auditwheel`. - - The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing - matched - - This option is ignored on all non-linux platforms +Usage: maturin[EXE] publish [OPTIONS] [ARGS]... + +Arguments: + [ARGS]... + Rustc flags + +Options: + --debug + Do not pass --release to cargo + + --no-strip + Do not strip the library for minimum file size + + --no-sdist + Don't build a source distribution + + -r, --repository + The repository (package index) to upload the package to. Should be a section in the config + file. + + Can also be set via MATURIN_REPOSITORY environment variable. + + [env: MATURIN_REPOSITORY=] + [default: pypi] + + --repository-url + The URL of the registry where the wheels are uploaded to. This overrides --repository. + + Can also be set via MATURIN_REPOSITORY_URL environment variable. + + [env: MATURIN_REPOSITORY_URL=] + + -u, --username + Username for pypi or your custom registry. + + Can also be set via MATURIN_USERNAME environment variable. + + Set MATURIN_PYPI_TOKEN variable to use token-based authentication instead + + [env: MATURIN_USERNAME=] - -i, --interpreter ... - The python versions to build wheels for, given as the names of the interpreters + -p, --password + Password for pypi or your custom registry. + + Can also be set via MATURIN_PASSWORD environment variable. - -f, --find-interpreter - Find interpreters from the host machine + --skip-existing + Continue uploading files if one already exists. (Only valid when uploading to PyPI. Other + implementations may not support this.) - -b, --bindings - Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin + --compatibility [...] + Control the platform tag on linux. + + Options are `manylinux` tags (for example `manylinux2014`/`manylinux_2_24`) or `musllinux` + tags (for example `musllinux_1_2`) and `linux` for the native linux tag. + + Note that `manylinux1` and `manylinux2010` is unsupported by the rust compiler. Wheels + with the native `linux` tag will be rejected by pypi, unless they are separately validated + by `auditwheel`. + + The default is the lowest compatible `manylinux` tag, or plain `linux` if nothing matched + + This option is ignored on all non-linux platforms - -o, --out - The directory to store the built wheels in. Defaults to a new "wheels" directory in the - project's target directory + -i, --interpreter [...] + The python versions to build wheels for, given as the names of the interpreters - --skip-auditwheel - Don't check for manylinux compliance + -f, --find-interpreter + Find interpreters from the host machine - --zig - For manylinux targets, use zig to ensure compliance for the chosen manylinux version - - Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` - - Make sure you installed zig with `pip install maturin[zig]` + -b, --bindings + Which kind of bindings to use. Possible values are pyo3, rust-cpython, cffi and bin - --universal2 - Control whether to build universal2 wheel for macOS or not. Only applies to macOS - targets, do nothing otherwise + -o, --out + The directory to store the built wheels in. Defaults to a new "wheels" directory in the + project's target directory - -q, --quiet - Do not print cargo log messages + --skip-auditwheel + Don't check for manylinux compliance - -j, --jobs - Number of parallel jobs, defaults to # of CPUs + --zig + For manylinux targets, use zig to ensure compliance for the chosen manylinux version + + Default to manylinux2014/manylinux_2_17 if you do not specify an `--compatibility` + + Make sure you installed zig with `pip install maturin[zig]` - --profile - Build artifacts with the specified Cargo profile - - -F, --features - Space or comma separated list of features to activate - - --all-features - Activate all available features - - --no-default-features - Do not activate the `default` feature - - --target - Build for the target triple - - [env: CARGO_BUILD_TARGET=] - - --target-dir - Directory for all generated artifacts - - -m, --manifest-path - Path to Cargo.toml - - --ignore-rust-version - Ignore `rust-version` specification in packages + --universal2 + Control whether to build universal2 wheel for macOS or not. Only applies to macOS targets, + do nothing otherwise - -v, --verbose - Use verbose output (-vv very verbose/build.rs output) + -q, --quiet + Do not print cargo log messages - --color - Coloring: auto, always, never + -j, --jobs + Number of parallel jobs, defaults to # of CPUs - --frozen - Require Cargo.lock and cache are up to date + --profile + Build artifacts with the specified Cargo profile - --locked - Require Cargo.lock is up to date + -F, --features + Space or comma separated list of features to activate + + --all-features + Activate all available features - --offline - Run without accessing the network + --no-default-features + Do not activate the `default` feature + + --target + Build for the target triple + + [env: CARGO_BUILD_TARGET=] + + --target-dir + Directory for all generated artifacts + + -m, --manifest-path + Path to Cargo.toml + + --ignore-rust-version + Ignore `rust-version` specification in packages - --config - Override a configuration value (unstable) + -v, --verbose... + Use verbose output (-vv very verbose/build.rs output) - -Z - Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + --color + Coloring: auto, always, never - --timings[=...] - Timing output formats (unstable) (comma separated): html, json + --frozen + Require Cargo.lock and cache are up to date - --future-incompat-report - Outputs a future incompatibility report at the end of the build (unstable) + --locked + Require Cargo.lock is up to date - -h, --help - Print help information + --offline + Run without accessing the network + + --config + Override a configuration value (unstable) + + -Z + Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details + + --timings= + Timing output formats (unstable) (comma separated): html, json + + --future-incompat-report + Outputs a future incompatibility report at the end of the build (unstable) + + -h, --help + Print help information (use `-h` for a summary) diff --git a/tests/cmd/sdist.stdout b/tests/cmd/sdist.stdout index 3a9e1a269..8fb20de1c 100644 --- a/tests/cmd/sdist.stdout +++ b/tests/cmd/sdist.stdout @@ -1,20 +1,18 @@ -maturin[EXE]-sdist Build only a source distribution (sdist) without compiling. Building a source distribution requires a pyproject.toml with a `[build-system]` table. This command is a workaround for [pypa/pip#6041](https://github.com/pypa/pip/issues/6041) -USAGE: - maturin[EXE] sdist [OPTIONS] +Usage: maturin[EXE] sdist [OPTIONS] -OPTIONS: - -m, --manifest-path - The path to the Cargo.toml +Options: + -m, --manifest-path + The path to the Cargo.toml - -o, --out - The directory to store the built wheels in. Defaults to a new "wheels" directory in the - project's target directory + -o, --out + The directory to store the built wheels in. Defaults to a new "wheels" directory in the + project's target directory - -h, --help - Print help information + -h, --help + Print help information (use `-h` for a summary) diff --git a/tests/cmd/upload.stdout b/tests/cmd/upload.stdout index 0867e41c0..68bf43b79 100644 --- a/tests/cmd/upload.stdout +++ b/tests/cmd/upload.stdout @@ -1,49 +1,47 @@ -maturin[EXE]-upload Upload python packages to pypi It is mostly similar to `twine upload`, but can only upload python wheels and source distributions. -USAGE: - maturin[EXE] upload [OPTIONS] [FILE]... - -ARGS: - ... - The python packages to upload - -OPTIONS: - -r, --repository - The repository (package index) to upload the package to. Should be a section in the - config file. - - Can also be set via MATURIN_REPOSITORY environment variable. - - [env: MATURIN_REPOSITORY=] - [default: pypi] - - --repository-url - The URL of the registry where the wheels are uploaded to. This overrides --repository. - - Can also be set via MATURIN_REPOSITORY_URL environment variable. - - [env: MATURIN_REPOSITORY_URL=] - - -u, --username - Username for pypi or your custom registry. - - Can also be set via MATURIN_USERNAME environment variable. - - Set MATURIN_PYPI_TOKEN variable to use token-based authentication instead - - [env: MATURIN_USERNAME=] - - -p, --password - Password for pypi or your custom registry. - - Can also be set via MATURIN_PASSWORD environment variable. - - --skip-existing - Continue uploading files if one already exists. (Only valid when uploading to PyPI. - Other implementations may not support this.) - - -h, --help - Print help information +Usage: maturin[EXE] upload [OPTIONS] [FILE]... + +Arguments: + [FILE]... + The python packages to upload + +Options: + -r, --repository + The repository (package index) to upload the package to. Should be a section in the config + file. + + Can also be set via MATURIN_REPOSITORY environment variable. + + [env: MATURIN_REPOSITORY=] + [default: pypi] + + --repository-url + The URL of the registry where the wheels are uploaded to. This overrides --repository. + + Can also be set via MATURIN_REPOSITORY_URL environment variable. + + [env: MATURIN_REPOSITORY_URL=] + + -u, --username + Username for pypi or your custom registry. + + Can also be set via MATURIN_USERNAME environment variable. + + Set MATURIN_PYPI_TOKEN variable to use token-based authentication instead + + [env: MATURIN_USERNAME=] + + -p, --password + Password for pypi or your custom registry. + + Can also be set via MATURIN_PASSWORD environment variable. + + --skip-existing + Continue uploading files if one already exists. (Only valid when uploading to PyPI. Other + implementations may not support this.) + + -h, --help + Print help information (use `-h` for a summary)