Skip to main content

Unified API to handle several package managers.

Project description

A CLI and a BitBar plugin to simplify software upgrades from several package managers.

Stable release: Last release Python versions Software license Requirements freshness

Development: Unit-tests status Coverage Status Code Quality

Obligatory XKCD.

Source: XKCD #1654.

Supported

Only macOS platform is supported.

Package manager

Individual upgrade

Full upgrade

Homebrew

Homebrew Cask

Python 2 pip

Python 3 pip

Node’s npm

Atom’s apm

Ruby’s gem

Mac AppStore via mas

If you’re bored, feel free to add support for new package manager. See the list of good candidates.

Usage

Examples of the package’s mpm CLI.

List global options and commands:

$ mpm
Usage: mpm [OPTIONS] COMMAND [ARGS]...

  CLI for multi-package manager updates and upgrades.

Options:
  -v, --verbosity LEVEL           Either CRITICAL, ERROR, WARNING, INFO or
                                  DEBUG. Defaults to INFO.
  -o, --output-format [simple|plain|json|fancy]
                                  Rendering mode of the output. Defaults to
                                  fancy.
  --version                       Show the version and exit.
  --help                          Show this message and exit.

Commands:
  managers  List supported package managers and their location.
  outdated  List available updates.
  sync      Sync local package info.
  update    Update all packages.

List all supported package managers and their status on current system:

$ mpm managers
╒═══════════════════╤══════╤═════════════════════╤═════════╤══════════════╤═══════════╕
 Package manager    ID    CLI path             Found    Executable    Version   
╞═══════════════════╪══════╪═════════════════════╪═════════╪══════════════╪═══════════╡
 Atom's apm        │ apm  │ /usr/local/bin/apm  │ ✅       │ ✅            │ ✅         │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Homebrew          │ brew │ /usr/local/bin/brew │ ✅       │ ✅            │ ✅  1.1.2  │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Homebrew Cask     │ cask │ /usr/local/bin/brew │ ✅       │ ✅            │ ✅  1.1.2  │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Ruby Gems         │ gem  │ /usr/bin/gem        │ ✅       │ ✅            │ ✅         │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Mac AppStore      │ mas  │ /usr/local/bin/mas  │ ✅       │ ✅            │ ✅  1.3.1  │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Node's npm         npm   /usr/local/bin/npm                                 
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
 Python 2's Pip    │ pip2 │ /usr/local/bin/pip2 │ ✅       │ ✅            │ ✅         │
├───────────────────┼──────┼─────────────────────┼─────────┼──────────────┼───────────┤
│ Python 3's Pip     pip3  /usr/local/bin/pip3                                
╘═══════════════════╧══════╧═════════════════════╧═════════╧══════════════╧═══════════╛

BitBar plugin

A copy of the latest stable version of the Meta Package Manager BitBar plugin is always available on BitBar website and plugin repository.

Bitbar plugin screenshot.

History

The package_manager.py script started its life in my ‘dotfile’ repository, as a rewrite from Bash to Python of the ‘brew-updates.sh’ script.

I then merged both Homebrew and Cask upgrade in the same single script as both were competing with each other when run concurrently.

I finally proposed the script for inclusion in the official BitBar plugin repository. It lived there for a couple of weeks and saw a huge amount of contributions by the community.

With its complexity increasing, it was decided to move the plugin to its own repository. For details, see the migration script.

Current status

Active development of the script is continuing here, in the exact same conditions as we were before moving the repository, like nothing happened.

Each time we reach a releaseable script, we simply tag it and push a copy to the BitBar plugin repository. Plain and simple.

At the same time we maintain a Python library on the side. The library is going to handle all idiosyncracies of supported package managers under a unified API.

Once the library is good enough, we’ll evaluate rebasing the original plugin on it, and lay out a plan for a painless transition, from the standalone script to a bare BitBar-plugin depending on the library alone.

In the mean time we have to temporarily manage duplicate code. But at least the whole project is kept in one centralized place, trying to tackle the same issues.

Contributors

License

This software is licensed under the GNU General Public License v2 or later (GPLv2+).

Changes for v2.1.0 (2016-12-14)

  • Adjust rendering of BitBar plugin errors.

  • Fix fetching of log level names in Python 3.4+.

  • Print CLI output in unittests.

  • Print more debug info in unittests when CLI produce tracebacks.

  • Drop support and unittests on Mac OS X 10.9.

  • Add new macOS 10.12 target for Travis CI builds.

  • Move BitBar plugin within the Python module.

  • Show unmet version requirements in table output for mpm managers sub-command.

  • Fix duplicates in outdated packages by indexing them by ID.

  • Unittest simple call of BitBar plugin.

  • Always print the raw, un-normalized version of managers, as reported by themselves.

  • Fetch version of all managers.

  • Make manager version mandatory.

  • Bump requirement to readme_renderer >= 16.0.

  • Always remove ANSI codes from CLI output.

  • Fix rendering of unicode logs.

  • Bump requirement to click_log >= 0.1.5.

  • Force LANG environment variable to en_US.UTF-8.

  • Share same code path for CLI execution between mpm and BitBar plugin.

  • Add a -d/--dry-run option to mpm upgrade sub-command.

  • Remove hard-requirement on macOS platform. Refs #7.

  • Fix upgrade of setuptools in macOS + Python 3.3 Travis jobs.

Full changelog.

Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meta-package-manager-2.1.0.tar.gz (30.4 kB view details)

Uploaded Source

Built Distributions

meta_package_manager-2.1.0-py2.py3-none-any.whl (39.2 kB view details)

Uploaded Python 2 Python 3

meta_package_manager-2.1.0-py2.7.egg (33.4 kB view details)

Uploaded Source

File details

Details for the file meta-package-manager-2.1.0.tar.gz.

File metadata

File hashes

Hashes for meta-package-manager-2.1.0.tar.gz
Algorithm Hash digest
SHA256 f221e544611b0868c71f74cb51f6077702ee20b7b5bad49deaf2c46fd9ad5beb
MD5 791d9ebc012b51473449ddce05bca585
BLAKE2b-256 31d6d27e9f6ed8735c4354eaf7fa6b8f82525628ef03f0804bf92540968ffefd

See more details on using hashes here.

File details

Details for the file meta_package_manager-2.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for meta_package_manager-2.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f8c1f001004be61416e05ea869a6b4a6f21ff7a29d94c3c93f172a5e2f2ef158
MD5 58a4f0088a3d411d6fc67664df32111a
BLAKE2b-256 668d787927a8d0eeab5244b0066e9ca40d53aafb73ad8a6fa527c1e5d7dcaf79

See more details on using hashes here.

File details

Details for the file meta_package_manager-2.1.0-py2.7.egg.

File metadata

File hashes

Hashes for meta_package_manager-2.1.0-py2.7.egg
Algorithm Hash digest
SHA256 67359f0e8d11d337d33c260976d9e11703ca48a244df0ebf68e50cedfde42b33
MD5 1cf655b824ca12873b121b5c0d21abde
BLAKE2b-256 954eda602d8745d2a38412988c265d7d916c977868627675944047fc07b64262

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page