meta_package_manager.base module — Meta Package Manager 2.4.0 documentation

# meta_package_manager.base module

exception `meta_package_manager.base.` `CLIError`(code, output, error)

  Bases: `exceptions.Exception`

  An error occured when running package manager CLI.

  The exception internally keeps the result of CLI execution.

class `meta_package_manager.base.` `PackageManager`

  Bases: `object`

  Package manager definition.

  `cli_path` = None
  `cli_args` = []
  `platforms` = frozenset([])
  `requirement` = None
  `get_version`()

    Invoke the manager and extract its own reported version.

  `version_string`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `version`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `id`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `name`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `supported`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `exists`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `executable`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `fresh`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `available`

    The `cachedproperty` is used similar to `property`, except that the wrapped method is only called once. This is commonly used to implement lazy attributes.

    After the property has been accessed, the value is stored on the instance itself, using the same name as the cachedproperty. This allows the cache to be cleared with `delattr()`, or through manipulating the object’s `__dict__`.

  `run`(args, dry_run=False)

    Run a shell command, return the output and keep error message.

    Removes ANSI escape codes, and returns ready-to-use strings.

  `sync`()

    Fetch latest versions of installed packages.

  `installed`

    List packaages currently installed on the system.

    Returns a list of dict with package ID, name and version.

  `outdated`

    List currently installed packages having a new version available.

    Returns a list of dict with package ID, name, current installed version and latest upgradeable version.

  `upgrade_cli`(package_id=None)

    Return a bash-compatible full-CLI to upgrade a package.

  `upgrade`(package_id=None, dry_run=False)

    Perform the upgrade of the provided package to latest version.

  `upgrade_all_cli`()

    Return a bash-compatible full-CLI to upgrade all packages.

  `upgrade_all`(dry_run=False)

    Perform a full upgrade of all outdated packages to latest versions.

    If the manager doesn’t implements a full upgrade one-liner, then fall-back to calling single-package upgrade one by one.

  static `render_cli`(cmd, cli_format=u'plain')

    Return a formatted CLI in the provided format.

  static `render_bitbar_cli`(full_cli)

    Format a bash-runnable full-CLI with parameters into bitbar schema.