meta_package_manager package — Meta Package Manager 2.3.0 documentation

# meta_package_manager package

## Subpackages

- meta_package_manager.bitbar package
  - Submodules
  - meta_package_manager.bitbar.meta_package_manager.7h module
  - Module contents
- meta_package_manager.managers package
  - Submodules
  - meta_package_manager.managers.apm module
  - meta_package_manager.managers.gem module
  - meta_package_manager.managers.homebrew module
  - meta_package_manager.managers.mas module
  - meta_package_manager.managers.npm module
  - meta_package_manager.managers.pip module
  - Module contents
- meta_package_manager.tests package
  - Submodules
  - meta_package_manager.tests.case module
  - meta_package_manager.tests.test_bitbar_plugin module
  - meta_package_manager.tests.test_cli module
  - meta_package_manager.tests.test_managers module
  - Module contents

## Submodules

## 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.

class `meta_package_manager.base.` `PackageManager`

  Bases: `object`

  Package manager definition.

  `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__`.

  `cli_args` = []
  `cli_path` = None
  `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__`.

  `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__`.

  `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__`.

  `get_version`()

    Invoke the manager and extract its own reported version.

  `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__`.

  `platforms` = frozenset([])
  static `render_bitbar_cli`(full_cli)

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

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

    Return a formatted CLI in the provided format.

  `requirement` = None
  `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.

  `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__`.

  `sync`()

    Fetch latest versions of installed packages.

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

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

    Perform the upgrade of the provided package to latest version.

  `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.

  `upgrade_all_cli`()

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

  `upgrade_cli`(package_id=None)

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

  `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__`.

  `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__`.

## meta_package_manager.cli module

`meta_package_manager.cli.` `json`(data)

  Utility function to render data structure into pretty printed JSON.

## meta_package_manager.platform module

Helpers and utilities to handle platform idiosyncracies.

`meta_package_manager.platform.` `current_os`()

  Return ID and label of current OS.

`meta_package_manager.platform.` `is_linux`()

  Return True only if current platform is Linux.

`meta_package_manager.platform.` `is_macos`()

  Return True only if current platform is macOS.

`meta_package_manager.platform.` `is_windows`()

  Return True only if current platform is Windows.

`meta_package_manager.platform.` `os_label`(os_id)

  Return platform label for user-friendly output.

## Module contents

Expose package-wide elements.