Repository: ansible-collections/community.general

Issue:
pipx install option --install-deps not in version 0.16.4
### Summary

The [pipx plugin](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/packaging/language/pipx.py) has an option `install_deps` which adds an `--install-deps` option to the the `pipx` command line. This causes the `pipx` command to fail with version 0.16.4 of `pipx`.

Version 0.16.4 of the program appears to provide the `--include-deps` option instead.

https://pypa.github.io/pipx/docs/#pipx-install
https://docs.ansible.com/ansible/latest/collections/community/general/pipx_module.html#parameter-install_deps

### Issue Type

Bug Report

### Component Name

pipx

### Ansible Version

```
ansible [core 2.11.6]
```


### Community.general Version

Global version
```
Collection        Version
----------------- -------
community.general 3.8.1
```

Playbook local version
```
Collection        Version
----------------- -------
community.general 4.1.0
```

### Configuration

```console (paste below)
$ ansible-config dump --only-changed

```


### OS / Environment

WSL2 (local)
Ubuntu 20.04 (remote)

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml
community.general.pipx:
  name: "{{ pipx_item }}"
  include_deps: true

```


### Expected Results

The module to complete succesfully

### Actual Results

```console
failed: [laptop] (item=ansible-base) => changed=false
  ansible_loop_var: pipx_item
  cmd: /usr/bin/python3 -m pipx install --install-deps ansible-base
  msg: |-
    usage: __main__.py [-h] [--version]
                       {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions}
                       ...
    __main__.py: error: unrecognized arguments: --install-deps
  pipx_item: ansible-base
  rc: 2
  stderr: |-
    usage: __main__.py [-h] [--version]
                       {install,inject,upgrade,upgrade-all,uninstall,uninstall-all,reinstall,reinstall-all,list,run,runpip,ensurepath,completions}
                       ...
    __main__.py: error: unrecognized arguments: --install-deps
  stderr_lines: <omitted>
  stdout: ''
  stdout_lines: <omitted>
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/packaging/language/pipx.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/packaging/language/pipx.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @russoz
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/plugins/modules/packaging/language/pipx.py b/plugins/modules/packaging/language/pipx.py
--- a/plugins/modules/packaging/language/pipx.py
+++ b/plugins/modules/packaging/language/pipx.py
@@ -167,7 +167,7 @@ class PipX(CmdStateModuleHelper):
     command_args_formats = dict(
         state=dict(fmt=lambda v: [_state_map.get(v, v)]),
         name_source=dict(fmt=lambda n, s: [s] if s else [n], stars=1),
-        install_deps=dict(fmt="--install-deps", style=ArgFormat.BOOLEAN),
+        install_deps=dict(fmt="--include-deps", style=ArgFormat.BOOLEAN),
         inject_packages=dict(fmt=lambda v: v),
         force=dict(fmt="--force", style=ArgFormat.BOOLEAN),
         include_injected=dict(fmt="--include-injected", style=ArgFormat.BOOLEAN),


Test patch:
diff --git a/tests/integration/targets/pipx/tasks/main.yml b/tests/integration/targets/pipx/tasks/main.yml
--- a/tests/integration/targets/pipx/tasks/main.yml
+++ b/tests/integration/targets/pipx/tasks/main.yml
@@ -124,3 +124,29 @@
         - '"ansible-lint" in inject_pkgs_ansible_lint.application'
         - '"licenses" in inject_pkgs_ansible_lint.application["ansible-lint"]["injected"]'
         - uninstall_ansible_lint is changed
+
+##############################################################################
+- name: install jupyter - not working smoothly in freebsd
+  block:
+  - name: ensure application jupyter is uninstalled
+    community.general.pipx:
+      name: jupyter
+      state: absent
+
+  - name: install application jupyter
+    community.general.pipx:
+      name: jupyter
+      install_deps: true
+    register: install_jupyter
+
+  - name: cleanup jupyter
+    community.general.pipx:
+      state: absent
+      name: jupyter
+
+  - name: check assertions
+    assert:
+      that:
+        - install_jupyter is changed
+        - '"ipython" in install_jupyter.stdout'
+  when: ansible_system != 'FreeBSD'