From 90de95c7b2259a0016684eaf6e41b02105534ad6 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Tue, 30 Nov 2021 08:33:31 +0100 Subject: [PATCH] pipx - fixed --include-apps bug (#3800) (#3818) * pipx - fixed --include-apps bug * added changelog fragment * skipped freebsd for the last test (cherry picked from commit bc619bcefc62f4f9848eb64ba37b893513cf262c) Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- .../fragments/3800-pipx-include-apps.yaml | 2 ++ plugins/modules/packaging/language/pipx.py | 2 +- tests/integration/targets/pipx/tasks/main.yml | 26 +++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3800-pipx-include-apps.yaml diff --git a/changelogs/fragments/3800-pipx-include-apps.yaml b/changelogs/fragments/3800-pipx-include-apps.yaml new file mode 100644 index 0000000000..49113ed450 --- /dev/null +++ b/changelogs/fragments/3800-pipx-include-apps.yaml @@ -0,0 +1,2 @@ +bugfixes: + - pipx - passes the correct command line option ``--include-apps`` (https://github.com/ansible-collections/community.general/issues/3791). diff --git a/plugins/modules/packaging/language/pipx.py b/plugins/modules/packaging/language/pipx.py index f771cf6025..64cebbceed 100644 --- 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), diff --git a/tests/integration/targets/pipx/tasks/main.yml b/tests/integration/targets/pipx/tasks/main.yml index 67f65b9a48..ebf2b31076 100644 --- 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'