meta_package_manager.cli_maintenance module¶
The maintenance subcommands: the state changers and diagnostics.
install, upgrade, remove, sync, cleanup and doctor, plus
the machinery only they need: the cooldown gate, the sourced-operation
dispatch that resolves each package spec to its source managers, and the
cleanup category selection.
The mpm group itself, and the per-package action engine restore also
drives, live in meta_package_manager.cli.
Todo
Add a --force/--reinstall flag to install.
- meta_package_manager.cli_maintenance.cooldown_permits(manager)[source]¶
Decide whether a release-introducing operation may run on
manager.Returns
Truewhen no cooldown is active, when the manager can enforce it (natively, or through the per-packagerelease_dateprobe), or when the manager’s resolvedCooldownPolicywaives the requirement (best-effort) or exempts it outright (off). ReturnsFalse(after logging the skip) when an active cooldown cannot be enforced and the fail-closed default still holds, so the caller leaves the manager alone rather than letting a freshly-published version slip in.The skip message names both remedies, the one-shot keyword and the persistent configuration key: opting out of a supply-chain safeguard is a standing policy decision, not something to re-type on every run.
- Return type:
- meta_package_manager.cli_maintenance.CLEANUP_CATEGORIES = ('orphans', 'cache', 'repair')¶
Cumulative categories the
cleanupsubcommand decomposes into.Each category has a two-sided
--<category>/--skip-<category>flag pair. Positive flags narrow the run to exactly the listed categories; skip flags subtract categories from the default selection.
- meta_package_manager.cli_maintenance.DEFAULT_CLEANUP_CATEGORIES = frozenset({'cache', 'repair'})¶
Categories a plain
cleanup(no category flag) runs.The orphan sweep is deliberately absent: it removes packages, where cache pruning and state repair only reclaim disk and fix metadata. Keeping it strictly behind an explicit
--orphansmakes the default non-destructive and identical on every manager, native sweep or not, mirroring howremovekeeps its cascade behind the same flag.