duck.cli.commands.sync

Module containing the SyncCommand class for Duck project dependency sync.

Submodules

Package Contents

Classes

SyncCommand

CLI command group for syncing project dependencies from duck.toml.

API

class duck.cli.commands.sync.SyncCommand[source]

CLI command group for syncing project dependencies from duck.toml.

classmethod main(include_dev: bool = False, dev_only: bool = False, dry_run: bool = False, config: str = '', pip_args: str = '', system_args: str = '', sudo: bool | None = None, backend: str = '')[source]

Run a full dependency sync using duck.toml.

Parameters:
  • include_dev – Whether to also sync the [development] group.

  • dev_only – Whether to also sync the [development] group.

  • dry_run – Print planned installs without changing the system.

  • config – Explicit path to duck.toml, auto discovered when empty.

  • pip_args – Extra args appended to every pip/uv install, e.g. “–extra-index-url https://download.pytorch.org/whl/cu118”.

  • system_args – Extra args appended to every system package install, e.g. “–no-install-recommends”.

  • sudo – Force sudo on or off for system installs. Left as None, duck.toml’s [sync] setting is used, falling back to auto-detect (skip sudo when already root).

  • backend – Override the auto-detected system package manager. Accepts a known identifier (apt, brew, pacman …) or a raw install command such as "some_command -i". Left empty, the backend is detected from the host platform.

classmethod print_header(distro: str, package_manager: str, py_package_manager: str, config: str, is_root: bool, py_version: str) None[source]

Prints the detected system environment and selected backend.

Parameters:
  • distro – Detected operating system distribution.

  • package_manager – Package manager backend selected by Duck Sync.

  • py_package_manager – Python package manager backend selected by Duck Sync.

  • config – The config path or name relative to cwd.

  • is_root – Whether we are in root environment.

  • py_version – The python version.

classmethod print_report(report: duck.cli.commands.sync.sync.SyncReport)[source]

Prints a sync run summary to the console.

Parameters:

report – The report returned by DuckSync.run().