wads.install_system_deps

Install system dependencies from [tool.wads.ops.*] sections in pyproject.toml.

This script reads system dependency configurations and installs them on the appropriate platform. It can be used as a standalone CLI tool or imported as a module.

Each [tool.wads.ops.<dep>] section may declare an install_timeout (seconds) to raise the per-command ceiling for a dependency that is slow but healthy — a cold-cache apt-get install ffmpeg on a GitHub runner is the motivating case. Without a declaration the timeout stays at DFLT_INSTALL_TIMEOUT:

[tool.wads.ops.ffmpeg]
install_timeout = 900
install.linux = ["sudo apt-get update", "sudo apt-get install -y ffmpeg"]

The CLI’s --install-timeout sets the fallback for dependencies that declare none; a declaration always wins over it.

Functions

check_if_installed(dep_name, check_cmds[, ...])

Check if dependency is already installed using check commands.

detect_platform()

Detect the current platform.

find_pyproject(path)

Find pyproject.toml file from path (file or directory).

install_dependency(dep_name, install_cmds[, ...])

Install a dependency using install commands.

install_system_dependencies([...])

Install system dependencies from pyproject.toml.

main()

CLI entry point.

read_system_deps(pyproject_path)

Read [tool.wads.ops.*] sections from pyproject.toml.

wads.install_system_deps.check_if_installed(dep_name, check_cmds, timeout=10)[source]

Check if dependency is already installed using check commands.

Parameters:
  • dep_name (str) – Name of dependency

  • check_cmds (any) – Command(s) to check if installed (string, list, or empty)

  • timeout (float) – Timeout in seconds for check commands

Return type:

bool

Returns:

True if installed, False otherwise

wads.install_system_deps.detect_platform()[source]

Detect the current platform.

Return type:

str

wads.install_system_deps.find_pyproject(path)[source]

Find pyproject.toml file from path (file or directory).

Return type:

Path

wads.install_system_deps.install_dependency(dep_name, install_cmds, timeout=300)[source]

Install a dependency using install commands.

Parameters:
  • dep_name (str) – Name of dependency

  • install_cmds (any) – Command(s) to install (string or list)

  • timeout (float) – Timeout in seconds for each command

Returns:

bool, error_message: Optional[str])

Return type:

Tuple[bool, Optional[str]]

wads.install_system_deps.install_system_dependencies(pyproject_path='.', platform=None, skip_check=False, verbose=True, *, default_install_timeout=300)[source]

Install system dependencies from pyproject.toml.

Parameters:
  • pyproject_path (str) – Path to pyproject.toml or directory containing it

  • platform (Optional[str]) – Platform to install for (linux/macos/windows), auto-detect if None

  • skip_check (bool) – Skip checking if dependencies are already installed

  • verbose (bool) – Print detailed progress

  • default_install_timeout (float) – Per-command install timeout (seconds) for dependencies that declare no install_timeout of their own.

Return type:

Tuple[int, int, int]

Returns:

(installed_count, skipped_count, failed_count)

wads.install_system_deps.main()[source]

CLI entry point.

wads.install_system_deps.read_system_deps(pyproject_path)[source]

Read [tool.wads.ops.*] sections from pyproject.toml.

Return type:

Dict[str, dict]