procpilot 0.7.0

Production-grade subprocess runner with typed errors, retry, and timeout
[package]
name = "procpilot"
version = "0.7.0"
edition = "2024"
rust-version = "1.91"
description = "Production-grade subprocess runner with typed errors, retry, and timeout"
license = "MIT OR Apache-2.0"
repository = "https://github.com/michaeldhopkins/procpilot"
homepage = "https://github.com/michaeldhopkins/procpilot"
readme = "README.md"
keywords = ["subprocess", "process", "command", "retry", "timeout"]
categories = ["os", "development-tools"]
# Dev-only files excluded from the published crate.
exclude = [
    "scripts/",
    ".github/",
    "CLAUDE.md",
    "cliff.toml",
    "clippy.toml",
    "deny.toml",
]

[features]
# Internal feature gating mock test binaries and integration tests. Not
# intended for downstream consumers. Enabled automatically in CI and when
# running `cargo test --all-features` locally.
mock-binaries = []

# Opt-in async variants (`Cmd::run_async`, `Cmd::spawn_async`) for use
# from inside a tokio runtime. Off by default — sync-only consumers
# pay nothing.
tokio = ["dep:tokio", "backon/tokio-sleep"]

# Opt-in test doubles: `MockRunner` and result-builder helpers for unit
# tests of code that takes `&dyn Runner`. Off by default — production
# builds don't compile mock infrastructure.
testing = []

# Mock test binaries. Prefixed `pp_` and gated behind the `mock-binaries`
# feature so they aren't built during `cargo install procpilot`. During
# `cargo test --all-features`, cargo builds them and sets
# `CARGO_BIN_EXE_pp_*` so the integration tests can reach them.

[[bin]]
name = "pp_cat"
path = "src/bin/pp_cat.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_echo"
path = "src/bin/pp_echo.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_sleep"
path = "src/bin/pp_sleep.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_status"
path = "src/bin/pp_status.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_print_env"
path = "src/bin/pp_print_env.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_print_env_multi"
path = "src/bin/pp_print_env_multi.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_pwd"
path = "src/bin/pp_pwd.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_spam"
path = "src/bin/pp_spam.rs"
required-features = ["mock-binaries"]

[[bin]]
name = "pp_child_grandchild"
path = "src/bin/pp_child_grandchild.rs"
required-features = ["mock-binaries"]

# Integration test that depends on the mock binaries. Skipped when
# `mock-binaries` is off so `cargo test` (without feature flag) still
# works for unit tests.
[[test]]
name = "runner"
path = "tests/runner.rs"
required-features = ["mock-binaries"]

[[test]]
name = "spawned"
path = "tests/spawned.rs"
required-features = ["mock-binaries"]

[[test]]
name = "pipeline"
path = "tests/pipeline.rs"
required-features = ["mock-binaries"]

[[test]]
name = "async_runner"
path = "tests/async_runner.rs"
required-features = ["mock-binaries", "tokio"]

[[test]]
name = "mock_runner"
path = "tests/mock_runner.rs"
required-features = ["testing"]

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
backon = { version = "1", default-features = false, features = ["std", "std-blocking-sleep"] }
os_pipe = "1.2.3"
shared_child = "1.1.1"
tokio = { version = "1", features = ["process", "io-util", "rt", "time", "sync", "macros"], optional = true }
wait-timeout = "0.2"

[dev-dependencies]
anyhow = "1"
tempfile = "3"
tokio = { version = "1", features = ["macros", "rt", "rt-multi-thread", "time", "sync", "io-util"] }

[lints.clippy]
struct-excessive-bools = "deny"
fn-params-excessive-bools = "deny"
collapsible-if = "deny"
too-many-arguments = "deny"
needless-range-loop = "deny"
extend_with_drain = "deny"
unwrap_used = "deny"
match_bool = "warn"
bool_to_int_with_if = "warn"
cognitive-complexity = "warn"
too-many-lines = "warn"