Skip to main content

Unified API to handle several package managers.

Project description

Meta Package Manager

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.
  -t, --table-format [simple|plain|fancy]
                                  Rendering format of tables. 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    Available    Location            
╞═══════════════════╪══════╪═════════════╪═════════════════════╡
 Atom's apm        │ apm  │ ✅           │ /usr/local/bin/apm  │
├───────────────────┼──────┼─────────────┼─────────────────────┤
│ Homebrew          │ brew │ ✅           │ /usr/local/bin/brew │
├───────────────────┼──────┼─────────────┼─────────────────────┤
│ Homebrew Cask     │ cask │ ✅           │ /usr/local/bin/brew │
├───────────────────┼──────┼─────────────┼─────────────────────┤
│ Ruby Gems         │ gem  │ ✅           │ /usr/local/bin/gem  │
├───────────────────┼──────┼─────────────┼─────────────────────┤
│ Mac AppStore      │ mas  │ ✅           │ /usr/local/bin/mas  │
├───────────────────┼──────┼─────────────┼─────────────────────┤
│ 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

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+).

Changelog

1.9.0 (2016-09-23)

  • Fix bumpversion configuration to target CHANGES.rst instead of README.rst.

  • Render list of detected managers in a table.

  • Use conda in Travis tests to install specific versions of Python across the range of OSX workers.

  • Drop support for PyPy while we search a way to install it on OSX with Travis.

  • Let mpm auto-detect package manager definitions.

  • Show package manager IDs in mpm managers CLI output.

  • Rename package_manager.7h.py BitBar plugin to meta_package_manager.7h.py.

  • Give each package manager its own dedicated short string ID.

  • Keep a cache of instanciated package manager.

  • Add unittests around package manager definitions.

  • Do not display location of inactive managers, even if hard-coded.

  • Split-up CLI-producing methods and CLI running methods in PackageManager base class.

  • Add a new update CLI sub-command.

  • Add a new sync CLI sub-command.

  • Rename managers’ active property to available.

  • Move all package manager definitions in a dedicated folder.

  • Add simple CLI unittests. Closes #2.

  • Implement outdated CLI sub-command.

  • Allow selection of table rendering.

  • Fix parsing of unversioned cask packages. Closes #6.

1.8.0 (2016-08-22)

  • Move the plugin to its own repository.

  • Rename package-manager project to meta-package-manager.

  • Add a README.rst file.

  • License under GPLv2+.

  • Add .gitignore config.

  • Add Python package skeleton. Closes #1.

  • Split CHANGES.rst out of README.rst.

  • Add Travis CI configuration.

  • Use semver-like 3-components version number.

  • Copy all BitBar plugin code to Python module.

  • Give each supported package manager its own module file.

  • Add minimal mpm meta CLI to list supported package managers.

  • Add default bumpversion, isort, nosetests, coverage, pep8 and pylint default configuration.

1.7.0 (2016-08-16)

  • Fix issues with $PATH not having Homebrew/Macports.

  • New workaround for full pip upgrade command.

  • Workaround for Homebrew Cask full upgrade command.

  • Grammar fix when 0 packages need updated.

1.6.0 (2016-08-10)

  • Work around the lacks of full pip upgrade command.

  • Fix UnicodeDecodeError on parsing CLI output.

1.5.0 (2016-07-25)

  • Add support for mas.

  • Don’t show all stderr as err (check return code for error state).

1.4.0 (2016-07-10)

  • Don’t attempt to parse empty lines.

  • Check for linked npm packages.

  • Support system or Homebrew Ruby Gems (with proper sudo setup).

1.3.0 (2016-07-09)

  • Add changelog.

  • Add reference to package manager’s issues.

  • Force Cask update before evaluating available packages.

  • Add sample of command output as version parsing can be tricky.

1.2.0 (2016-07-08)

  • Add support for both pip2 and pip3, Node’s npm, Atom’s apm, Ruby’s gem.

  • Fixup brew cask checking.

  • Don’t die on errors.

1.1.0 (2016-07-07)

  • Add support for Python’s pip.

1.0.0 (2016-07-05)

  • Initial public release.

  • Add support for Homebrew and Cask.

Project details


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-1.9.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distributions

meta_package_manager-1.9.0-py2.7.egg (24.2 kB view details)

Uploaded Source

meta_package_manager-1.9.0-py2-none-any.whl (30.3 kB view details)

Uploaded Python 2

File details

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

File metadata

File hashes

Hashes for meta-package-manager-1.9.0.tar.gz
Algorithm Hash digest
SHA256 59e5d8f35bd1b876de8dd32f98b6e9cfe40cb86a76abd3310d7590ad3a5c06e5
MD5 7bfee85e7406befe7ce47f090eb4c443
BLAKE2b-256 c5c4abcd802d69a398ef36c2febe4fa669df212aa5bef82963ea4d966c0891f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for meta_package_manager-1.9.0-py2.7.egg
Algorithm Hash digest
SHA256 c1a760b4251be4e7663a177f519f5025ffdd9c0624b21170eaa8347600019dd1
MD5 129ab3075c5b55f6658511ff762a4983
BLAKE2b-256 f6dd184772e2fb0399bb26359912b4cdf4325151ff05fbe0b0cf98d822d78439

See more details on using hashes here.

File details

Details for the file meta_package_manager-1.9.0-py2-none-any.whl.

File metadata

File hashes

Hashes for meta_package_manager-1.9.0-py2-none-any.whl
Algorithm Hash digest
SHA256 796aae3e74a1c85caca797a0ebbf32eaab36cebb53d3d0cf5b44ec284dd423d5
MD5 c2eb0a7b562285c0b237de77f69424fc
BLAKE2b-256 02ff52622ac1b52b273c728fd7cfc024106348b737952e62d7b4d1a581e7b8a6

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