community.general.pipx module – Manages applications installed with pipx
Note
This module is part of the community.general collection (version 6.6.2).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
To use it in a playbook, specify: community.general.pipx
.
New in community.general 3.8.0
Synopsis
Manage Python applications installed in isolated virtualenvs using pipx.
Parameters
Parameter |
Comments |
---|---|
Install the project in editable mode. Choices:
|
|
Path to the If not specified, the module will use |
|
Force modification of the application’s virtual environment. See Only used when state=install, state=upgrade, state=upgrade_all, state=latest, or state=inject. Choices:
|
|
Upgrade the injected packages along with the application. Only used when state=upgrade, state=upgrade_all, or state=latest. This is used with state=upgrade and state=latest since community.general 6.6.0. Choices:
|
|
Base URL of Python Package Index. Only used when state=install, state=upgrade, state=latest, or state=inject. |
|
Packages to be injected into an existing virtual environment. Only used when state=inject. |
|
Add apps from the injected packages. Only used when state=inject. Choices:
|
|
Include applications of dependent packages. Only used when state=install, state=latest, or state=inject. Choices:
|
|
The name of the application to be installed. It must to be a simple package name. For passing package specifications or installing from URLs or directories, please use the source option. |
|
Arbitrary arguments to pass directly to |
|
Python version to be used when creating the application virtual environment. Must be 3.6+. Only used when state=install, state=latest, state=reinstall, or state=reinstall_all. |
|
If the application source, such as a package with version specifier, or an URL, directory or any other accepted specification. See When specified, the |
|
Desired state for the application. The states The state Choices:
|
|
Give application virtual environment access to the system site-packages directory. Only used when state=install or state=latest. Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: full |
Will return details on what has changed (or possibly needs changing in |
Notes
Note
This module does not install the
pipx
python package, however that can be easily done with the module ansible.builtin.pip.This module does not require
pipx
to be in the shellPATH
, but it must be loadable by Python as a module.This module will honor
pipx
environment variables such as but not limited toPIPX_HOME
andPIPX_BIN_DIR
passed using the environment Ansible keyword.This module requires
pipx
version 0.16.2.1 or above.Please note that
pipx
requires Python 3.6 or above.This first implementation does not verify whether a specified version constraint has been installed or not. Hence, when using version operators,
pipx
module will always try to execute the operation, even when the application was previously installed. This feature will be added in the future.See also the
pipx
documentation at https://pypa.github.io/pipx/.
Examples
- name: Install tox
community.general.pipx:
name: tox
- name: Install tox from git repository
community.general.pipx:
name: tox
source: git+https://github.com/tox-dev/tox.git
- name: Upgrade tox
community.general.pipx:
name: tox
state: upgrade
- name: Reinstall black with specific Python version
community.general.pipx:
name: black
state: reinstall
python: 3.7
- name: Uninstall pycowsay
community.general.pipx:
name: pycowsay
state: absent
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication