Crates.io | cargo-no-dev-deps |
lib.rs | cargo-no-dev-deps |
version | 0.2.14 |
source | src |
created_at | 2023-01-11 12:45:12.370306 |
updated_at | 2024-10-26 15:36:23.108232 |
description | Cargo subcommand for running cargo without dev-dependencies. |
homepage | |
repository | https://github.com/taiki-e/cargo-no-dev-deps |
max_upload_size | |
id | 756386 |
size | 75,200 |
Cargo subcommand for running cargo without dev-dependencies.
This is an extraction of the cargo-hack's --no-dev-deps
flag to be used as a stand-alone cargo subcommand.
$ cargo no-dev-deps --help
cargo-no-dev-deps
Cargo subcommand for running cargo without dev-dependencies.
USAGE:
cargo no-dev-deps <CARGO_SUBCOMMAND> [OPTIONS] [CARGO_OPTIONS]
OPTIONS:
--no-private Perform without `publish = false` crates
CARGO_SUBCOMMANDS:
build
check
...
To run cargo check
without dev-deps:
cargo no-dev-deps check
Note: cargo-no-dev-deps modifies Cargo.toml
and Cargo.lock
while running and restores it when finished. Any changes you made to those files during running will not be preserved.
If you want exclude publish = false
crates, you can exclude these crates by using --no-private
flag.
cargo no-dev-deps --no-private check
This flag is more powerful than cargo-hack's --ignore-private
flag, because this also prevents private crates from affecting lockfile and metadata.
cargo +stable install cargo-no-dev-deps --locked
Currently, installing cargo-no-dev-deps requires rustc 1.70+.
cargo-no-dev-deps is usually runnable with Cargo versions older than the Rust version
required for installation (e.g., cargo +1.59 no-dev-deps check
).
You can download prebuilt binaries from the Release page. Prebuilt binaries are available for macOS, Linux (gnu and musl), Windows (static executable), FreeBSD, and illumos.
# Get host target
host=$(rustc -vV | grep '^host:' | cut -d' ' -f2)
# Download binary and install to $HOME/.cargo/bin
curl --proto '=https' --tlsv1.2 -fsSL https://github.com/taiki-e/cargo-no-dev-deps/releases/latest/download/cargo-no-dev-deps-$host.tar.gz | tar xzf - -C "$HOME/.cargo/bin"
You can use taiki-e/install-action to install prebuilt binaries on Linux, macOS, and Windows. This makes the installation faster and may avoid the impact of problems caused by upstream changes.
- uses: taiki-e/install-action@cargo-no-dev-deps
You can install cargo-no-dev-deps from the Homebrew tap maintained by us (x86_64/AArch64 macOS, x86_64/AArch64 Linux):
brew install taiki-e/tap/cargo-no-dev-deps
You can install cargo-no-dev-deps from the Scoop bucket maintained by us:
scoop bucket add taiki-e https://github.com/taiki-e/scoop-bucket
scoop install cargo-no-dev-deps
You can install cargo-no-dev-deps using cargo-binstall:
cargo binstall cargo-no-dev-deps
-Z minimal-versions
.Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.