meta_package_manager.definitions module¶
Declarative package managers: the TOML schema and its class factory.
A [mpm.overrides.<id>] configuration section describes a manager as data. This
module owns everything that turns such a description into a live
PackageManager subclass:
the schema vocabulary: which manager attributes a section may set, both on a shipped manager (
OVERRIDABLE_FIELDS) and on a brand-new definition (DEFINITION_CLI_FIELDS, the operations DSL constants);the validation and parsing layer (
parse_manager_definition()), shared by--validate-configand the runtime registration path so a config that survives one survives the other;the class factory (
build_manager_class()), which synthesizes aConfigDrivenManagersubclass implementing exactly the operations the definition declares;the bundled-definition loader (
load_bundled_definitions(),build_bundled_managers()): mpm ships some managers as*.tomlpackage data undermeta_package_manager/managers/, each a single[mpm.overrides.<id>]section in the exact schema a user would write.
The runtime policy around definitions stays in
meta_package_manager.config: where sections may be loaded from, the
trust gate on local files, the override-application pass and the registration
passes wired into the CLI. The split keeps this module dependent on
meta_package_manager.manager and the leaf
meta_package_manager.cooldown vocabulary only, so the configuration layer
can build on it without a circular import.
- meta_package_manager.definitions.OVERRIDES_SECTION: Final[str] = 'overrides'¶
Key of the
[mpm]sub-table holding the per-manager sections.A
[mpm.overrides.<id>]block a user writes and a bundled definition file open on the same key, the two being one schema. It is named here because four readers have to agree on it: the configuration loader, its validator, theconfig-templatewriter and the documentation generators.It must not name a subcommand.
MpmConfigdeclares the sub-tree opaque, soclick_extrahands the whole of it to mpm’s own validator, and a subcommand sharing the key loses its configuration surface.
- meta_package_manager.definitions.OVERRIDABLE_FIELDS: Final[Mapping[str, Callable[[Any], Any]]] = {'cli_names': <function _to_str_tuple>, 'cli_search_path': <function _to_str_tuple>, 'cooldown_policy': <function _to_cooldown_policy>, 'dry_run': <function _to_bool>, 'extra_env': <function _to_str_dict>, 'ignore_auto_updates': <function _to_bool>, 'plan': <function _to_bool>, 'post_args': <function _to_str_tuple>, 'pre_args': <function _to_str_tuple>, 'pre_cmds': <function _to_str_tuple>, 'requirement': <function _to_str>, 'stop_on_error': <function _to_bool>, 'sudo': <function _to_bool>, 'timeout': <function _to_int>, 'unmaintained': <function _to_bool>, 'version_cli_options': <function _to_str_tuple>, 'version_regexes': <function _to_str_tuple>}¶
Per-manager attributes a user is allowed to override from the
[mpm.overrides.<id>]configuration section.Each entry maps a
meta_package_manager.manager.PackageManagerattribute name to a converter that validates the raw TOML value and returns the value as the attribute’s expected runtime type. Lists are coerced into tuples to match the attributes’ tuple types.Note
id,name,platforms,homepage_urlandvirtualare intentionally excluded: they are identity, lookup or platform-classification attributes that the pool’s registration relies on. Phase 1 of TOML-driven configuration only exposes attributes whose runtime override is safe.
- meta_package_manager.definitions.VALID_PLATFORM_TOKENS: Final[frozenset[str]] = frozenset({'aix', 'all_agents', 'all_architectures', 'all_arm', 'all_ci', 'all_mips', 'all_platforms', 'all_shells', 'all_sparc', 'all_terminals', 'all_traits', 'all_windows', 'almalinux', 'alpine', 'altlinux', 'amzn', 'android', 'arch', 'arch_32_bit', 'arch_64_bit', 'big_endian', 'bourne_shells', 'bsd', 'bsd_without_macos', 'buildroot', 'c_shells', 'cachyos', 'centos', 'chromeos', 'clearlinux', 'cloudlinux', 'crux', 'cygwin', 'debian', 'dragonfly_bsd', 'endeavouros', 'exherbo', 'fedora', 'freebsd', 'generic_linux', 'gentoo', 'gpu_terminals', 'guix', 'haiku', 'hurd', 'ibm_mainframe', 'ibm_powerkvm', 'illumos', 'kali', 'kvmibm', 'linux', 'linux_layers', 'linux_like', 'linuxmint', 'little_endian', 'loongarch', 'macos', 'mageia', 'mandriva', 'manjaro', 'midnightbsd', 'multiplexers', 'native_terminals', 'netbsd', 'nixos', 'nobara', 'nutyx', 'openbsd', 'opensuse', 'openwrt', 'oracle', 'os400', 'other_posix', 'other_shells', 'parallels', 'pidora', 'pikaos', 'powerpc', 'raspbian', 'rhel', 'riscv', 'rocky', 'scientific', 'slackware', 'sles', 'slitaz', 'solaris', 'solus', 'sourcemage', 'sunos', 'system_v', 'tuxedo', 'ubuntu', 'ultramarine', 'unix', 'unix_layers', 'unix_without_macos', 'void', 'web_terminals', 'webassembly', 'windows', 'windows_shells', 'wsl1', 'wsl2', 'x86', 'xenserver'})¶
Platform and group IDs accepted in a definition’s
platformslist.Union of every
extra_platforms.PlatformID and every group ID, so both a specific platform (ubuntu) and a group (linux,all_platforms) resolve.
- meta_package_manager.definitions.DEFINITION_CLI_FIELDS: Final[Mapping[str, Callable[[Any], Any]]] = {'brewfile_entry_type': <function _to_str>, 'brewfile_skip_warning': <function _to_str>, 'cli_names': <function _to_str_tuple>, 'cli_search_path': <function _to_str_tuple>, 'default_sudo': <function _to_bool>, 'extra_env': <function _to_str_dict>, 'internal_sudo': <function _to_bool>, 'internal_sudo_operations': <function _to_operation_set>, 'keywords': <function _to_str_tuple>, 'maintenance_note': <function _to_str>, 'operation_notes': <function _to_operation_notes>, 'post_args': <function _to_str_tuple>, 'pre_args': <function _to_str_tuple>, 'pre_cmds': <function _to_str_tuple>, 'requirement': <function _to_str>, 'resets_sudo_timestamp': <function _to_bool>, 'timeout': <function _to_int>, 'unmaintained': <function _to_bool>, 'unmaintained_message': <function _to_str>, 'version_cli': <function _to_str>, 'version_cli_options': <function _to_str_tuple>, 'version_from_stderr': <function _to_bool>, 'version_regexes': <function _to_str_tuple>}¶
CLI-execution attributes a definition may set, mostly reusing the override converters.
The runtime-preference fields (
dry_run,ignore_auto_updates,plan,stop_on_error) are excluded: they are command-line/global concerns, not part of a manager’s identity, and resolve through the usual option precedence.unmaintainedis reused from the override converters so a TOML-defined manager can flag its own upstream as abandoned (seedocs/cooldown.mdfor the affected managers).Twelve fields are definition-only:
brewfile_entry_typemaps the manager onto a Homebrew Bundle DSL entry so its installed packages joinmpm dump --brewfileexports (seebrewfile_entry_type).brewfile_skip_warningis the message emitted when the manager’s packages are deliberately left out of such an export (seebrewfile_skip_warning).default_sudois the manager’s built-in escalation policy (seedefault_sudo). Operations markedsudo = trueescalate by default, while the user’s global--no-sudoflag or asudooverride still win.internal_sudomarks a manager whose CLI invokessudoitself mid-run (seeinternal_sudo). mpm never wraps its commands insudo; priming instead reuses a warm credential cache for these internal escalations. Seedocs/sudo.md.internal_sudo_operationslists the operations in which such a manager may run its ownsudo(seeinternal_sudo_operations): every mutating one by default.keywordslists the well-known names of the manager that its ID does not already carry (seekeywords). They join the PyPI keywords of the project and the content rules of the issue labeller.maintenance_noterenders a{note}admonition atop the manager’s page for a still-maintained upstream under watch (seemaintenance_note).operation_notesfills the Notes column of the manager page’s Operations table with one-sentence hints (seeoperation_notes): why an operation is missing, or what makes a declared one partial.resets_sudo_timestampmarks an internal escalator whose CLI drops the cachedsudocredentials itself (seeresets_sudo_timestamp), so a warm cache never spares its prompt.unmaintained_messagedocuments an abandoned upstream, rendering a{warning}admonition and the⚠️table markers (seeunmaintained_message).version_clinames an alternate binary for the version probe (seeversion_cli), for suites whose own binaries expose no version flag (OpenBSD’spkg_add).version_from_stderrmakes the version probe search<stderr>too (seeversion_from_stderr), for tools printing their version there and nothing on<stdout>.
- meta_package_manager.definitions.DEFINITION_LINK_FIELDS: Final[tuple[str, ...]] = ('homepage_url', 'documentation_url', 'repository_url', 'wikipedia_url', 'logo')¶
Optional documentation-only strings of a definition,
Nonewhen absent.Each names the
PackageManagerattribute it lands on, and theManagerDefinitionfield of the same name.
- meta_package_manager.definitions.DEFINITION_IDENTITY_FIELDS: Final[frozenset[str]] = frozenset({'documentation_url', 'homepage_url', 'logo', 'name', 'operations', 'platforms', 'repository_url', 'wikipedia_url'})¶
Top-level keys of a definition section that are not CLI-execution fields.
- meta_package_manager.definitions.QUERY_OPERATIONS: Final[frozenset[str]] = frozenset({'installed', 'orphans', 'outdated', 'search'})¶
Operations that parse the command’s stdout into packages.
- meta_package_manager.definitions.COMMAND_OPERATIONS: Final[frozenset[str]] = frozenset({'cleanup_cache', 'cleanup_orphan', 'cleanup_repair', 'doctor', 'install', 'mark_explicit', 'remove', 'remove_orphan', 'sync', 'upgrade_all', 'upgrade_one'})¶
Operations that only run a command and produce no inventory to parse.
cleanupitself is deliberately absent: it is not an operation a manager defines anymore, but the fixed composition of the declared cleanup categories (seemeta_package_manager.manager.PackageManager.cleanup()). A definition declaring it is rejected with a targeted error.
- meta_package_manager.definitions.ALL_DEFINITION_OPERATIONS: Final[frozenset[str]] = frozenset({'cleanup_cache', 'cleanup_orphan', 'cleanup_repair', 'doctor', 'install', 'installed', 'mark_explicit', 'orphans', 'outdated', 'remove', 'remove_orphan', 'search', 'sync', 'upgrade_all', 'upgrade_one'})¶
Every operation name a definition may declare.
- meta_package_manager.definitions.RECOGNIZED_PARSE_FIELDS: Final[frozenset[str]] = frozenset({'installed_version', 'latest_version', 'package_id'})¶
Named regex groups / JSON field keys a query parser may map to a package.
- meta_package_manager.definitions.REQUIRED_PARSE_FIELDS: Final[Mapping[str, frozenset[str]]] = {'installed': frozenset({'package_id'}), 'orphans': frozenset({'package_id'}), 'outdated': frozenset({'latest_version', 'package_id'}), 'search': frozenset({'package_id'})}¶
Parse fields each query operation must extract to be useful.
installedneeds only the package ID: some tools genuinely track no per-package version (Clear Linux bundles underswupd, Cygwin listings underapt-cyg), and mpm’s package model treats the installed version as optional everywhere.outdatedwithout alatest_versionwould report nothing actionable, so there the version capture stays mandatory.
- meta_package_manager.definitions.OPERATION_ARG_PLACEHOLDER: Final[Mapping[str, str]] = {'install': 'package_id', 'mark_explicit': 'package_id', 'remove': 'package_id', 'remove_orphan': 'package_id', 'upgrade_one': 'package_id'}¶
Placeholder each operation’s
argsmust reference, so a value is actually passed to the CLI (aremovewith no{package_id}would target nothing).searchis deliberately absent: its{query}placeholder is optional. A tool with no real search command can still declare the operation by listing its whole catalog (opkg list,swupd bundle-list --all) and lettingmeta_package_manager.manager.PackageManager.refiltered_search()narrow the results, mirroring the search-from-scratch augmentation some built-in managers use.
- meta_package_manager.definitions.SEARCH_REFINEMENT_KEYS: Final[frozenset[str]] = frozenset({'exact_args', 'extended_args', 'id_name_only_args'})¶
Optional per-refinement argument templates of the
searchoperation.Each key holds the CLI arguments spliced into the
argstemplate — at the position of the matching{exact_args}-style marker — when the refinement is active:exact_argsfor an--exactsearch,extended_argsfor an--extendedone, andid_name_only_argsfor the default ID/name-restricted mode (mpm’s--id-name-only, for tools like Chocolatey whose unrestricted search is the default and take a flag to narrow it). An inactive refinement expands its marker to nothing.Declaring a key advertises native support for the matching mpm flag (
exact_argssets thesearchmethod’sexact_supportintrospection attribute, either of the other two setsextended_support), which feeds the augmentations documentation.meta_package_manager.manager.PackageManager.refiltered_search()still refines the results client-side either way, exactly as for the built-in managers.
- meta_package_manager.definitions.ALLOWED_ARG_PLACEHOLDERS: Final[Mapping[str, frozenset[str]]] = {'install': frozenset({'package_id'}), 'mark_explicit': frozenset({'package_id'}), 'remove': frozenset({'package_id'}), 'remove_orphan': frozenset({'package_id'}), 'search': frozenset({'exact_args', 'extended_args', 'id_name_only_args', 'query'}), 'upgrade_one': frozenset({'package_id'})}¶
Placeholders each operation’s
argsmay reference.Operations absent from this mapping take no placeholder at all. Any
{token}outside the operation’s set is rejected at parse time: a typoed{qeury}would otherwise reach the CLI as a literal argument and fail in silent, tool-specific ways.
- meta_package_manager.definitions.ARG_PLACEHOLDER_REGEX: Final = re.compile('\\{([a-z_]+)\\}')¶
Match
{placeholder}tokens in an operation’s args, for validation.
- meta_package_manager.definitions.QUERY_OPERATION_KEYS: Final[frozenset[str]] = frozenset({'args', 'cli', 'fields', 'format', 'list_path', 'regex', 'sudo'})¶
Keys allowed in a query operation’s table.
cliis the same alternate-binary hook as on command operations.sudo = truemarks the query as privileged, for the rare tool that gates even its read-only listings behind root (deb-get’s upgradable check); escalation then follows the usual per-manager policy.
- meta_package_manager.definitions.SEARCH_OPERATION_KEYS: Final[frozenset[str]] = frozenset({'args', 'cli', 'exact_args', 'extended_args', 'fields', 'format', 'id_name_only_args', 'list_path', 'regex', 'sudo'})¶
Keys allowed in the
searchoperation’s table: a query operation plus the per-refinement argument templates ofSEARCH_REFINEMENT_KEYS.
- meta_package_manager.definitions.COMMAND_OPERATION_KEYS: Final[frozenset[str]] = frozenset({'args', 'cli', 'sudo'})¶
Keys allowed in a command operation’s table.
clinames an alternate binary for this operation, resolved on the search path at call time: it lets one definition span sibling binaries (urpmqquerying whileurpmiinstalls).sudo = truemarks the operation as privileged, mirroring thesudo=Trueflag built-in managers pass torun_cli: escalation then follows the per-manager policy (the definition’sdefault_sudo, overridden by the user’s--sudo/--no-sudo).
- class meta_package_manager.definitions.OperationSpec(args, cli=None, sudo=False, exact_args=None, extended_args=None, id_name_only_args=None, parse_mode='none', regex=None, list_path=None, fields=None)[source]¶
Bases:
objectDeclarative specification of one operation of a config-defined manager.
- args: tuple[str, ...]¶
CLI arguments appended after the resolved binary, before
post_args.May embed the
{package_id}and{query}placeholders, substituted at call time.{version}is intentionally unsupported: config-defined managers do not pin versions (see_make_install).
- cli: str | None = None¶
Alternate binary name for this operation, or
Nonefor the manager’s maincli_path.Resolved with
which()at call time, so one definition can span sibling binaries (urpmi/urpme/urpmq,cast/dispel/gaze). The operation fails withFileNotFoundErrorwhen the binary is missing rather than silently falling back to the main CLI.
- sudo: bool = False¶
Mark the operation as privileged, mirroring the
sudo=Trueflag built-in managers pass torun_cli().Escalation still follows the per-manager policy: the definition’s
default_sudo, overridden by the user’s--sudo/--no-sudo. Command operations are the usual bearers; a query may also set it, for the rare tool that gates its read-only listings behind root (deb-get).
- exact_args: tuple[str, ...] | None = None¶
Arguments spliced at the
{exact_args}marker of asearch’sargswhen an exact match is requested, orNonewhen the tool has no native exact mode. SeeSEARCH_REFINEMENT_KEYS.
- extended_args: tuple[str, ...] | None = None¶
Arguments spliced at the
{extended_args}marker of asearch’sargswhen the extended (description-reaching) mode is requested, orNonewhen the tool has no native switch for it. SeeSEARCH_REFINEMENT_KEYS.
- id_name_only_args: tuple[str, ...] | None = None¶
Arguments spliced at the
{id_name_only_args}marker of asearch’sargswhen the default ID/name-restricted mode is requested, for tools whose unrestricted search is the default (Chocolatey’s--by-id-only), orNone. SeeSEARCH_REFINEMENT_KEYS.
- parse_mode: str = 'none'¶
How to turn the command’s stdout into packages:
"regex"(per-line named groups),"json"(structured extraction), or"none"for command-only operations that produce no inventory (install, remove, sync, …).
- regex: str | None = None¶
Regular expression matched against each stdout line in
"regex"mode.Recognized named groups:
package_id(required),installed_versionandlatest_version(optional). Compiled withre.MULTILINE.
- class meta_package_manager.definitions.ManagerDefinition(manager_id, name, platforms, homepage_url, documentation_url, repository_url, wikipedia_url, logo, cli_fields, operations)[source]¶
Bases:
objectA brand-new package manager declared from a
[mpm.overrides.<id>]section.Produced by
parse_manager_definition()after validation, consumed bybuild_manager_class().- platforms: tuple[str, ...]¶
Platform and group ID strings, resolved to
extra_platforms.Platformmembers at build time.
- documentation_url: str | None¶
Entry point of the project’s own documentation, for documentation reference only.
- repository_url: str | None¶
Repository holding the project’s code, for documentation reference only.
- wikipedia_url: str | None¶
English Wikipedia article about the project, for documentation reference only.
- cli_fields: dict[str, object]¶
Overridable CLI-execution attributes (
cli_names,requirement,version_regexes, …), pre-coerced to their runtime types.
- operations: dict[str, OperationSpec]¶
Declared operations keyed by name (
installed,install, …).
- class meta_package_manager.definitions.ConfigDrivenManager[source]¶
Bases:
PackageManagerBase class for managers synthesized from configuration.
Carries no operation methods on purpose: only the dynamically-created subclass returned by
build_manager_class()defines the operations the user actually declared, someta_package_manager.capabilities.implements()reports an accurate capability set. Defining an operation here would make every config-defined manager falsely advertise it.Exists mainly as a marker (
isinstance(manager, ConfigDrivenManager)distinguishes user-defined managers from built-ins) and as a shared home for any future config-driven behavior.Initialize
cli_errorslist.- cli_names: tuple[str, ...] = ('configdrivenmanager',)¶
List of CLI names the package manager is known as.
This list of recognized CLI names is ordered by priority. That way we can influence the search of the right binary.
- ..hint::
This was helpful in the case of the Python transition from 2.x to 3.x, where multiple versions of the same executable were named
pythonorpython3.
By default, this property’s value is derived from the manager’s ID (see the
MetaPackageManager.__init__method above).
- documentation_url: str | None = None¶
Entry point of the project’s own documentation, or
Nonewhen it has none.The manual, the documentation site, or the man page of the CLI
mpmdrives: whichever page a user reads to learn the commands this manager wraps. Listed betweenhomepage_urlandrepository_urlin the links of the manager’s page, so a reader reaching for the tool’s reference finds it in the box of facts rather than in the prose below it.Left unset where a link would state a fact twice or invent one: a tool documenting itself in its repository alone, whose README
repository_urlalready reaches. A page about the ecosystem rather than the tool does not qualify either.Where a project’s only site is its manual, that address belongs here and
homepage_urlstays unset: the slot names what the page is, and a reader reaching for the reference looks under the documentation link.Never inherited, like every other link: the AUR helpers extending
pacmaneach document themselves.
- homepage_url: str | None = None¶
Home page of the project, only used in documentation for reference.
Left unset when the home page is the project’s repository, which
repository_urlnames on its own, and when it is the project’s manual, whichdocumentation_urlnames. Never inherited, like the other links.
- id: str = 'configdrivenmanager'¶
Package manager’s ID.
Derived by defaults from the lower-cased class name in which underscores
_are replaced by dashes-.This ID must be unique among all package manager definitions and lower-case, as they’re used as feature flags for the mpm CLI.
- name: str = 'ConfigDrivenManager'¶
Return package manager’s common name.
Default value is based on class name.
- repository_url: str | None = None¶
Repository holding the project’s code, or
Nonewhen it has no public one.Linked from the manager’s documentation page. Also what the weekly metrics sample reads:
docs/docs_update.pywrites it into the[tool.repomatic.metrics] subjectsofpyproject.tomlwhen its forge answers the sampler, through a mirror for a forge that does not.Never inherited, for the same reason as
wikipedia_url: the AUR helpers extendingpacmaneach live in a repository of their own.
- virtual: bool = False¶
Should we expose the package manager to the user?
Virtual package manager are just skeleton classes used to factorize code among managers of the same family.
- wikipedia_url: str | None = None¶
English Wikipedia article about the project, or
Nonewhen it has none.Listed last in the links of the manager’s documentation page. The article covers the project that home page names, or is a redirect Wikipedia keeps under the project’s name, landing on the part of a broader article that describes it:
Cargo_(software)opens the Cargo section of the Rust article. An article that merely mentions the project does not count, nor does one about a related subject:lazyis a Neovim plugin manager, and the Neovim article is not about it.Never inherited: the metaclass resets it to
Noneon any class not declaring its own. A subclass often wraps a distinct project, like the six AUR helpers extendingpacman, and would otherwise present pacman’s article as its own. Documentation-only, likehomepage_url.
- definition_source: str | None = None¶
Repo-relative path to the bundled TOML file this manager was defined in.
Set by
build_bundled_managers()for the managers mpm ships as package data; staysNonefor a manager defined in a user’s own configuration file. The documentation generator links a bundled manager’s benchmark entry to this file, a config-defined manager having no Python source line to point at.
- meta_package_manager.definitions.parse_manager_definition(manager_id, section)[source]¶
Validate and parse one
[mpm.overrides.<id>]definition section.Returns a
ManagerDefinitionready forbuild_manager_class(). Raisesclick_extra.ValidationError(path relative to the[mpm.overrides]root) on any problem, so the same function backs both--validate-configand the runtime registration path.- Return type:
- meta_package_manager.definitions.OPERATION_FACTORIES: Final[Mapping[str, tuple[str, Callable[[...], object]]]] = {'cleanup_cache': ('cleanup_cache', <function _make_void>), 'cleanup_orphan': ('cleanup_orphan', <function _make_void>), 'cleanup_repair': ('cleanup_repair', <function _make_void>), 'doctor': ('doctor_cli', <function _make_cli_builder>), 'install': ('install', <function _make_install>), 'installed': ('installed', <function _make_query_property>), 'mark_explicit': ('mark_explicit', <function _make_package_command>), 'orphans': ('orphans', <function _make_query_property>), 'outdated': ('outdated', <function _make_query_property>), 'remove': ('remove', <function _make_package_command>), 'remove_orphan': ('remove_orphan', <function _make_package_command>), 'search': ('search', <function _make_search>), 'sync': ('sync', <function _make_void>), 'upgrade_all': ('upgrade_all_cli', <function _make_cli_builder>), 'upgrade_one': ('upgrade_one_cli', <function _make_upgrade_one_cli>)}¶
Method each declared operation lands on, and the factory synthesizing it.
Keyed by the operation name of the definition schema (
ALL_DEFINITION_OPERATIONS), which differs from the method name for the three that hand a command line to a base-class orchestrator:doctorlands ondoctor_cli,upgrade_oneonupgrade_one_cliandupgrade_allonupgrade_all_cli. The query factories take the compiled regex too, whichbuild_manager_class()passes to every factory of aQUERY_OPERATIONSmember.
- meta_package_manager.definitions.build_manager_class(definition)[source]¶
Synthesize a
PackageManagersubclass from a validated definition.Assembles a class namespace from the definition’s identity and CLI fields, then adds one method (or property) per declared operation. The operations marked
sudo = truemake up itsprivileged_operations. Only the declared operations land in the namespace, someta_package_manager.capabilities.implements()reflects exactly what the user configured. Single- and all-package upgrades map toupgrade_one_cli()/upgrade_all_cli()so the inheritedupgrade()orchestrator drives them, just like the built-in managers.- Return type:
- meta_package_manager.definitions.BUNDLED_DEFINITIONS_PACKAGE: Final[str] = 'meta_package_manager.managers'¶
Import package whose
*.tomlresources hold mpm’s bundled manager definitions.
- meta_package_manager.definitions.load_bundled_definitions() tuple[tuple[ManagerDefinition, str], ...][source]¶
Parse every bundled
[mpm.overrides.<id>]definition shipped as package data.Reads each
*.tomlresource ofBUNDLED_DEFINITIONS_PACKAGEviaimportlib.resources(so it works the same from an unpacked install, a zip or a Nuitka onefile), and validates every section withparse_manager_definition(). Returns(definition, source)pairs, wheresourceis the repo-relative path used to link the manager’s documentation. Cached because the shipped files never change at runtime.A malformed bundled file is a packaging bug, but it is logged and skipped rather than raised so one bad resource cannot break
mpmstartup for everyone. The hermetictest_bundled_inventoryandtest_bundled_registeredkeep the shipped files valid.- Return type:
- meta_package_manager.definitions.bundled_manager_ids()[source]¶
IDs of the managers mpm ships as bundled configuration definitions.
- meta_package_manager.definitions.build_bundled_managers()[source]¶
Instantiate every bundled definition into a live, pool-ready manager.
Each
ConfigDrivenManagersubclass records the TOML file it came from inConfigDrivenManager.definition_source, so the documentation generator can link to it. Called once bymeta_package_manager.pool.ManagerPool.register.- Return type: