Pipx Operations

Manage pipx (python) applications.

Facts used in these operations: server.Path, pipx.PipxEnvironment, pipx.PipxPackages.

pipx.ensure_path

Ensure pipx bin dir is in the PATH.

pipx.ensure_path()

pipx.packages

Install/remove/update pipx packages.

pipx.packages(packages=None, present=True, latest=False, extra_args=None)
  • packages: list of packages to ensure
  • present: whether the packages should be installed
  • latest: whether to upgrade packages without a specified version
  • extra_args: additional arguments to the pipx command
Versions:
Package versions can be pinned like pip: <pkg>==<version>.

Example:

pipx.packages(
    name="Install ",
    packages=["pyinfra"],
)

pipx.upgrade_all

Upgrade all pipx packages.

pipx.upgrade_all()