Brew

Manage brew packages on mac/OSX. See https://brew.sh/

brew.cask_upgrade

Upgrades all brew casks.

brew.cask_upgrade()

brew.casks

Add/remove/update brew casks.

brew.casks(packages=None, present=True, latest=False, upgrade=False)
  • packages: list of packages to ensure

  • present: whether the packages should be installed

  • latest: whether to upgrade packages without a specified version

  • upgrade: run brew cask upgrade before installing packages

Versions:

Package versions can be pinned like brew: <pkg>@<version>.

Example:

brew.casks(
    {'Upgrade and install the latest package via casks'},
    ['godot'],
    upgrade=True,
    latest=True,
)

brew.packages

Add/remove/update brew packages.

brew.packages(packages=None, present=True, latest=False, update=False, upgrade=False)
  • packages: list of packages to ensure

  • present: whether the packages should be installed

  • latest: whether to upgrade packages without a specified version

  • update: run brew update before installing packages

  • upgrade: run brew upgrade before installing packages

Versions:

Package versions can be pinned like brew: <pkg>@<version>.

Examples:

# Update package list and install packages
brew.packages(
    {'Install Vim and vimpager'},
    ['vimpager', 'vim'],
    update=True,
)

# Install the latest versions of packages (always check)
brew.packages(
    {'Install latest Vim'},
    ['vim'],
    latest=True,
)

brew.tap

Add/remove brew taps.

brew.tap(name, present=True)
  • name: the name of the tasp

  • present: whether this tap should be present or not

Examples:

brew.tap(
    {'Add a brew tap'},
    'includeos/includeos',
)

# multiple taps
taps = ['includeos/includeos', 'ktr0731/evans']
for tap in taps:
    brew.tap(
        {f'Add brew tap {tap}'},
        tap,
    )

brew.update

Updates brew repositories.

brew.update()

brew.upgrade

Upgrades all brew packages.

brew.upgrade()